SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.
Python attacksurfacecticybersecurityfootprintinghackinginformation-gatheringinformation-securityinfosecintelligence-gatheringosintosint-frameworkosint-reconnaissanceosint-toolpentestingpythonreconsecurity-toolsthreat-intelligencethreatintel
sfwebui: Move js/css libraries to ./static/node_modules (#1295)
bcoles703fe792eb61
diff --git a/.gitignore b/.gitignoreindex ead0ee4e..3f55b113 100644--- a/.gitignore+++ b/.gitignore@@ -7,6 +7,55 @@ passwdspiderfoot.crtspiderfoot.key+spiderfoot/static/node_modules/*++spiderfoot/static/node_modules/alertifyjs/*+spiderfoot/static/node_modules/alertifyjs/build/*+spiderfoot/static/node_modules/alertifyjs/build/css/*++!spiderfoot/static/node_modules/alertifyjs/+!spiderfoot/static/node_modules/alertifyjs/build/+!spiderfoot/static/node_modules/alertifyjs/build/alertify.min.js+!spiderfoot/static/node_modules/alertifyjs/build/css/+!spiderfoot/static/node_modules/alertifyjs/build/css/alertify.min.css++spiderfoot/static/node_modules/bootstrap/*+spiderfoot/static/node_modules/bootstrap/fonts/*+spiderfoot/static/node_modules/bootstrap/dist/*+spiderfoot/static/node_modules/bootstrap/dist/js/*+spiderfoot/static/node_modules/bootstrap/dist/css/*+spiderfoot/static/node_modules/bootstrap/fonts/*++!spiderfoot/static/node_modules/bootstrap/+!spiderfoot/static/node_modules/bootstrap/dist/+!spiderfoot/static/node_modules/bootstrap/dist/js/+!spiderfoot/static/node_modules/bootstrap/dist/js/bootstrap.min.js+!spiderfoot/static/node_modules/bootstrap/dist/css/+!spiderfoot/static/node_modules/bootstrap/dist/css/bootstrap.min.css+!spiderfoot/static/node_modules/bootstrap/fonts/+!spiderfoot/static/node_modules/bootstrap/fonts/glyphicons-halflings-regular.woff+!spiderfoot/static/node_modules/bootstrap/fonts/glyphicons-halflings-regular.woff2++spiderfoot/static/node_modules/jquery/*+spiderfoot/static/node_modules/jquery/dist/*++!spiderfoot/static/node_modules/jquery/+!spiderfoot/static/node_modules/jquery/dist/+!spiderfoot/static/node_modules/jquery/dist/jquery.min.js++spiderfoot/static/node_modules/sigma/*+spiderfoot/static/node_modules/sigma/build/*+spiderfoot/static/node_modules/sigma/build/plugins/*++!spiderfoot/static/node_modules/sigma/+!spiderfoot/static/node_modules/sigma/build/+!spiderfoot/static/node_modules/sigma/build/sigma.min.js+!spiderfoot/static/node_modules/sigma/build/plugins/+!spiderfoot/static/node_modules/sigma/build/plugins/sigma.parsers.json.min.js+!spiderfoot/static/node_modules/sigma/build/plugins/sigma.plugins.dragNodes.min.js+!spiderfoot/static/node_modules/sigma/build/plugins/sigma.layout.forceAtlas2.min.js+!spiderfoot/static/node_modules/sigma/build/plugins/sigma.renderers.snapshot.min.js+# Compiled source ####################*.comdiff --git a/spiderfoot/static/js/jquery.min.js b/spiderfoot/static/js/jquery.min.jsdeleted file mode 100644index b0614034..00000000--- a/spiderfoot/static/js/jquery.min.js+++ /dev/null@@ -1,2 +0,0 @@-/*! jQuery v3.5.1 | (c) JS Foundation and other contributors | jquery.org/license */-!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.1",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&j.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(D),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(B," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,"$1"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace($,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split("").sort(D).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(D(this,e||[],!1))},not:function(e){return this.pushStack(D(this,e||[],!0))},is:function(e){return!!D(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var j,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",y.option=!!ce.lastChild;var ge={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,y.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^key/,we=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Te=/^([^.]*)(?:\.(.+)|)/;function Ce(){return!0}function Ee(){return!1}function Se(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function ke(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)ke(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ee;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Ae(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,Ce)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=Te.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=Te.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Ae(t,"click",Ce),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Ae(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ce:Ee,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Ee,isPropagationStopped:Ee,isImmediatePropagationStopped:Ee,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ce,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ce,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ce,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&be.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&we.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Ae(this,e,Se),!1},trigger:function(){return Ae(this,e),!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return ke(this,e,t,n,r)},one:function(e,t,n,r){return ke(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Ee),this.each(function(){S.event.remove(this,e,n,t)})}});var Ne=/<script|<style|<link/i,De=/checked\s*(?:[^=]|=\s*.checked.)/i,je=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function Pe(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&De.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),Pe(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,"script"),Le)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,He),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(je,""),u,l))}return n}function Re(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Oe(o[r],a[r]);else Oe(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Re(this,e,!0)},remove:function(e){return Re(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Pe(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||qe(this,e).appendChild(e)})},prepend:function(){return Pe(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=qe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Pe(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ne.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return Pe(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Me=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Ie=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},We=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Fe=new RegExp(ne.join("|"),"i");function Be(e,t,n){var r,i,o,a,s=e.style;return(n=n||Ie(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Me.test(a)&&Fe.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function $e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px",t.style.height="1px",n.style.height="9px",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=3<parseInt(r.height),re.removeChild(e)),a}}))}();var _e=["Webkit","Moz","ms"],ze=E.createElement("div").style,Ue={};function Xe(e){var t=S.cssProps[e]||Ue[e];return t||(e in ze?e:Ue[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=_e.length;while(n--)if((e=_e[n]+t)in ze)return e}(e)||e)}var Ve=/^(none|table(?!-c[ea]).+)/,Ge=/^--/,Ye={position:"absolute",visibility:"hidden",display:"block"},Qe={letterSpacing:"0",fontWeight:"400"};function Je(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ke(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Ze(e,t,n){var r=Ie(e),i=(!y.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=Be(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Me.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Ke(e,t,n||(i?"border":"content"),o,r,a)+"px"}function et(e,t,n,r,i){return new et.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Be(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Ge.test(t),l=e.style;if(u||(t=Xe(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Ge.test(t)||(t=Xe(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Be(e,t,r)),"normal"===i&&t in Qe&&(i=Qe[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ve.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Ze(e,u,n):We(e,Ye,function(){return Ze(e,u,n)})},set:function(e,t,n){var r,i=Ie(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Ke(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Ke(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Je(0,t,s)}}}),S.cssHooks.marginLeft=$e(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Be(e,"marginLeft"))||e.getBoundingClientRect().left-We(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Je)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Ie(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=et).prototype={constructor:et,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,n=et.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):et.propHooks._default.set(this),this}}).init.prototype=et.prototype,(et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[Xe(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=et.prototype.init,S.fx.step={};var tt,nt,rt,it,ot=/^(?:toggle|show|hide)$/,at=/queueHooks$/;function st(){nt&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(st):C.setTimeout(st,S.fx.interval),S.fx.tick())}function ut(){return C.setTimeout(function(){tt=void 0}),tt=Date.now()}function lt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ct(e,t,n){for(var r,i=(ft.tweeners[t]||[]).concat(ft.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ft(o,e,t){var n,a,r=0,i=ft.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=tt||ut(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:tt||ut(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=ft.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ct,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(ft,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],ft.tweeners[n]=ft.tweeners[n]||[],ft.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],ot.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ct(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?ft.prefilters.unshift(e):ft.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=ft(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&at.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(lt(r,!0),e,t,n)}}),S.each({slideDown:lt("show"),slideUp:lt("hide"),slideToggle:lt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(tt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),tt=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){nt||(nt=!0,st())},S.fx.stop=function(){nt=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},rt=E.createElement("input"),it=E.createElement("select").appendChild(E.createElement("option")),rt.type="checkbox",y.checkOn=""!==rt.value,y.optSelected=it.selected,(rt=E.createElement("input")).value="t",rt.type="radio",y.radioValue="t"===rt.value;var pt,dt=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?pt:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),pt={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=dt[t]||S.find.attr;dt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=dt[o],dt[o]=r,r=null!=a(e,t,n)?o:null,dt[o]=i),r}});var ht=/^(?:input|select|textarea|button)$/i,gt=/^(?:a|area)$/i;function vt(e){return(e.match(P)||[]).join(" ")}function yt(e){return e.getAttribute&&e.getAttribute("class")||""}function mt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):ht.test(e.nodeName)||gt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,yt(this)))});if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,yt(this)))});if(!arguments.length)return this.attr("class","");if((e=mt(t)).length)while(n=this[u++])if(i=yt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,yt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=S(this),r=mt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=yt(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+vt(yt(n))+" ").indexOf(t))return!0;return!1}});var xt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(xt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:vt(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var bt=/^(?:focusinfocus|focusoutblur)$/,wt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!bt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,bt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,wt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,wt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var Tt=C.location,Ct={guid:Date.now()},Et=/\?/;S.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||S.error("Invalid XML: "+e),t};var St=/\[\]$/,kt=/\r?\n/g,At=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function Dt(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||St.test(n)?i(n,t):Dt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)Dt(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)Dt(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&Nt.test(this.nodeName)&&!At.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(kt,"\r\n")}}):{name:t.name,value:n.replace(kt,"\r\n")}}).get()}});var jt=/%20/g,qt=/#.*$/,Lt=/([?&])_=[^&]*/,Ht=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Pt=/^\/\//,Rt={},Mt={},It="*/".concat("*"),Wt=E.createElement("a");function Ft(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Bt(t,i,o,a){var s={},u=t===Mt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function $t(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Wt.href=Tt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Tt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Tt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":It,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?$t($t(e,S.ajaxSettings),t):$t(S.ajaxSettings,e)},ajaxPrefilter:Ft(Rt),ajaxTransport:Ft(Mt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Ht.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Tt.href)+"").replace(Pt,Tt.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(P)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Wt.protocol+"//"+Wt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Bt(Rt,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Ot.test(v.type),f=v.url.replace(qt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(jt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(Et.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Lt,"$1"),o=(Et.test(f)?"&":"?")+"_="+Ct.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+It+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Bt(Mt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<S.inArray("script",v.dataTypes)&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var _t={0:200,1223:204},zt=S.ajaxSettings.xhr();y.cors=!!zt&&"withCredentials"in zt,y.ajax=zt=!!zt,S.ajaxTransport(function(i){var o,a;if(y.cors||zt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(_t[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=vt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Gt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Gt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Yt=C.jQuery,Qt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Qt),e&&C.jQuery===S&&(C.jQuery=Yt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});diff --git a/spiderfoot/static/js/sigma.layout.forceAtlas2.min.js b/spiderfoot/static/js/sigma.layout.forceAtlas2.min.jsdeleted file mode 100644index 65454f3f..00000000--- a/spiderfoot/static/js/sigma.layout.forceAtlas2.min.js+++ /dev/null@@ -1 +0,0 @@-(function(undefined){"use strict";function Supervisor(sigInst,options){var _this=this,workerFn=sigInst.getForceAtlas2Worker&&sigInst.getForceAtlas2Worker();if(options=options||{},_root.URL=_root.URL||_root.webkitURL,this.sigInst=sigInst,this.graph=this.sigInst.graph,this.ppn=10,this.ppe=3,this.config={},this.shouldUseWorker=options.worker===!1?!1:!0&&webWorkers,this.workerUrl=options.workerUrl,this.started=!1,this.running=!1,this.shouldUseWorker){if(this.workerUrl)this.worker=new Worker(this.workerUrl);else{var blob=this.makeBlob(workerFn);this.worker=new Worker(URL.createObjectURL(blob))}this.worker.postMessage=this.worker.webkitPostMessage||this.worker.postMessage}else eval(workerFn);this.msgName=this.worker?"message":"newCoords",this.listener=function(t){_this.nodesByteArray=new Float32Array(t.data.nodes),_this.running&&(_this.applyLayoutChanges(),_this.sendByteArrayToWorker(),_this.sigInst.refresh())},(this.worker||document).addEventListener(this.msgName,this.listener),this.graphToByteArrays(),sigInst.bind("kill",function(){sigInst.killForceAtlas2()})}if("undefined"==typeof sigma)throw"sigma is not declared";var _root=this,webWorkers="Worker"in _root;Supervisor.prototype.makeBlob=function(t){var e;try{e=new Blob([t],{type:"application/javascript"})}catch(s){_root.BlobBuilder=_root.BlobBuilder||_root.WebKitBlobBuilder||_root.MozBlobBuilder,e=new BlobBuilder,e.append(t),e=e.getBlob()}return e},Supervisor.prototype.graphToByteArrays=function(){var t,e,s,r=this.graph.nodes(),i=this.graph.edges(),o=r.length*this.ppn,n=i.length*this.ppe,a={};for(this.nodesByteArray=new Float32Array(o),this.edgesByteArray=new Float32Array(n),t=e=0,s=r.length;s>t;t++)a[r[t].id]=e,this.nodesByteArray[e]=r[t].x,this.nodesByteArray[e+1]=r[t].y,this.nodesByteArray[e+2]=0,this.nodesByteArray[e+3]=0,this.nodesByteArray[e+4]=0,this.nodesByteArray[e+5]=0,this.nodesByteArray[e+6]=1+this.graph.degree(r[t].id),this.nodesByteArray[e+7]=1,this.nodesByteArray[e+8]=r[t].size,this.nodesByteArray[e+9]=0,e+=this.ppn;for(t=e=0,s=i.length;s>t;t++)this.edgesByteArray[e]=a[i[t].source],this.edgesByteArray[e+1]=a[i[t].target],this.edgesByteArray[e+2]=i[t].weight||0,e+=this.ppe},Supervisor.prototype.applyLayoutChanges=function(){for(var t=this.graph.nodes(),e=0,s=0,r=this.nodesByteArray.length;r>s;s+=this.ppn)t[e].x=this.nodesByteArray[s],t[e].y=this.nodesByteArray[s+1],e++},Supervisor.prototype.sendByteArrayToWorker=function(t){var e={action:t||"loop",nodes:this.nodesByteArray.buffer},s=[this.nodesByteArray.buffer];"start"===t&&(e.config=this.config||{},e.edges=this.edgesByteArray.buffer,s.push(this.edgesByteArray.buffer)),this.shouldUseWorker?this.worker.postMessage(e,s):_root.postMessage(e,"*")},Supervisor.prototype.start=function(){if(!this.running){this.running=!0;var t,e;for(t in this.sigInst.cameras)e=this.sigInst.cameras[t],e.edgequadtree._enabled=!1;this.started?this.sendByteArrayToWorker():(this.sendByteArrayToWorker("start"),this.started=!0)}},Supervisor.prototype.stop=function(){if(this.running){var t,e,s;for(t in this.sigInst.cameras)e=this.sigInst.cameras[t],e.edgequadtree._enabled=!0,s=sigma.utils.getBoundaries(this.graph,e.readPrefix),e.settings("drawEdges")&&e.settings("enableEdgeHovering")&&e.edgequadtree.index(this.sigInst.graph,{prefix:e.readPrefix,bounds:{x:s.minX,y:s.minY,width:s.maxX-s.minX,height:s.maxY-s.minY}});this.running=!1}},Supervisor.prototype.killWorker=function(){this.worker?this.worker.terminate():(_root.postMessage({action:"kill"},"*"),document.removeEventListener(this.msgName,this.listener))},Supervisor.prototype.configure=function(t){if(this.config=t,this.started){var e={action:"config",config:this.config};this.shouldUseWorker?this.worker.postMessage(e):_root.postMessage(e,"*")}},sigma.prototype.startForceAtlas2=function(t){return this.supervisor||(this.supervisor=new Supervisor(this,t)),t&&this.supervisor.configure(t),this.supervisor.start(),this},sigma.prototype.stopForceAtlas2=function(){return this.supervisor?(this.supervisor.stop(),this):this},sigma.prototype.killForceAtlas2=function(){return this.supervisor?(this.supervisor.stop(),this.supervisor.killWorker(),this.supervisor=null,this):this},sigma.prototype.configForceAtlas2=function(t){return this.supervisor||(this.supervisor=new Supervisor(this,t)),this.supervisor.configure(t),this},sigma.prototype.isForceAtlas2Running=function(t){return!!this.supervisor&&this.supervisor.running}}).call(this),function(undefined){"use strict";function no_crush(t){var e,s,r,i=["x","y","dx","dy","old_dx","old_dy","mass","convergence","size","fixed"],o=["source","target","weight"],n=["node","centerX","centerY","size","nextSibling","firstChild","mass","massCenterX","massCenterY"];for(s=0,r=n.length;r>s;s++)e=new RegExp("rp\\(([^,]*), '"+n[s]+"'\\)","g"),t=t.replace(e,0===s?"$1":"$1 + "+s);for(s=0,r=i.length;r>s;s++)e=new RegExp("np\\(([^,]*), '"+i[s]+"'\\)","g"),t=t.replace(e,0===s?"$1":"$1 + "+s);for(s=0,r=o.length;r>s;s++)e=new RegExp("ep\\(([^,]*), '"+o[s]+"'\\)","g"),t=t.replace(e,0===s?"$1":"$1 + "+s);return t}function getWorkerFn(){var t=crush?crush(Worker.toString()):Worker.toString();return";("+t+").call(this);"}var _root=this,inWebWorker=!("document"in _root),Worker=function(t){function e(){var t,e,s={},r=arguments.length;for(t=r-1;t>=0;t--)for(e in arguments[t])s[e]=arguments[t][e];return s}function s(t){var e;for(e in t)"hasOwnProperty"in t&&!t.hasOwnProperty(e)||delete t[e];return t}function r(t,e,s){s=s||{};a=t,h=e,u.nodesLength=a.length,u.edgesLength=h.length,i(s)}function i(t){u.settings=e(t,u.settings)}function o(){var t,e,s,r,i,o,n,p,d,l,c,f,y,w,v;for(s=0;s<u.nodesLength;s+=u.ppn)a[s+4]=a[s+2],a[s+5]=a[s+3],a[s+2]=0,a[s+3]=0;if(u.settings.outboundAttractionDistribution){for(d=0,s=0;s<u.nodesLength;s+=u.ppn)d+=a[s+6];d/=u.nodesLength}if(u.settings.barnesHutOptimize){var m,k,b=1/0,M=-(1/0),A=1/0,B=-(1/0);for(g=[],s=0;s<u.nodesLength;s+=u.ppn)b=Math.min(b,a[s]),M=Math.max(M,a[s]),A=Math.min(A,a[s+1]),B=Math.max(B,a[s+1]);for(g[0]=-1,g[1]=(b+M)/2,g[2]=(A+B)/2,g[3]=Math.max(M-b,B-A),g[4]=-1,g[5]=-1,g[6]=0,g[7]=0,g[8]=0,t=1,s=0;s<u.nodesLength;s+=u.ppn)for(e=0;;)if(g[e+5]>=0)m=a[s]<g[e+1]?a[s+1]<g[e+2]?g[e+5]:g[e+5]+u.ppr:a[s+1]<g[e+2]?g[e+5]+2*u.ppr:g[e+5]+3*u.ppr,g[e+7]=(g[e+7]*g[e+6]+a[s]*a[s+6])/(g[e+6]+a[s+6]),g[e+8]=(g[e+8]*g[e+6]+a[s+1]*a[s+6])/(g[e+6]+a[s+6]),g[e+6]+=a[s+6],e=m;else{if(g[e]<0){g[e]=s;break}if(g[e+5]=t*u.ppr,n=g[e+3]/2,p=g[e+5],g[p]=-1,g[p+1]=g[e+1]-n,g[p+2]=g[e+2]-n,g[p+3]=n,g[p+4]=p+u.ppr,g[p+5]=-1,g[p+6]=0,g[p+7]=0,g[p+8]=0,p+=u.ppr,g[p]=-1,g[p+1]=g[e+1]-n,g[p+2]=g[e+2]+n,g[p+3]=n,g[p+4]=p+u.ppr,g[p+5]=-1,g[p+6]=0,g[p+7]=0,g[p+8]=0,p+=u.ppr,g[p]=-1,g[p+1]=g[e+1]+n,g[p+2]=g[e+2]-n,g[p+3]=n,g[p+4]=p+u.ppr,g[p+5]=-1,g[p+6]=0,g[p+7]=0,g[p+8]=0,p+=u.ppr,g[p]=-1,g[p+1]=g[e+1]+n,g[p+2]=g[e+2]+n,g[p+3]=n,g[p+4]=g[e+4],g[p+5]=-1,g[p+6]=0,g[p+7]=0,g[p+8]=0,t+=4,m=a[g[e]]<g[e+1]?a[g[e]+1]<g[e+2]?g[e+5]:g[e+5]+u.ppr:a[g[e]+1]<g[e+2]?g[e+5]+2*u.ppr:g[e+5]+3*u.ppr,g[e+6]=a[g[e]+6],g[e+7]=a[g[e]],g[e+8]=a[g[e]+1],g[m]=g[e],g[e]=-1,k=a[s]<g[e+1]?a[s+1]<g[e+2]?g[e+5]:g[e+5]+u.ppr:a[s+1]<g[e+2]?g[e+5]+2*u.ppr:g[e+5]+3*u.ppr,m!==k){g[k]=s;break}e=m}}if(u.settings.barnesHutOptimize)for(l=u.settings.scalingRatio,s=0;s<u.nodesLength;s+=u.ppn)for(e=0;;)if(g[e+5]>=0){if(w=Math.sqrt(Math.pow(a[s]-g[e+7],2)+Math.pow(a[s+1]-g[e+8],2)),2*g[e+3]/w<u.settings.barnesHutTheta){if(c=a[s]-g[e+7],f=a[s+1]-g[e+8],u.settings.adjustSize?w>0?(v=l*a[s+6]*g[e+6]/w/w,a[s+2]+=c*v,a[s+3]+=f*v):0>w&&(v=-l*a[s+6]*g[e+6]/w,a[s+2]+=c*v,a[s+3]+=f*v):w>0&&(v=l*a[s+6]*g[e+6]/w/w,a[s+2]+=c*v,a[s+3]+=f*v),g[e+4]<0)break;e=g[e+4];continue}e=g[e+5]}else{if(g[e]>=0&&g[e]!==s&&(c=a[s]-a[g[e]],f=a[s+1]-a[g[e]+1],w=Math.sqrt(c*c+f*f),u.settings.adjustSize?w>0?(v=l*a[s+6]*a[g[e]+6]/w/w,a[s+2]+=c*v,a[s+3]+=f*v):0>w&&(v=-l*a[s+6]*a[g[e]+6]/w,a[s+2]+=c*v,a[s+3]+=f*v):w>0&&(v=l*a[s+6]*a[g[e]+6]/w/w,a[s+2]+=c*v,a[s+3]+=f*v)),g[e+4]<0)break;e=g[e+4]}else for(l=u.settings.scalingRatio,r=0;r<u.nodesLength;r+=u.ppn)for(i=0;r>i;i+=u.ppn)c=a[r]-a[i],f=a[r+1]-a[i+1],u.settings.adjustSize?(w=Math.sqrt(c*c+f*f)-a[r+8]-a[i+8],w>0?(v=l*a[r+6]*a[i+6]/w/w,a[r+2]+=c*v,a[r+3]+=f*v,a[i+2]+=c*v,a[i+3]+=f*v):0>w&&(v=100*l*a[r+6]*a[i+6],a[r+2]+=c*v,a[r+3]+=f*v,a[i+2]-=c*v,a[i+3]-=f*v)):(w=Math.sqrt(c*c+f*f),w>0&&(v=l*a[r+6]*a[i+6]/w/w,a[r+2]+=c*v,a[r+3]+=f*v,a[i+2]-=c*v,a[i+3]-=f*v));for(p=u.settings.gravity/u.settings.scalingRatio,l=u.settings.scalingRatio,s=0;s<u.nodesLength;s+=u.ppn)v=0,c=a[s],f=a[s+1],w=Math.sqrt(Math.pow(c,2)+Math.pow(f,2)),u.settings.strongGravityMode?w>0&&(v=l*a[s+6]*p):w>0&&(v=l*a[s+6]*p/w),a[s+2]-=c*v,a[s+3]-=f*v;for(l=1*(u.settings.outboundAttractionDistribution?d:1),o=0;o<u.edgesLength;o+=u.ppe)r=h[o],i=h[o+1],n=h[o+2],y=Math.pow(n,u.settings.edgeWeightInfluence),c=a[r]-a[i],f=a[r+1]-a[i+1],u.settings.adjustSizes?(w=Math.sqrt(Math.pow(c,2)+Math.pow(f,2)-a[r+8]-a[i+8]),u.settings.linLogMode?u.settings.outboundAttractionDistribution?w>0&&(v=-l*y*Math.log(1+w)/w/a[r+6]):w>0&&(v=-l*y*Math.log(1+w)/w):u.settings.outboundAttractionDistribution?w>0&&(v=-l*y/a[r+6]):w>0&&(v=-l*y)):(w=Math.sqrt(Math.pow(c,2)+Math.pow(f,2)),u.settings.linLogMode?u.settings.outboundAttractionDistribution?w>0&&(v=-l*y*Math.log(1+w)/w/a[r+6]):w>0&&(v=-l*y*Math.log(1+w)/w):u.settings.outboundAttractionDistribution?(w=1,v=-l*y/a[r+6]):(w=1,v=-l*y)),w>0&&(a[r+2]+=c*v,a[r+3]+=f*v,a[i+2]-=c*v,a[i+3]-=f*v);var W,L,F,_;if(u.settings.adjustSizes)for(s=0;s<u.nodesLength;s+=u.ppn)a[s+9]||(W=Math.sqrt(Math.pow(a[s+2],2)+Math.pow(a[s+3],2)),W>u.maxForce&&(a[s+2]=a[s+2]*u.maxForce/W,a[s+3]=a[s+3]*u.maxForce/W),L=a[s+6]*Math.sqrt((a[s+4]-a[s+2])*(a[s+4]-a[s+2])+(a[s+5]-a[s+3])*(a[s+5]-a[s+3])),F=Math.sqrt((a[s+4]+a[s+2])*(a[s+4]+a[s+2])+(a[s+5]+a[s+3])*(a[s+5]+a[s+3]))/2,_=.1*Math.log(1+F)/(1+Math.sqrt(L)),a[s]=a[s]+a[s+2]*(_/u.settings.slowDown),a[s+1]=a[s+1]+a[s+3]*(_/u.settings.slowDown));else for(s=0;s<u.nodesLength;s+=u.ppn)a[s+9]||(L=a[s+6]*Math.sqrt((a[s+4]-a[s+2])*(a[s+4]-a[s+2])+(a[s+5]-a[s+3])*(a[s+5]-a[s+3])),F=Math.sqrt((a[s+4]+a[s+2])*(a[s+4]+a[s+2])+(a[s+5]+a[s+3])*(a[s+5]+a[s+3]))/2,_=a[s+7]*Math.log(1+F)/(1+Math.sqrt(L)),a[s+7]=Math.min(1,Math.sqrt(_*(Math.pow(a[s+2],2)+Math.pow(a[s+3],2))/(1+Math.sqrt(L)))),a[s]=a[s]+a[s+2]*(_/u.settings.slowDown),a[s+1]=a[s+1]+a[s+3]*(_/u.settings.slowDown));u.iterations++}function n(t){for(var e=0;t>e;e++)o();p()}var a,h,g,p,u={ppn:10,ppe:3,ppr:9,maxForce:10,iterations:0,converged:!1,settings:{linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:0,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5,startingIterations:1,iterationsPerRender:1}};p="undefined"!=typeof window&&window.document?function(){var t;document.createEvent?(t=document.createEvent("Event"),t.initEvent("newCoords",!0,!1)):(t=document.createEventObject(),t.eventType="newCoords"),t.eventName="newCoords",t.data={nodes:a.buffer},requestAnimationFrame(function(){document.dispatchEvent(t)})}:function(){self.postMessage({nodes:a.buffer},[a.buffer])};var d=function(t){switch(t.data.action){case"start":r(new Float32Array(t.data.nodes),new Float32Array(t.data.edges),t.data.config),n(u.settings.startingIterations);break;case"loop":a=new Float32Array(t.data.nodes),n(u.settings.iterationsPerRender);break;case"config":i(t.data.config);break;case"kill":s(u),a=null,h=null,g=null,self.removeEventListener("message",d)}};self.addEventListener("message",d)},crush=null;if(inWebWorker)eval(getWorkerFn());else{if("undefined"==typeof sigma)throw"sigma is not declared";sigma.prototype.getForceAtlas2Worker=getWorkerFn}}.call(this);\ No newline at end of filediff --git a/spiderfoot/static/js/sigma.min.js b/spiderfoot/static/js/sigma.min.jsdeleted file mode 100644index fa605abf..00000000--- a/spiderfoot/static/js/sigma.min.js+++ /dev/null@@ -1,12184 +0,0 @@-;(function(undefined) {- 'use strict';-- var __instances = {};-- /**- * This is the sigma instances constructor. One instance of sigma represent- * one graph. It is possible to represent this grapĥ with several renderers- * at the same time. By default, the default renderer (WebGL + Canvas- * polyfill) will be used as the only renderer, with the container specified- * in the configuration.- *- * @param {?*} conf The configuration of the instance. There are a lot of- * different recognized forms to instantiate sigma, check- * example files, documentation in this file and unit- * tests to know more.- * @return {sigma} The fresh new sigma instance.- *- * Instanciating sigma:- * ********************- * If no parameter is given to the constructor, the instance will be created- * without any renderer or camera. It will just instantiate the graph, and- * other modules will have to be instantiated through the public methods,- * like "addRenderer" etc:- *- * > s0 = new sigma();- * > s0.addRenderer({- * > type: 'canvas',- * > container: 'my-container-id'- * > });- *- * In most of the cases, sigma will simply be used with the default renderer.- * Then, since the only required parameter is the DOM container, there are- * some simpler way to call the constructor. The four following calls do the- * exact same things:- *- * > s1 = new sigma('my-container-id');- * > s2 = new sigma(document.getElementById('my-container-id'));- * > s3 = new sigma({- * > container: document.getElementById('my-container-id')- * > });- * > s4 = new sigma({- * > renderers: [{- * > container: document.getElementById('my-container-id')- * > }]- * > });- *- * Recognized parameters:- * **********************- * Here is the exhaustive list of every accepted parameters, when calling the- * constructor with to top level configuration object (fourth case in the- * previous examples):- *- * {?string} id The id of the instance. It will be generated- * automatically if not specified.- * {?array} renderers An array containing objects describing renderers.- * {?object} graph An object containing an array of nodes and an array- * of edges, to avoid having to add them by hand later.- * {?object} settings An object containing instance specific settings that- * will override the default ones defined in the object- * sigma.settings.- */- var sigma = function(conf) {- // Local variables:- // ****************- var i,- l,- a,- c,- o,- id;-- sigma.classes.dispatcher.extend(this);-- // Private attributes:- // *******************- var _self = this,- _conf = conf || {};-- // Little shortcut:- // ****************- // The configuration is supposed to have a list of the configuration- // objects for each renderer.- // - If there are no configuration at all, then nothing is done.- // - If there are no renderer list, the given configuration object will be- // considered as describing the first and only renderer.- // - If there are no renderer list nor "container" object, it will be- // considered as the container itself (a DOM element).- // - If the argument passed to sigma() is a string, it will be considered- // as the ID of the DOM container.- if (- typeof _conf === 'string' ||- _conf instanceof HTMLElement- )- _conf = {- renderers: [_conf]- };- else if (Object.prototype.toString.call(_conf) === '[object Array]')- _conf = {- renderers: _conf- };-- // Also check "renderer" and "container" keys:- o = _conf.renderers || _conf.renderer || _conf.container;- if (!_conf.renderers || _conf.renderers.length === 0)- if (- typeof o === 'string' ||- o instanceof HTMLElement ||- (typeof o === 'object' && 'container' in o)- )- _conf.renderers = [o];-- // Recense the instance:- if (_conf.id) {- if (__instances[_conf.id])- throw 'sigma: Instance "' + _conf.id + '" already exists.';- Object.defineProperty(this, 'id', {- value: _conf.id- });- } else {- id = 0;- while (__instances[id])- id++;- Object.defineProperty(this, 'id', {- value: '' + id- });- }- __instances[this.id] = this;-- // Initialize settings function:- this.settings = new sigma.classes.configurable(- sigma.settings,- _conf.settings || {}- );-- // Initialize locked attributes:- Object.defineProperty(this, 'graph', {- value: new sigma.classes.graph(this.settings),- configurable: true- });- Object.defineProperty(this, 'middlewares', {- value: [],- configurable: true- });- Object.defineProperty(this, 'cameras', {- value: {},- configurable: true- });- Object.defineProperty(this, 'renderers', {- value: {},- configurable: true- });- Object.defineProperty(this, 'renderersPerCamera', {- value: {},- configurable: true- });- Object.defineProperty(this, 'cameraFrames', {- value: {},- configurable: true- });- Object.defineProperty(this, 'camera', {- get: function() {- return this.cameras[0];- }- });- Object.defineProperty(this, 'events', {- value: [- 'click',- 'rightClick',- 'clickStage',- 'doubleClickStage',- 'rightClickStage',- 'clickNode',- 'clickNodes',- 'doubleClickNode',- 'doubleClickNodes',- 'rightClickNode',- 'rightClickNodes',- 'overNode',- 'overNodes',- 'outNode',- 'outNodes',- 'downNode',- 'downNodes',- 'upNode',- 'upNodes'- ],- configurable: true- });-- // Add a custom handler, to redispatch events from renderers:- this._handler = (function(e) {- var k,- data = {};-- for (k in e.data)- data[k] = e.data[k];-- data.renderer = e.target;- this.dispatchEvent(e.type, data);- }).bind(this);-- // Initialize renderers:- a = _conf.renderers || [];- for (i = 0, l = a.length; i < l; i++)- this.addRenderer(a[i]);-- // Initialize middlewares:- a = _conf.middlewares || [];- for (i = 0, l = a.length; i < l; i++)- this.middlewares.push(- typeof a[i] === 'string' ?- sigma.middlewares[a[i]] :- a[i]- );-- // Check if there is already a graph to fill in:- if (typeof _conf.graph === 'object' && _conf.graph) {- this.graph.read(_conf.graph);-- // If a graph is given to the to the instance, the "refresh" method is- // directly called:- this.refresh();- }-- // Deal with resize:- window.addEventListener('resize', function() {- if (_self.settings)- _self.refresh();- });- };----- /**- * This methods will instantiate and reference a new camera. If no id is- * specified, then an automatic id will be generated.- *- * @param {?string} id Eventually the camera id.- * @return {sigma.classes.camera} The fresh new camera instance.- */- sigma.prototype.addCamera = function(id) {- var self = this,- camera;-- if (!arguments.length) {- id = 0;- while (this.cameras['' + id])- id++;- id = '' + id;- }-- if (this.cameras[id])- throw 'sigma.addCamera: The camera "' + id + '" already exists.';-- camera = new sigma.classes.camera(id, this.graph, this.settings);- this.cameras[id] = camera;-- // Add a quadtree to the camera:- camera.quadtree = new sigma.classes.quad();-- // Add an edgequadtree to the camera:- if (sigma.classes.edgequad !== undefined) {- camera.edgequadtree = new sigma.classes.edgequad();- }-- camera.bind('coordinatesUpdated', function(e) {- self.renderCamera(camera, camera.isAnimated);- });-- this.renderersPerCamera[id] = [];-- return camera;- };-- /**- * This method kills a camera, and every renderer attached to it.- *- * @param {string|camera} v The camera to kill or its ID.- * @return {sigma} Returns the instance.- */- sigma.prototype.killCamera = function(v) {- v = typeof v === 'string' ? this.cameras[v] : v;-- if (!v)- throw 'sigma.killCamera: The camera is undefined.';-- var i,- l,- a = this.renderersPerCamera[v.id];-- for (l = a.length, i = l - 1; i >= 0; i--)- this.killRenderer(a[i]);-- delete this.renderersPerCamera[v.id];- delete this.cameraFrames[v.id];- delete this.cameras[v.id];-- if (v.kill)- v.kill();-- return this;- };-- /**- * This methods will instantiate and reference a new renderer. The "type"- * argument can be the constructor or its name in the "sigma.renderers"- * package. If no type is specified, then "sigma.renderers.def" will be used.- * If no id is specified, then an automatic id will be generated.- *- * @param {?object} options Eventually some options to give to the renderer- * constructor.- * @return {renderer} The fresh new renderer instance.- *- * Recognized parameters:- * **********************- * Here is the exhaustive list of every accepted parameters in the "options"- * object:- *- * {?string} id Eventually the renderer id.- * {?(function|string)} type Eventually the renderer constructor or its- * name in the "sigma.renderers" package.- * {?(camera|string)} camera Eventually the renderer camera or its- * id.- */- sigma.prototype.addRenderer = function(options) {- var id,- fn,- camera,- renderer,- o = options || {};-- // Polymorphism:- if (typeof o === 'string')- o = {- container: document.getElementById(o)- };- else if (o instanceof HTMLElement)- o = {- container: o- };-- // If the container still is a string, we get it by id- if (typeof o.container === 'string')- o.container = document.getElementById(o.container);-- // Reference the new renderer:- if (!('id' in o)) {- id = 0;- while (this.renderers['' + id])- id++;- id = '' + id;- } else- id = o.id;-- if (this.renderers[id])- throw 'sigma.addRenderer: The renderer "' + id + '" already exists.';-- // Find the good constructor:- fn = typeof o.type === 'function' ? o.type : sigma.renderers[o.type];- fn = fn || sigma.renderers.def;-- // Find the good camera:- camera = 'camera' in o ?- (- o.camera instanceof sigma.classes.camera ?- o.camera :- this.cameras[o.camera] || this.addCamera(o.camera)- ) :- this.addCamera();-- if (this.cameras[camera.id] !== camera)- throw 'sigma.addRenderer: The camera is not properly referenced.';-- // Instantiate:- renderer = new fn(this.graph, camera, this.settings, o);- this.renderers[id] = renderer;- Object.defineProperty(renderer, 'id', {- value: id- });-- // Bind events:- if (renderer.bind)- renderer.bind(- [- 'click',- 'rightClick',- 'clickStage',- 'doubleClickStage',- 'rightClickStage',- 'clickNode',- 'clickNodes',- 'clickEdge',- 'clickEdges',- 'doubleClickNode',- 'doubleClickNodes',- 'doubleClickEdge',- 'doubleClickEdges',- 'rightClickNode',- 'rightClickNodes',- 'rightClickEdge',- 'rightClickEdges',- 'overNode',- 'overNodes',- 'overEdge',- 'overEdges',- 'outNode',- 'outNodes',- 'outEdge',- 'outEdges',- 'downNode',- 'downNodes',- 'downEdge',- 'downEdges',- 'upNode',- 'upNodes',- 'upEdge',- 'upEdges'- ],- this._handler- );-- // Reference the renderer by its camera:- this.renderersPerCamera[camera.id].push(renderer);-- return renderer;- };-- /**- * This method kills a renderer.- *- * @param {string|renderer} v The renderer to kill or its ID.- * @return {sigma} Returns the instance.- */- sigma.prototype.killRenderer = function(v) {- v = typeof v === 'string' ? this.renderers[v] : v;-- if (!v)- throw 'sigma.killRenderer: The renderer is undefined.';-- var a = this.renderersPerCamera[v.camera.id],- i = a.indexOf(v);-- if (i >= 0)- a.splice(i, 1);-- if (v.kill)- v.kill();-- delete this.renderers[v.id];-- return this;- };----- /**- * This method calls the "render" method of each renderer, with the same- * arguments than the "render" method, but will also check if the renderer- * has a "process" method, and call it if it exists.- *- * It is useful for quadtrees or WebGL processing, for instance.- *- * @param {?object} options Eventually some options to give to the refresh- * method.- * @return {sigma} Returns the instance itself.- *- * Recognized parameters:- * **********************- * Here is the exhaustive list of every accepted parameters in the "options"- * object:- *- * {?boolean} skipIndexation A flag specifying wether or not the refresh- * function should reindex the graph in the- * quadtrees or not (default: false).- */- sigma.prototype.refresh = function(options) {- var i,- l,- k,- a,- c,- bounds,- prefix = 0;-- options = options || {};-- // Call each middleware:- a = this.middlewares || [];- for (i = 0, l = a.length; i < l; i++)- a[i].call(- this,- (i === 0) ? '' : 'tmp' + prefix + ':',- (i === l - 1) ? 'ready:' : ('tmp' + (++prefix) + ':')- );-- // Then, for each camera, call the "rescale" middleware, unless the- // settings specify not to:- for (k in this.cameras) {- c = this.cameras[k];- if (- c.settings('autoRescale') &&- this.renderersPerCamera[c.id] &&- this.renderersPerCamera[c.id].length- )- sigma.middlewares.rescale.call(- this,- a.length ? 'ready:' : '',- c.readPrefix,- {- width: this.renderersPerCamera[c.id][0].width,- height: this.renderersPerCamera[c.id][0].height- }- );- else- sigma.middlewares.copy.call(- this,- a.length ? 'ready:' : '',- c.readPrefix- );-- if (!options.skipIndexation) {- // Find graph boundaries:- bounds = sigma.utils.getBoundaries(- this.graph,- c.readPrefix- );-- // Refresh quadtree:- c.quadtree.index(this.graph.nodes(), {- prefix: c.readPrefix,- bounds: {- x: bounds.minX,- y: bounds.minY,- width: bounds.maxX - bounds.minX,- height: bounds.maxY - bounds.minY- }- });-- // Refresh edgequadtree:- if (- c.edgequadtree !== undefined &&- c.settings('drawEdges') &&- c.settings('enableEdgeHovering')- ) {- c.edgequadtree.index(this.graph, {- prefix: c.readPrefix,- bounds: {- x: bounds.minX,- y: bounds.minY,- width: bounds.maxX - bounds.minX,- height: bounds.maxY - bounds.minY- }- });- }- }- }-- // Call each renderer:- a = Object.keys(this.renderers);- for (i = 0, l = a.length; i < l; i++)- if (this.renderers[a[i]].process) {- if (this.settings('skipErrors'))- try {- this.renderers[a[i]].process();- } catch (e) {- console.log(- 'Warning: The renderer "' + a[i] + '" crashed on ".process()"'- );- }- else- this.renderers[a[i]].process();- }-- this.render();-- return this;- };-- /**- * This method calls the "render" method of each renderer.- *- * @return {sigma} Returns the instance itself.- */- sigma.prototype.render = function() {- var i,- l,- a,- prefix = 0;-- // Call each renderer:- a = Object.keys(this.renderers);- for (i = 0, l = a.length; i < l; i++)- if (this.settings('skipErrors'))- try {- this.renderers[a[i]].render();- } catch (e) {- if (this.settings('verbose'))- console.log(- 'Warning: The renderer "' + a[i] + '" crashed on ".render()"'- );- }- else- this.renderers[a[i]].render();-- return this;- };-- /**- * This method calls the "render" method of each renderer that is bound to- * the specified camera. To improve the performances, if this method is- * called too often, the number of effective renderings is limitated to one- * per frame, unless you are using the "force" flag.- *- * @param {sigma.classes.camera} camera The camera to render.- * @param {?boolean} force If true, will render the camera- * directly.- * @return {sigma} Returns the instance itself.- */- sigma.prototype.renderCamera = function(camera, force) {- var i,- l,- a,- self = this;-- if (force) {- a = this.renderersPerCamera[camera.id];- for (i = 0, l = a.length; i < l; i++)- if (this.settings('skipErrors'))- try {- a[i].render();- } catch (e) {- if (this.settings('verbose'))- console.log(- 'Warning: The renderer "' + a[i].id + '" crashed on ".render()"'- );- }- else- a[i].render();- } else {- if (!this.cameraFrames[camera.id]) {- a = this.renderersPerCamera[camera.id];- for (i = 0, l = a.length; i < l; i++)- if (this.settings('skipErrors'))- try {- a[i].render();- } catch (e) {- if (this.settings('verbose'))- console.log(- 'Warning: The renderer "' +- a[i].id +- '" crashed on ".render()"'- );- }- else- a[i].render();-- this.cameraFrames[camera.id] = requestAnimationFrame(function() {- delete self.cameraFrames[camera.id];- });- }- }-- return this;- };-- /**- * This method calls the "kill" method of each module and destroys any- * reference from the instance.- */- sigma.prototype.kill = function() {- var k;-- // Dispatching event- this.dispatchEvent('kill');-- // Kill graph:- this.graph.kill();-- // Kill middlewares:- delete this.middlewares;-- // Kill each renderer:- for (k in this.renderers)- this.killRenderer(this.renderers[k]);-- // Kill each camera:- for (k in this.cameras)- this.killCamera(this.cameras[k]);-- delete this.renderers;- delete this.cameras;-- // Kill everything else:- for (k in this)- if (this.hasOwnProperty(k))- delete this[k];-- delete __instances[this.id];- };----- /**- * Returns a clone of the instances object or a specific running instance.- *- * @param {?string} id Eventually an instance ID.- * @return {object} The related instance or a clone of the instances- * object.- */- sigma.instances = function(id) {- return arguments.length ?- __instances[id] :- sigma.utils.extend({}, __instances);- };---- /**- * The current version of sigma:- */- sigma.version = '1.0.3';----- /**- * EXPORT:- * *******- */- if (typeof this.sigma !== 'undefined')- throw 'An object called sigma is already in the global scope.';-- this.sigma = sigma;--}).call(this);--/**- * conrad.js is a tiny JavaScript jobs scheduler,- *- * Version: 0.1.0- * Sources: http://github.com/jacomyal/conrad.js- * Doc: http://github.com/jacomyal/conrad.js#readme- *- * License:- * --------- * Copyright © 2013 Alexis Jacomy, Sciences-Po médialab- *- * Permission is hereby granted, free of charge, to any person obtaining a copy- * of this software and associated documentation files (the "Software"), to- * deal in the Software without restriction, including without limitation the- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or- * sell copies of the Software, and to permit persons to whom the Software is- * furnished to do so, subject to the following conditions:- *- * The above copyright notice and this permission notice shall be included in- * all copies or substantial portions of the Software.- *- * The Software is provided "as is", without warranty of any kind, express or- * implied, including but not limited to the warranties of merchantability,- * fitness for a particular purpose and noninfringement. In no event shall the- * authors or copyright holders be liable for any claim, damages or other- * liability, whether in an action of contract, tort or otherwise, arising- * from, out of or in connection with the software or the use or other dealings- * in the Software.- */-(function(global) {- 'use strict';-- // Check that conrad.js has not been loaded yet:- if (global.conrad)- throw new Error('conrad already exists');--- /**- * PRIVATE VARIABLES:- * ******************- */-- /**- * A flag indicating whether conrad is running or not.- *- * @type {Number}- */- var _lastFrameTime;-- /**- * A flag indicating whether conrad is running or not.- *- * @type {Boolean}- */- var _isRunning = false;-- /**- * The hash of registered jobs. Each job must at least have a unique ID- * under the key "id" and a function under the key "job". This hash- * contains each running job and each waiting job.- *- * @type {Object}- */- var _jobs = {};-- /**- * The hash of currently running jobs.- *- * @type {Object}- */- var _runningJobs = {};-- /**- * The array of currently running jobs, sorted by priority.- *- * @type {Array}- */- var _sortedByPriorityJobs = [];-- /**- * The array of currently waiting jobs.- *- * @type {Object}- */- var _waitingJobs = {};-- /**- * The array of finished jobs. They are stored in an array, since two jobs- * with the same "id" can happen at two different times.- *- * @type {Array}- */- var _doneJobs = [];-- /**- * A dirty flag to keep conrad from starting: Indeed, when addJob() is called- * with several jobs, conrad must be started only at the end. This flag keeps- * me from duplicating the code that effectively adds a job.- *- * @type {Boolean}- */- var _noStart = false;-- /**- * An hash containing some global settings about how conrad.js should- * behave.- *- * @type {Object}- */- var _parameters = {- frameDuration: 20,- history: true- };-- /**- * This object contains every handlers bound to conrad events. It does not- * requirea any DOM implementation, since the events are all JavaScript.- *- * @type {Object}- */- var _handlers = Object.create(null);--- /**- * PRIVATE FUNCTIONS:- * ******************- */-- /**- * Will execute the handler everytime that the indicated event (or the- * indicated events) will be triggered.- *- * @param {string|array|object} events The name of the event (or the events- * separated by spaces).- * @param {function(Object)} handler The handler to bind.- * @return {Object} Returns conrad.- */- function _bind(events, handler) {- var i,- i_end,- event,- eArray;-- if (!arguments.length)- return;- else if (- arguments.length === 1 &&- Object(arguments[0]) === arguments[0]- )- for (events in arguments[0])- _bind(events, arguments[0][events]);- else if (arguments.length > 1) {- eArray =- Array.isArray(events) ?- events :- events.split(/ /);-- for (i = 0, i_end = eArray.length; i !== i_end; i += 1) {- event = eArray[i];-- if (!_handlers[event])- _handlers[event] = [];-- // Using an object instead of directly the handler will make possible- // later to add flags- _handlers[event].push({- handler: handler- });- }- }- }-- /**- * Removes the handler from a specified event (or specified events).- *- * @param {?string} events The name of the event (or the events- * separated by spaces). If undefined,- * then all handlers are removed.- * @param {?function(Object)} handler The handler to unbind. If undefined,- * each handler bound to the event or the- * events will be removed.- * @return {Object} Returns conrad.- */- function _unbind(events, handler) {- var i,- i_end,- j,- j_end,- a,- event,- eArray = Array.isArray(events) ?- events :- events.split(/ /);-- if (!arguments.length)- _handlers = Object.create(null);- else if (handler) {- for (i = 0, i_end = eArray.length; i !== i_end; i += 1) {- event = eArray[i];- if (_handlers[event]) {- a = [];- for (j = 0, j_end = _handlers[event].length; j !== j_end; j += 1)- if (_handlers[event][j].handler !== handler)- a.push(_handlers[event][j]);-- _handlers[event] = a;- }-- if (_handlers[event] && _handlers[event].length === 0)- delete _handlers[event];- }- } else- for (i = 0, i_end = eArray.length; i !== i_end; i += 1)- delete _handlers[eArray[i]];- }-- /**- * Executes each handler bound to the event.- *- * @param {string} events The name of the event (or the events separated- * by spaces).- * @param {?Object} data The content of the event (optional).- * @return {Object} Returns conrad.- */- function _dispatch(events, data) {- var i,- j,- i_end,- j_end,- event,- eventName,- eArray = Array.isArray(events) ?- events :- events.split(/ /);-- data = data === undefined ? {} : data;-- for (i = 0, i_end = eArray.length; i !== i_end; i += 1) {- eventName = eArray[i];-- if (_handlers[eventName]) {- event = {- type: eventName,- data: data || {}- };-- for (j = 0, j_end = _handlers[eventName].length; j !== j_end; j += 1)- try {- _handlers[eventName][j].handler(event);- } catch (e) {}- }- }- }-- /**- * Executes the most prioritary job once, and deals with filling the stats- * (done, time, averageTime, currentTime, etc...).- *- * @return {?Object} Returns the job object if it has to be killed, null else.- */- function _executeFirstJob() {- var i,- l,- test,- kill,- pushed = false,- time = __dateNow(),- job = _sortedByPriorityJobs.shift();-- // Execute the job and look at the result:- test = job.job();-- // Deal with stats:- time = __dateNow() - time;- job.done++;- job.time += time;- job.currentTime += time;- job.weightTime = job.currentTime / (job.weight || 1);- job.averageTime = job.time / job.done;-- // Check if the job has to be killed:- kill = job.count ? (job.count <= job.done) : !test;-- // Reset priorities:- if (!kill) {- for (i = 0, l = _sortedByPriorityJobs.length; i < l; i++)- if (_sortedByPriorityJobs[i].weightTime > job.weightTime) {- _sortedByPriorityJobs.splice(i, 0, job);- pushed = true;- break;- }-- if (!pushed)- _sortedByPriorityJobs.push(job);- }-- return kill ? job : null;- }-- /**- * Activates a job, by adding it to the _runningJobs object and the- * _sortedByPriorityJobs array. It also initializes its currentTime value.- *- * @param {Object} job The job to activate.- */- function _activateJob(job) {- var l = _sortedByPriorityJobs.length;-- // Add the job to the running jobs:- _runningJobs[job.id] = job;- job.status = 'running';-- // Add the job to the priorities:- if (l) {- job.weightTime = _sortedByPriorityJobs[l - 1].weightTime;- job.currentTime = job.weightTime * (job.weight || 1);- }-- // Initialize the job and dispatch:- job.startTime = __dateNow();- _dispatch('jobStarted', __clone(job));-- _sortedByPriorityJobs.push(job);- }-- /**- * The main loop of conrad.js:- * . It executes job such that they all occupate the same processing time.- * . It stops jobs that do not need to be executed anymore.- * . It triggers callbacks when it is relevant.- * . It starts waiting jobs when they need to be started.- * . It injects frames to keep a constant frapes per second ratio.- * . It stops itself when there are no more jobs to execute.- */- function _loop() {- var k,- o,- l,- job,- time,- deadJob;-- // Deal with the newly added jobs (the _jobs object):- for (k in _jobs) {- job = _jobs[k];-- if (job.after)- _waitingJobs[k] = job;- else- _activateJob(job);-- delete _jobs[k];- }-- // Set the _isRunning flag to false if there are no running job:- _isRunning = !!_sortedByPriorityJobs.length;-- // Deal with the running jobs (the _runningJobs object):- while (- _sortedByPriorityJobs.length &&- __dateNow() - _lastFrameTime < _parameters.frameDuration- ) {- deadJob = _executeFirstJob();-- // Deal with the case where the job has ended:- if (deadJob) {- _killJob(deadJob.id);-- // Check for waiting jobs:- for (k in _waitingJobs)- if (_waitingJobs[k].after === deadJob.id) {- _activateJob(_waitingJobs[k]);- delete _waitingJobs[k];- }- }- }-- // Check if conrad still has jobs to deal with, and kill it if not:- if (_isRunning) {- // Update the _lastFrameTime:- _lastFrameTime = __dateNow();-- _dispatch('enterFrame');- setTimeout(_loop, 0);- } else- _dispatch('stop');- }-- /**- * Adds one or more jobs, and starts the loop if no job was running before. A- * job is at least a unique string "id" and a function, and there are some- * parameters that you can specify for each job to modify the way conrad will- * execute it. If a job is added with the "id" of another job that is waiting- * or still running, an error will be thrown.- *- * When a job is added, it is referenced in the _jobs object, by its id.- * Then, if it has to be executed right now, it will be also referenced in- * the _runningJobs object. If it has to wait, then it will be added into the- * _waitingJobs object, until it can start.- *- * Keep reading this documentation to see how to call this method.- *- * @return {Object} Returns conrad.- *- * Adding one job:- * ***************- * Basically, a job is defined by its string id and a function (the job). It- * is also possible to add some parameters:- *- * > conrad.addJob('myJobId', myJobFunction);- * > conrad.addJob('myJobId', {- * > job: myJobFunction,- * > someParameter: someValue- * > });- * > conrad.addJob({- * > id: 'myJobId',- * > job: myJobFunction,- * > someParameter: someValue- * > });- *- * Adding several jobs:- * ********************- * When adding several jobs at the same time, it is possible to specify- * parameters for each one individually or for all:- *- * > conrad.addJob([- * > {- * > id: 'myJobId1',- * > job: myJobFunction1,- * > someParameter1: someValue1- * > },- * > {- * > id: 'myJobId2',- * > job: myJobFunction2,- * > someParameter2: someValue2- * > }- * > ], {- * > someCommonParameter: someCommonValue- * > });- * > conrad.addJob({- * > myJobId1: {,- * > job: myJobFunction1,- * > someParameter1: someValue1- * > },- * > myJobId2: {,- * > job: myJobFunction2,- * > someParameter2: someValue2- * > }- * > }, {- * > someCommonParameter: someCommonValue- * > });- * > conrad.addJob({- * > myJobId1: myJobFunction1,- * > myJobId2: myJobFunction2- * > }, {- * > someCommonParameter: someCommonValue- * > });- *- * Recognized parameters:- * **********************- * Here is the exhaustive list of every accepted parameters:- *- * {?Function} end A callback to execute when the job is ended. It is- * not executed if the job is killed instead of ended- * "naturally".- * {?Integer} count The number of time the job has to be executed.- * {?Number} weight If specified, the job will be executed as it was- * added "weight" times.- * {?String} after The id of another job (eventually not added yet).- * If specified, this job will start only when the- * specified "after" job is ended.- */- function _addJob(v1, v2) {- var i,- l,- o;-- // Array of jobs:- if (Array.isArray(v1)) {- // Keep conrad to start until the last job is added:- _noStart = true;-- for (i = 0, l = v1.length; i < l; i++)- _addJob(v1[i].id, __extend(v1[i], v2));-- _noStart = false;- if (!_isRunning) {- // Update the _lastFrameTime:- _lastFrameTime = __dateNow();-- _dispatch('start');- _loop();- }- } else if (typeof v1 === 'object') {- // One job (object):- if (typeof v1.id === 'string')- _addJob(v1.id, v1);-- // Hash of jobs:- else {- // Keep conrad to start until the last job is added:- _noStart = true;-- for (i in v1)- if (typeof v1[i] === 'function')- _addJob(i, __extend({- job: v1[i]- }, v2));- else- _addJob(i, __extend(v1[i], v2));-- _noStart = false;- if (!_isRunning) {- // Update the _lastFrameTime:- _lastFrameTime = __dateNow();-- _dispatch('start');- _loop();- }- }-- // One job (string, *):- } else if (typeof v1 === 'string') {- if (_hasJob(v1))- throw new Error(- '[conrad.addJob] Job with id "' + v1 + '" already exists.'- );-- // One job (string, function):- if (typeof v2 === 'function') {- o = {- id: v1,- done: 0,- time: 0,- status: 'waiting',- currentTime: 0,- averageTime: 0,- weightTime: 0,- job: v2- };-- // One job (string, object):- } else if (typeof v2 === 'object') {- o = __extend(- {- id: v1,- done: 0,- time: 0,- status: 'waiting',- currentTime: 0,- averageTime: 0,- weightTime: 0- },- v2- );-- // If none of those cases, throw an error:- } else- throw new Error('[conrad.addJob] Wrong arguments.');-- // Effectively add the job:- _jobs[v1] = o;- _dispatch('jobAdded', __clone(o));-- // Check if the loop has to be started:- if (!_isRunning && !_noStart) {- // Update the _lastFrameTime:- _lastFrameTime = __dateNow();-- _dispatch('start');- _loop();- }-- // If none of those cases, throw an error:- } else- throw new Error('[conrad.addJob] Wrong arguments.');-- return this;- }-- /**- * Kills one or more jobs, indicated by their ids. It is only possible to- * kill running jobs or waiting jobs. If you try to kill a job that does not- * exists or that is already killed, a warning will be thrown.- *- * @param {Array|String} v1 A string job id or an array of job ids.- * @return {Object} Returns conrad.- */- function _killJob(v1) {- var i,- l,- k,- a,- job,- found = false;-- // Array of job ids:- if (Array.isArray(v1))- for (i = 0, l = v1.length; i < l; i++)- _killJob(v1[i]);-- // One job's id:- else if (typeof v1 === 'string') {- a = [_runningJobs, _waitingJobs, _jobs];-- // Remove the job from the hashes:- for (i = 0, l = a.length; i < l; i++)- if (v1 in a[i]) {- job = a[i][v1];-- if (_parameters.history) {- job.status = 'done';- _doneJobs.push(job);- }-- _dispatch('jobEnded', __clone(job));- delete a[i][v1];-- if (typeof job.end === 'function')- job.end();-- found = true;- }-- // Remove the priorities array:- a = _sortedByPriorityJobs;- for (i = 0, l = a.length; i < l; i++)- if (a[i].id === v1) {- a.splice(i, 1);- break;- }-- if (!found)- throw new Error('[conrad.killJob] Job "' + v1 + '" not found.');-- // If none of those cases, throw an error:- } else- throw new Error('[conrad.killJob] Wrong arguments.');-- return this;- }-- /**- * Kills every running, waiting, and just added jobs.- *- * @return {Object} Returns conrad.- */- function _killAll() {- var k,- jobs = __extend(_jobs, _runningJobs, _waitingJobs);-- // Take every jobs and push them into the _doneJobs object:- if (_parameters.history)- for (k in jobs) {- jobs[k].status = 'done';- _doneJobs.push(jobs[k]);-- if (typeof jobs[k].end === 'function')- jobs[k].end();- }-- // Reinitialize the different jobs lists:- _jobs = {};- _waitingJobs = {};- _runningJobs = {};- _sortedByPriorityJobs = [];-- // In case some jobs are added right after the kill:- _isRunning = false;-- return this;- }-- /**- * Returns true if a job with the specified id is currently running or- * waiting, and false else.- *- * @param {String} id The id of the job.- * @return {?Object} Returns the job object if it exists.- */- function _hasJob(id) {- var job = _jobs[id] || _runningJobs[id] || _waitingJobs[id];- return job ? __extend(job) : null;- }-- /**- * This method will set the setting specified by "v1" to the value specified- * by "v2" if both are given, and else return the current value of the- * settings "v1".- *- * @param {String} v1 The name of the property.- * @param {?*} v2 Eventually, a value to set to the specified- * property.- * @return {Object|*} Returns the specified settings value if "v2" is not- * given, and conrad else.- */- function _settings(v1, v2) {- var o;-- if (typeof a1 === 'string' && arguments.length === 1)- return _parameters[a1];- else {- o = (typeof a1 === 'object' && arguments.length === 1) ?- a1 || {} :- {};- if (typeof a1 === 'string')- o[a1] = a2;-- for (var k in o)- if (o[k] !== undefined)- _parameters[k] = o[k];- else- delete _parameters[k];-- return this;- }- }-- /**- * Returns true if conrad is currently running, and false else.- *- * @return {Boolean} Returns _isRunning.- */- function _getIsRunning() {- return _isRunning;- }-- /**- * Unreference every jobs that are stored in the _doneJobs object. It will- * not be possible anymore to get stats about these jobs, but it will release- * the memory.- *- * @return {Object} Returns conrad.- */- function _clearHistory() {- _doneJobs = [];- return this;- }-- /**- * Returns a snapshot of every data about jobs that wait to be started, are- * currently running or are done.- *- * It is possible to get only running, waiting or done jobs by giving- * "running", "waiting" or "done" as fist argument.- *- * It is also possible to get every job with a specified id by giving it as- * first argument. Also, using a RegExp instead of an id will return every- * jobs whose ids match the RegExp. And these two last use cases work as well- * by giving before "running", "waiting" or "done".- *- * @return {Array} The array of the matching jobs.- *- * Some call examples:- * *******************- * > conrad.getStats('running')- * > conrad.getStats('waiting')- * > conrad.getStats('done')- * > conrad.getStats('myJob')- * > conrad.getStats(/test/)- * > conrad.getStats('running', 'myRunningJob')- * > conrad.getStats('running', /test/)- */- function _getStats(v1, v2) {- var a,- k,- i,- l,- stats,- pattern,- isPatternString;-- if (!arguments.length) {- stats = [];-- for (k in _jobs)- stats.push(_jobs[k]);-- for (k in _waitingJobs)- stats.push(_waitingJobs[k]);-- for (k in _runningJobs)- stats.push(_runningJobs[k]);-- stats = stats.concat(_doneJobs);- }-- if (typeof v1 === 'string')- switch (v1) {- case 'waiting':- stats = __objectValues(_waitingJobs);- break;- case 'running':- stats = __objectValues(_runningJobs);- break;- case 'done':- stats = _doneJobs;- break;- default:- pattern = v1;- }-- if (v1 instanceof RegExp)- pattern = v1;-- if (!pattern && (typeof v2 === 'string' || v2 instanceof RegExp))- pattern = v2;-- // Filter jobs if a pattern is given:- if (pattern) {- isPatternString = typeof pattern === 'string';-- if (stats instanceof Array) {- a = stats;- } else if (typeof stats === 'object') {- a = [];-- for (k in stats)- a = a.concat(stats[k]);- } else {- a = [];-- for (k in _jobs)- a.push(_jobs[k]);-- for (k in _waitingJobs)- a.push(_waitingJobs[k]);-- for (k in _runningJobs)- a.push(_runningJobs[k]);-- a = a.concat(_doneJobs);- }-- stats = [];- for (i = 0, l = a.length; i < l; i++)- if (isPatternString ? a[i].id === pattern : a[i].id.match(pattern))- stats.push(a[i]);- }-- return __clone(stats);- }--- /**- * TOOLS FUNCTIONS:- * ****************- */-- /**- * This function takes any number of objects as arguments, copies from each- * of these objects each pair key/value into a new object, and finally- * returns this object.- *- * The arguments are parsed from the last one to the first one, such that- * when two objects have keys in common, the "earliest" object wins.- *- * Example:- * ********- * > var o1 = {- * > a: 1,- * > b: 2,- * > c: '3'- * > },- * > o2 = {- * > c: '4',- * > d: [ 5 ]- * > };- * > __extend(o1, o2);- * > // Returns: {- * > // a: 1,- * > // b: 2,- * > // c: '3',- * > // d: [ 5 ]- * > // };- *- * @param {Object+} Any number of objects.- * @return {Object} The merged object.- */- function __extend() {- var i,- k,- res = {},- l = arguments.length;-- for (i = l - 1; i >= 0; i--)- for (k in arguments[i])- res[k] = arguments[i][k];-- return res;- }-- /**- * This function simply clones an object. This object must contain only- * objects, arrays and immutable values. Since it is not public, it does not- * deal with cyclic references, DOM elements and instantiated objects - so- * use it carefully.- *- * @param {Object} The object to clone.- * @return {Object} The clone.- */- function __clone(item) {- var result, i, k, l;-- if (!item)- return item;-- if (Array.isArray(item)) {- result = [];- for (i = 0, l = item.length; i < l; i++)- result.push(__clone(item[i]));- } else if (typeof item === 'object') {- result = {};- for (i in item)- result[i] = __clone(item[i]);- } else- result = item;-- return result;- }-- /**- * Returns an array containing the values of an object.- *- * @param {Object} The object.- * @return {Array} The array of values.- */- function __objectValues(o) {- var k,- a = [];-- for (k in o)- a.push(o[k]);-- return a;- }-- /**- * A short "Date.now()" polyfill.- *- * @return {Number} The current time (in ms).- */- function __dateNow() {- return Date.now ? Date.now() : new Date().getTime();- }-- /**- * Polyfill for the Array.isArray function:- */- if (!Array.isArray)- Array.isArray = function(v) {- return Object.prototype.toString.call(v) === '[object Array]';- };--- /**- * EXPORT PUBLIC API:- * ******************- */- var conrad = {- hasJob: _hasJob,- addJob: _addJob,- killJob: _killJob,- killAll: _killAll,- settings: _settings,- getStats: _getStats,- isRunning: _getIsRunning,- clearHistory: _clearHistory,-- // Events management:- bind: _bind,- unbind: _unbind,-- // Version:- version: '0.1.0'- };-- if (typeof exports !== 'undefined') {- if (typeof module !== 'undefined' && module.exports)- exports = module.exports = conrad;- exports.conrad = conrad;- }- global.conrad = conrad;-})(this);--// Hardcoded export for the node.js version:-var sigma = this.sigma,- conrad = this.conrad;--sigma.conrad = conrad;--// Dirty polyfills to permit sigma usage in node-if (HTMLElement === undefined)- var HTMLElement = function() {};--if (window === undefined)- var window = {- addEventListener: function() {}- };--if (typeof exports !== 'undefined') {- if (typeof module !== 'undefined' && module.exports)- exports = module.exports = sigma;- exports.sigma = sigma;-}--;(function(undefined) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- var _root = this;-- // Initialize packages:- sigma.utils = sigma.utils || {};-- /**- * MISC UTILS:- */- /**- * This function takes any number of objects as arguments, copies from each- * of these objects each pair key/value into a new object, and finally- * returns this object.- *- * The arguments are parsed from the last one to the first one, such that- * when several objects have keys in common, the "earliest" object wins.- *- * Example:- * ********- * > var o1 = {- * > a: 1,- * > b: 2,- * > c: '3'- * > },- * > o2 = {- * > c: '4',- * > d: [ 5 ]- * > };- * > sigma.utils.extend(o1, o2);- * > // Returns: {- * > // a: 1,- * > // b: 2,- * > // c: '3',- * > // d: [ 5 ]- * > // };- *- * @param {object+} Any number of objects.- * @return {object} The merged object.- */- sigma.utils.extend = function() {- var i,- k,- res = {},- l = arguments.length;-- for (i = l - 1; i >= 0; i--)- for (k in arguments[i])- res[k] = arguments[i][k];-- return res;- };-- /**- * A short "Date.now()" polyfill.- *- * @return {Number} The current time (in ms).- */- sigma.utils.dateNow = function() {- return Date.now ? Date.now() : new Date().getTime();- };-- /**- * Takes a package name as parameter and checks at each lebel if it exists,- * and if it does not, creates it.- *- * Example:- * ********- * > sigma.utils.pkg('a.b.c');- * > a.b.c;- * > // Object {};- * >- * > sigma.utils.pkg('a.b.d');- * > a.b;- * > // Object { c: {}, d: {} };- *- * @param {string} pkgName The name of the package to create/find.- * @return {object} The related package.- */- sigma.utils.pkg = function(pkgName) {- return (pkgName || '').split('.').reduce(function(context, objName) {- return (objName in context) ?- context[objName] :- (context[objName] = {});- }, _root);- };-- /**- * Returns a unique incremental number ID.- *- * Example:- * ********- * > sigma.utils.id();- * > // 1;- * >- * > sigma.utils.id();- * > // 2;- * >- * > sigma.utils.id();- * > // 3;- *- * @param {string} pkgName The name of the package to create/find.- * @return {object} The related package.- */- sigma.utils.id = (function() {- var i = 0;- return function() {- return ++i;- };- })();-- /**- * This function takes an hexa color (for instance "#ffcc00" or "#fc0") or a- * rgb / rgba color (like "rgb(255,255,12)" or "rgba(255,255,12,1)") and- * returns an integer equal to "r * 255 * 255 + g * 255 + b", to gain some- * memory in the data given to WebGL shaders.- *- * @param {string} val The hexa or rgba color.- * @return {number} The number value.- */- sigma.utils.floatColor = function(val) {- var result = [0, 0, 0];-- if (val.match(/^#/)) {- val = (val || '').replace(/^#/, '');- result = (val.length === 3) ?- [- parseInt(val.charAt(0) + val.charAt(0), 16),- parseInt(val.charAt(1) + val.charAt(1), 16),- parseInt(val.charAt(2) + val.charAt(2), 16)- ] :- [- parseInt(val.charAt(0) + val.charAt(1), 16),- parseInt(val.charAt(2) + val.charAt(3), 16),- parseInt(val.charAt(4) + val.charAt(5), 16)- ];- } else if (val.match(/^ *rgba? *\(/)) {- val = val.match(- /^ *rgba? *\( *([0-9]*) *, *([0-9]*) *, *([0-9]*) *(,.*)?\) *$/- );- result = [- +val[1],- +val[2],- +val[3]- ];- }-- return (- result[0] * 256 * 256 +- result[1] * 256 +- result[2]- );- };-- /**- * Perform a zoom into a camera, with or without animation, to the- * coordinates indicated using a specified ratio.- *- * Recognized parameters:- * **********************- * Here is the exhaustive list of every accepted parameters in the animation- * object:- *- * {?number} duration An amount of time that means the duration of the- * animation. If this parameter doesn't exist the- * zoom will be performed without animation.- * {?function} onComplete A function to perform it after the animation. It- * will be performed even if there is no duration.- *- * @param {camera} The camera where perform the zoom.- * @param {x} The X coordiantion where the zoom goes.- * @param {y} The Y coordiantion where the zoom goes.- * @param {ratio} The ratio to apply it to the current camera ratio.- * @param {?animation} A dictionary with options for a possible animation.- */- sigma.utils.zoomTo = function(camera, x, y, ratio, animation) {- var settings = camera.settings,- count,- newRatio,- animationSettings,- coordinates;-- // Create the newRatio dealing with min / max:- newRatio = Math.max(- settings('zoomMin'),- Math.min(- settings('zoomMax'),- camera.ratio * ratio- )- );-- // Check that the new ratio is different from the initial one:- if (newRatio !== camera.ratio) {- // Create the coordinates variable:- ratio = newRatio / camera.ratio;- coordinates = {- x: x * (1 - ratio) + camera.x,- y: y * (1 - ratio) + camera.y,- ratio: newRatio- };-- if (animation && animation.duration) {- // Complete the animation setings:- count = sigma.misc.animation.killAll(camera);- animation = sigma.utils.extend(- animation,- {- easing: count ? 'quadraticOut' : 'quadraticInOut'- }- );-- sigma.misc.animation.camera(camera, coordinates, animation);- } else {- camera.goTo(coordinates);- if (animation && animation.onComplete)- animation.onComplete();- }- }- };-- /**- * Return the control point coordinates for a quadratic bezier curve.- *- * @param {number} x1 The X coordinate of the start point.- * @param {number} y1 The Y coordinate of the start point.- * @param {number} x2 The X coordinate of the end point.- * @param {number} y2 The Y coordinate of the end point.- * @return {x,y} The control point coordinates.- */- sigma.utils.getQuadraticControlPoint = function(x1, y1, x2, y2) {- return {- x: (x1 + x2) / 2 + (y2 - y1) / 4,- y: (y1 + y2) / 2 + (x1 - x2) / 4- };- };-- /**- * Compute the coordinates of the point positioned- * at length t in the quadratic bezier curve.- *- * @param {number} t In [0,1] the step percentage to reach- * the point in the curve from the context point.- * @param {number} x1 The X coordinate of the context point.- * @param {number} y1 The Y coordinate of the context point.- * @param {number} x2 The X coordinate of the ending point.- * @param {number} y2 The Y coordinate of the ending point.- * @param {number} xi The X coordinate of the control point.- * @param {number} yi The Y coordinate of the control point.- * @return {object} {x,y}.- */- sigma.utils.getPointOnQuadraticCurve = function(t, x1, y1, x2, y2, xi, yi) {- // http://stackoverflow.com/a/5634528- return {- x: Math.pow(1 - t, 2) * x1 + 2 * (1 - t) * t * xi + Math.pow(t, 2) * x2,- y: Math.pow(1 - t, 2) * y1 + 2 * (1 - t) * t * yi + Math.pow(t, 2) * y2- };- };-- /**- * Compute the coordinates of the point positioned- * at length t in the cubic bezier curve.- *- * @param {number} t In [0,1] the step percentage to reach- * the point in the curve from the context point.- * @param {number} x1 The X coordinate of the context point.- * @param {number} y1 The Y coordinate of the context point.- * @param {number} x2 The X coordinate of the end point.- * @param {number} y2 The Y coordinate of the end point.- * @param {number} cx The X coordinate of the first control point.- * @param {number} cy The Y coordinate of the first control point.- * @param {number} dx The X coordinate of the second control point.- * @param {number} dy The Y coordinate of the second control point.- * @return {object} {x,y} The point at t.- */- sigma.utils.getPointOnBezierCurve =- function(t, x1, y1, x2, y2, cx, cy, dx, dy) {- // http://stackoverflow.com/a/15397596- // Blending functions:- var B0_t = Math.pow(1 - t, 3),- B1_t = 3 * t * Math.pow(1 - t, 2),- B2_t = 3 * Math.pow(t, 2) * (1 - t),- B3_t = Math.pow(t, 3);-- return {- x: (B0_t * x1) + (B1_t * cx) + (B2_t * dx) + (B3_t * x2),- y: (B0_t * y1) + (B1_t * cy) + (B2_t * dy) + (B3_t * y2)- };- };-- /**- * Return the coordinates of the two control points for a self loop (i.e.- * where the start point is also the end point) computed as a cubic bezier- * curve.- *- * @param {number} x The X coordinate of the node.- * @param {number} y The Y coordinate of the node.- * @param {number} size The node size.- * @return {x1,y1,x2,y2} The coordinates of the two control points.- */- sigma.utils.getSelfLoopControlPoints = function(x , y, size) {- return {- x1: x - size * 7,- y1: y,- x2: x,- y2: y + size * 7- };- };-- /**- * Return the euclidian distance between two points of a plane- * with an orthonormal basis.- *- * @param {number} x1 The X coordinate of the first point.- * @param {number} y1 The Y coordinate of the first point.- * @param {number} x2 The X coordinate of the second point.- * @param {number} y2 The Y coordinate of the second point.- * @return {number} The euclidian distance.- */- sigma.utils.getDistance = function(x0, y0, x1, y1) {- return Math.sqrt(Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2));- };-- /**- * Return the coordinates of the intersection points of two circles.- *- * @param {number} x0 The X coordinate of center location of the first- * circle.- * @param {number} y0 The Y coordinate of center location of the first- * circle.- * @param {number} r0 The radius of the first circle.- * @param {number} x1 The X coordinate of center location of the second- * circle.- * @param {number} y1 The Y coordinate of center location of the second- * circle.- * @param {number} r1 The radius of the second circle.- * @return {xi,yi} The coordinates of the intersection points.- */- sigma.utils.getCircleIntersection = function(x0, y0, r0, x1, y1, r1) {- // http://stackoverflow.com/a/12219802- var a, dx, dy, d, h, rx, ry, x2, y2;-- // dx and dy are the vertical and horizontal distances between the circle- // centers:- dx = x1 - x0;- dy = y1 - y0;-- // Determine the straight-line distance between the centers:- d = Math.sqrt((dy * dy) + (dx * dx));-- // Check for solvability:- if (d > (r0 + r1)) {- // No solution. circles do not intersect.- return false;- }- if (d < Math.abs(r0 - r1)) {- // No solution. one circle is contained in the other.- return false;- }-- //'point 2' is the point where the line through the circle intersection- // points crosses the line between the circle centers.-- // Determine the distance from point 0 to point 2:- a = ((r0 * r0) - (r1 * r1) + (d * d)) / (2.0 * d);-- // Determine the coordinates of point 2:- x2 = x0 + (dx * a / d);- y2 = y0 + (dy * a / d);-- // Determine the distance from point 2 to either of the intersection- // points:- h = Math.sqrt((r0 * r0) - (a * a));-- // Determine the offsets of the intersection points from point 2:- rx = -dy * (h / d);- ry = dx * (h / d);-- // Determine the absolute intersection points:- var xi = x2 + rx;- var xi_prime = x2 - rx;- var yi = y2 + ry;- var yi_prime = y2 - ry;-- return {xi: xi, xi_prime: xi_prime, yi: yi, yi_prime: yi_prime};- };-- /**- * Check if a point is on a line segment.- *- * @param {number} x The X coordinate of the point to check.- * @param {number} y The Y coordinate of the point to check.- * @param {number} x1 The X coordinate of the line start point.- * @param {number} y1 The Y coordinate of the line start point.- * @param {number} x2 The X coordinate of the line end point.- * @param {number} y2 The Y coordinate of the line end point.- * @param {number} epsilon The precision (consider the line thickness).- * @return {boolean} True if point is "close to" the line- * segment, false otherwise.- */- sigma.utils.isPointOnSegment = function(x, y, x1, y1, x2, y2, epsilon) {- // http://stackoverflow.com/a/328122- var crossProduct = Math.abs((y - y1) * (x2 - x1) - (x - x1) * (y2 - y1)),- d = sigma.utils.getDistance(x1, y1, x2, y2),- nCrossProduct = crossProduct / d; // normalized cross product-- return (nCrossProduct < epsilon &&- Math.min(x1, x2) <= x && x <= Math.max(x1, x2) &&- Math.min(y1, y2) <= y && y <= Math.max(y1, y2));- };-- /**- * Check if a point is on a quadratic bezier curve segment with a thickness.- *- * @param {number} x The X coordinate of the point to check.- * @param {number} y The Y coordinate of the point to check.- * @param {number} x1 The X coordinate of the curve start point.- * @param {number} y1 The Y coordinate of the curve start point.- * @param {number} x2 The X coordinate of the curve end point.- * @param {number} y2 The Y coordinate of the curve end point.- * @param {number} cpx The X coordinate of the curve control point.- * @param {number} cpy The Y coordinate of the curve control point.- * @param {number} epsilon The precision (consider the line thickness).- * @return {boolean} True if (x,y) is on the curve segment,- * false otherwise.- */- sigma.utils.isPointOnQuadraticCurve =- function(x, y, x1, y1, x2, y2, cpx, cpy, epsilon) {- // Fails if the point is too far from the extremities of the segment,- // preventing for more costly computation:- var dP1P2 = sigma.utils.getDistance(x1, y1, x2, y2);- if (Math.abs(x - x1) > dP1P2 || Math.abs(y - y1) > dP1P2) {- return false;- }-- var dP1 = sigma.utils.getDistance(x, y, x1, y1),- dP2 = sigma.utils.getDistance(x, y, x2, y2),- t = 0.5,- r = (dP1 < dP2) ? -0.01 : 0.01,- rThreshold = 0.001,- i = 100,- pt = sigma.utils.getPointOnQuadraticCurve(t, x1, y1, x2, y2, cpx, cpy),- dt = sigma.utils.getDistance(x, y, pt.x, pt.y),- old_dt;-- // This algorithm minimizes the distance from the point to the curve. It- // find the optimal t value where t=0 is the start point and t=1 is the end- // point of the curve, starting from t=0.5.- // It terminates because it runs a maximum of i interations.- while (i-- > 0 &&- t >= 0 && t <= 1 &&- (dt > epsilon) &&- (r > rThreshold || r < -rThreshold)) {- old_dt = dt;- pt = sigma.utils.getPointOnQuadraticCurve(t, x1, y1, x2, y2, cpx, cpy);- dt = sigma.utils.getDistance(x, y, pt.x, pt.y);-- if (dt > old_dt) {- // not the right direction:- // halfstep in the opposite direction- r = -r / 2;- t += r;- }- else if (t + r < 0 || t + r > 1) {- // oops, we've gone too far:- // revert with a halfstep- r = r / 2;- dt = old_dt;- }- else {- // progress:- t += r;- }- }-- return dt < epsilon;- };--- /**- * Check if a point is on a cubic bezier curve segment with a thickness.- *- * @param {number} x The X coordinate of the point to check.- * @param {number} y The Y coordinate of the point to check.- * @param {number} x1 The X coordinate of the curve start point.- * @param {number} y1 The Y coordinate of the curve start point.- * @param {number} x2 The X coordinate of the curve end point.- * @param {number} y2 The Y coordinate of the curve end point.- * @param {number} cpx1 The X coordinate of the 1st curve control point.- * @param {number} cpy1 The Y coordinate of the 1st curve control point.- * @param {number} cpx2 The X coordinate of the 2nd curve control point.- * @param {number} cpy2 The Y coordinate of the 2nd curve control point.- * @param {number} epsilon The precision (consider the line thickness).- * @return {boolean} True if (x,y) is on the curve segment,- * false otherwise.- */- sigma.utils.isPointOnBezierCurve =- function(x, y, x1, y1, x2, y2, cpx1, cpy1, cpx2, cpy2, epsilon) {- // Fails if the point is too far from the extremities of the segment,- // preventing for more costly computation:- var dP1CP1 = sigma.utils.getDistance(x1, y1, cpx1, cpy1);- if (Math.abs(x - x1) > dP1CP1 || Math.abs(y - y1) > dP1CP1) {- return false;- }-- var dP1 = sigma.utils.getDistance(x, y, x1, y1),- dP2 = sigma.utils.getDistance(x, y, x2, y2),- t = 0.5,- r = (dP1 < dP2) ? -0.01 : 0.01,- rThreshold = 0.001,- i = 100,- pt = sigma.utils.getPointOnBezierCurve(- t, x1, y1, x2, y2, cpx1, cpy1, cpx2, cpy2),- dt = sigma.utils.getDistance(x, y, pt.x, pt.y),- old_dt;-- // This algorithm minimizes the distance from the point to the curve. It- // find the optimal t value where t=0 is the start point and t=1 is the end- // point of the curve, starting from t=0.5.- // It terminates because it runs a maximum of i interations.- while (i-- > 0 &&- t >= 0 && t <= 1 &&- (dt > epsilon) &&- (r > rThreshold || r < -rThreshold)) {- old_dt = dt;- pt = sigma.utils.getPointOnBezierCurve(- t, x1, y1, x2, y2, cpx1, cpy1, cpx2, cpy2);- dt = sigma.utils.getDistance(x, y, pt.x, pt.y);-- if (dt > old_dt) {- // not the right direction:- // halfstep in the opposite direction- r = -r / 2;- t += r;- }- else if (t + r < 0 || t + r > 1) {- // oops, we've gone too far:- // revert with a halfstep- r = r / 2;- dt = old_dt;- }- else {- // progress:- t += r;- }- }-- return dt < epsilon;- };--- /**- * ************- * EVENTS UTILS:- * ************- */- /**- * Here are some useful functions to unify extraction of the information we- * need with mouse events and touch events, from different browsers:- */-- /**- * Extract the local X position from a mouse or touch event.- *- * @param {event} e A mouse or touch event.- * @return {number} The local X value of the mouse.- */- sigma.utils.getX = function(e) {- return (- (e.offsetX !== undefined && e.offsetX) ||- (e.layerX !== undefined && e.layerX) ||- (e.clientX !== undefined && e.clientX)- );- };-- /**- * Extract the local Y position from a mouse or touch event.- *- * @param {event} e A mouse or touch event.- * @return {number} The local Y value of the mouse.- */- sigma.utils.getY = function(e) {- return (- (e.offsetY !== undefined && e.offsetY) ||- (e.layerY !== undefined && e.layerY) ||- (e.clientY !== undefined && e.clientY)- );- };-- /**- * Extract the width from a mouse or touch event.- *- * @param {event} e A mouse or touch event.- * @return {number} The width of the event's target.- */- sigma.utils.getWidth = function(e) {- var w = (!e.target.ownerSVGElement) ?- e.target.width :- e.target.ownerSVGElement.width;-- return (- (typeof w === 'number' && w) ||- (w !== undefined && w.baseVal !== undefined && w.baseVal.value)- );- };-- /**- * Extract the height from a mouse or touch event.- *- * @param {event} e A mouse or touch event.- * @return {number} The height of the event's target.- */- sigma.utils.getHeight = function(e) {- var h = (!e.target.ownerSVGElement) ?- e.target.height :- e.target.ownerSVGElement.height;-- return (- (typeof h === 'number' && h) ||- (h !== undefined && h.baseVal !== undefined && h.baseVal.value)- );- };-- /**- * Extract the wheel delta from a mouse or touch event.- *- * @param {event} e A mouse or touch event.- * @return {number} The wheel delta of the mouse.- */- sigma.utils.getDelta = function(e) {- return (- (e.wheelDelta !== undefined && e.wheelDelta) ||- (e.detail !== undefined && -e.detail)- );- };-- /**- * Returns the offset of a DOM element.- *- * @param {DOMElement} dom The element to retrieve the position.- * @return {object} The offset of the DOM element (top, left).- */- sigma.utils.getOffset = function(dom) {- var left = 0,- top = 0;-- while (dom) {- top = top + parseInt(dom.offsetTop);- left = left + parseInt(dom.offsetLeft);- dom = dom.offsetParent;- }-- return {- top: top,- left: left- };- };-- /**- * Simulates a "double click" event.- *- * @param {HTMLElement} target The event target.- * @param {string} type The event type.- * @param {function} callback The callback to execute.- */- sigma.utils.doubleClick = function(target, type, callback) {- var clicks = 0,- self = this,- handlers;-- target._doubleClickHandler = target._doubleClickHandler || {};- target._doubleClickHandler[type] = target._doubleClickHandler[type] || [];- handlers = target._doubleClickHandler[type];-- handlers.push(function(e) {- clicks++;-- if (clicks === 2) {- clicks = 0;- return callback(e);- } else if (clicks === 1) {- setTimeout(function() {- clicks = 0;- }, sigma.settings.doubleClickTimeout);- }- });-- target.addEventListener(type, handlers[handlers.length - 1], false);- };-- /**- * Unbind simulated "double click" events.- *- * @param {HTMLElement} target The event target.- * @param {string} type The event type.- */- sigma.utils.unbindDoubleClick = function(target, type) {- var handler,- handlers = (target._doubleClickHandler || {})[type] || [];-- while ((handler = handlers.pop())) {- target.removeEventListener(type, handler);- }-- delete (target._doubleClickHandler || {})[type];- };----- /**- * Here are just some of the most basic easing functions, used for the- * animated camera "goTo" calls.- *- * If you need some more easings functions, don't hesitate to add them to- * sigma.utils.easings. But I will not add some more here or merge PRs- * containing, because I do not want sigma sources full of overkill and never- * used stuff...- */- sigma.utils.easings = sigma.utils.easings || {};- sigma.utils.easings.linearNone = function(k) {- return k;- };- sigma.utils.easings.quadraticIn = function(k) {- return k * k;- };- sigma.utils.easings.quadraticOut = function(k) {- return k * (2 - k);- };- sigma.utils.easings.quadraticInOut = function(k) {- if ((k *= 2) < 1)- return 0.5 * k * k;- return - 0.5 * (--k * (k - 2) - 1);- };- sigma.utils.easings.cubicIn = function(k) {- return k * k * k;- };- sigma.utils.easings.cubicOut = function(k) {- return --k * k * k + 1;- };- sigma.utils.easings.cubicInOut = function(k) {- if ((k *= 2) < 1)- return 0.5 * k * k * k;- return 0.5 * ((k -= 2) * k * k + 2);- };----- /**- * ************- * WEBGL UTILS:- * ************- */- /**- * Loads a WebGL shader and returns it.- *- * @param {WebGLContext} gl The WebGLContext to use.- * @param {string} shaderSource The shader source.- * @param {number} shaderType The type of shader.- * @param {function(string): void} error Callback for errors.- * @return {WebGLShader} The created shader.- */- sigma.utils.loadShader = function(gl, shaderSource, shaderType, error) {- var compiled,- shader = gl.createShader(shaderType);-- // Load the shader source- gl.shaderSource(shader, shaderSource);-- // Compile the shader- gl.compileShader(shader);-- // Check the compile status- compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);-- // If something went wrong:- if (!compiled) {- if (error) {- error(- 'Error compiling shader "' + shader + '":' +- gl.getShaderInfoLog(shader)- );- }-- gl.deleteShader(shader);- return null;- }-- return shader;- };-- /**- * Creates a program, attaches shaders, binds attrib locations, links the- * program and calls useProgram.- *- * @param {Array.<WebGLShader>} shaders The shaders to attach.- * @param {Array.<string>} attribs The attribs names.- * @param {Array.<number>} locations The locations for the attribs.- * @param {function(string): void} error Callback for errors.- * @return {WebGLProgram} The created program.- */- sigma.utils.loadProgram = function(gl, shaders, attribs, loc, error) {- var i,- linked,- program = gl.createProgram();-- for (i = 0; i < shaders.length; ++i)- gl.attachShader(program, shaders[i]);-- if (attribs)- for (i = 0; i < attribs.length; ++i)- gl.bindAttribLocation(- program,- locations ? locations[i] : i,- opt_attribs[i]- );-- gl.linkProgram(program);-- // Check the link status- linked = gl.getProgramParameter(program, gl.LINK_STATUS);- if (!linked) {- if (error)- error('Error in program linking: ' + gl.getProgramInfoLog(program));-- gl.deleteProgram(program);- return null;- }-- return program;- };----- /**- * *********- * MATRICES:- * *********- * The following utils are just here to help generating the transformation- * matrices for the WebGL renderers.- */- sigma.utils.pkg('sigma.utils.matrices');-- /**- * The returns a 3x3 translation matrix.- *- * @param {number} dx The X translation.- * @param {number} dy The Y translation.- * @return {array} Returns the matrix.- */- sigma.utils.matrices.translation = function(dx, dy) {- return [- 1, 0, 0,- 0, 1, 0,- dx, dy, 1- ];- };-- /**- * The returns a 3x3 or 2x2 rotation matrix.- *- * @param {number} angle The rotation angle.- * @param {boolean} m2 If true, the function will return a 2x2 matrix.- * @return {array} Returns the matrix.- */- sigma.utils.matrices.rotation = function(angle, m2) {- var cos = Math.cos(angle),- sin = Math.sin(angle);-- return m2 ? [- cos, -sin,- sin, cos- ] : [- cos, -sin, 0,- sin, cos, 0,- 0, 0, 1- ];- };-- /**- * The returns a 3x3 or 2x2 homothetic transformation matrix.- *- * @param {number} ratio The scaling ratio.- * @param {boolean} m2 If true, the function will return a 2x2 matrix.- * @return {array} Returns the matrix.- */- sigma.utils.matrices.scale = function(ratio, m2) {- return m2 ? [- ratio, 0,- 0, ratio- ] : [- ratio, 0, 0,- 0, ratio, 0,- 0, 0, 1- ];- };-- /**- * The returns a 3x3 or 2x2 homothetic transformation matrix.- *- * @param {array} a The first matrix.- * @param {array} b The second matrix.- * @param {boolean} m2 If true, the function will assume both matrices are- * 2x2.- * @return {array} Returns the matrix.- */- sigma.utils.matrices.multiply = function(a, b, m2) {- var l = m2 ? 2 : 3,- a00 = a[0 * l + 0],- a01 = a[0 * l + 1],- a02 = a[0 * l + 2],- a10 = a[1 * l + 0],- a11 = a[1 * l + 1],- a12 = a[1 * l + 2],- a20 = a[2 * l + 0],- a21 = a[2 * l + 1],- a22 = a[2 * l + 2],- b00 = b[0 * l + 0],- b01 = b[0 * l + 1],- b02 = b[0 * l + 2],- b10 = b[1 * l + 0],- b11 = b[1 * l + 1],- b12 = b[1 * l + 2],- b20 = b[2 * l + 0],- b21 = b[2 * l + 1],- b22 = b[2 * l + 2];-- return m2 ? [- a00 * b00 + a01 * b10,- a00 * b01 + a01 * b11,- a10 * b00 + a11 * b10,- a10 * b01 + a11 * b11- ] : [- a00 * b00 + a01 * b10 + a02 * b20,- a00 * b01 + a01 * b11 + a02 * b21,- a00 * b02 + a01 * b12 + a02 * b22,- a10 * b00 + a11 * b10 + a12 * b20,- a10 * b01 + a11 * b11 + a12 * b21,- a10 * b02 + a11 * b12 + a12 * b22,- a20 * b00 + a21 * b10 + a22 * b20,- a20 * b01 + a21 * b11 + a22 * b21,- a20 * b02 + a21 * b12 + a22 * b22- ];- };-}).call(this);--;(function(global) {- 'use strict';-- /**- * http://paulirish.com/2011/requestanimationframe-for-smart-animating/- * http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating- * requestAnimationFrame polyfill by Erik Möller.- * fixes from Paul Irish and Tino Zijdel- * MIT license- */- var x,- lastTime = 0,- vendors = ['ms', 'moz', 'webkit', 'o'];-- for (x = 0; x < vendors.length && !global.requestAnimationFrame; x++) {- global.requestAnimationFrame =- global[vendors[x] + 'RequestAnimationFrame'];- global.cancelAnimationFrame =- global[vendors[x] + 'CancelAnimationFrame'] ||- global[vendors[x] + 'CancelRequestAnimationFrame'];- }-- if (!global.requestAnimationFrame)- global.requestAnimationFrame = function(callback, element) {- var currTime = new Date().getTime(),- timeToCall = Math.max(0, 16 - (currTime - lastTime)),- id = global.setTimeout(- function() {- callback(currTime + timeToCall);- },- timeToCall- );-- lastTime = currTime + timeToCall;- return id;- };-- if (!global.cancelAnimationFrame)- global.cancelAnimationFrame = function(id) {- clearTimeout(id);- };-- /**- * Function.prototype.bind polyfill found on MDN.- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind#Compatibility- * Public domain- */- if (!Function.prototype.bind)- Function.prototype.bind = function(oThis) {- if (typeof this !== 'function')- // Closest thing possible to the ECMAScript 5 internal IsCallable- // function:- throw new TypeError(- 'Function.prototype.bind - what is trying to be bound is not callable'- );-- var aArgs = Array.prototype.slice.call(arguments, 1),- fToBind = this,- fNOP,- fBound;-- fNOP = function() {};- fBound = function() {- return fToBind.apply(- this instanceof fNOP && oThis ?- this :- oThis,- aArgs.concat(Array.prototype.slice.call(arguments))- );- };-- fNOP.prototype = this.prototype;- fBound.prototype = new fNOP();-- return fBound;- };-})(this);--;(function(undefined) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- // Packages initialization:- sigma.utils.pkg('sigma.settings');-- var settings = {- /**- * GRAPH SETTINGS:- * ***************- */- // {boolean} Indicates if the data have to be cloned in methods to add- // nodes or edges.- clone: true,- // {boolean} Indicates if nodes "id" values and edges "id", "source" and- // "target" values must be set as immutable.- immutable: true,- // {boolean} Indicates if sigma can log its errors and warnings.- verbose: false,--- /**- * RENDERERS SETTINGS:- * *******************- */- // {string}- classPrefix: 'sigma',- // {string}- defaultNodeType: 'def',- // {string}- defaultEdgeType: 'def',- // {string}- defaultLabelColor: '#000',- // {string}- defaultEdgeColor: '#000',- // {string}- defaultNodeColor: '#000',- // {string}- defaultLabelSize: 14,- // {string} Indicates how to choose the edges color. Available values:- // "source", "target", "default"- edgeColor: 'source',- // {number} Defines the minimal edge's arrow display size.- minArrowSize: 0,- // {string}- font: 'arial',- // {string} Example: 'bold'- fontStyle: '',- // {string} Indicates how to choose the labels color. Available values:- // "node", "default"- labelColor: 'default',- // {string} Indicates how to choose the labels size. Available values:- // "fixed", "proportional"- labelSize: 'fixed',- // {string} The ratio between the font size of the label and the node size.- labelSizeRatio: 1,- // {number} The minimum size a node must have to see its label displayed.- labelThreshold: 8,- // {number} The oversampling factor used in WebGL renderer.- webglOversamplingRatio: 2,- // {number} The size of the border of hovered nodes.- borderSize: 0,- // {number} The default hovered node border's color.- defaultNodeBorderColor: '#000',- // {number} The hovered node's label font. If not specified, will heritate- // the "font" value.- hoverFont: '',- // {boolean} If true, then only one node can be hovered at a time.- singleHover: true,- // {string} Example: 'bold'- hoverFontStyle: '',- // {string} Indicates how to choose the hovered nodes shadow color.- // Available values: "node", "default"- labelHoverShadow: 'default',- // {string}- labelHoverShadowColor: '#000',- // {string} Indicates how to choose the hovered nodes color.- // Available values: "node", "default"- nodeHoverColor: 'node',- // {string}- defaultNodeHoverColor: '#000',- // {string} Indicates how to choose the hovered nodes background color.- // Available values: "node", "default"- labelHoverBGColor: 'default',- // {string}- defaultHoverLabelBGColor: '#fff',- // {string} Indicates how to choose the hovered labels color.- // Available values: "node", "default"- labelHoverColor: 'default',- // {string}- defaultLabelHoverColor: '#000',- // {string} Indicates how to choose the edges hover color. Available values:- // "edge", "default"- edgeHoverColor: 'edge',- // {number} The size multiplicator of hovered edges.- edgeHoverSizeRatio: 1,- // {string}- defaultEdgeHoverColor: '#000',- // {boolean} Indicates if the edge extremities must be hovered when the- // edge is hovered.- edgeHoverExtremities: false,- // {booleans} The different drawing modes:- // false: Layered not displayed.- // true: Layered displayed.- drawEdges: true,- drawNodes: true,- drawLabels: true,- drawEdgeLabels: false,- // {boolean} Indicates if the edges must be drawn in several frames or in- // one frame, as the nodes and labels are drawn.- batchEdgesDrawing: false,- // {boolean} Indicates if the edges must be hidden during dragging and- // animations.- hideEdgesOnMove: false,- // {numbers} The different batch sizes, when elements are displayed in- // several frames.- canvasEdgesBatchSize: 500,- webglEdgesBatchSize: 1000,----- /**- * RESCALE SETTINGS:- * *****************- */- // {string} Indicates of to scale the graph relatively to its container.- // Available values: "inside", "outside"- scalingMode: 'inside',- // {number} The margin to keep around the graph.- sideMargin: 0,- // {number} Determine the size of the smallest and the biggest node / edges- // on the screen. This mapping makes easier to display the graph,- // avoiding too big nodes that take half of the screen, or too- // small ones that are not readable. If the two parameters are- // equals, then the minimal display size will be 0. And if they- // are both equal to 0, then there is no mapping, and the radius- // of the nodes will be their size.- minEdgeSize: 0.5,- maxEdgeSize: 1,- minNodeSize: 1,- maxNodeSize: 8,----- /**- * CAPTORS SETTINGS:- * *****************- */- // {boolean}- touchEnabled: true,- // {boolean}- mouseEnabled: true,- // {boolean}- mouseWheelEnabled: true,- // {boolean}- doubleClickEnabled: true,- // {boolean} Defines whether the custom events such as "clickNode" can be- // used.- eventsEnabled: true,- // {number} Defines by how much multiplicating the zooming level when the- // user zooms with the mouse-wheel.- zoomingRatio: 1.7,- // {number} Defines by how much multiplicating the zooming level when the- // user zooms by double clicking.- doubleClickZoomingRatio: 2.2,- // {number} The minimum zooming level.- zoomMin: 0.0625,- // {number} The maximum zooming level.- zoomMax: 2,- // {number} The duration of animations following a mouse scrolling.- mouseZoomDuration: 200,- // {number} The duration of animations following a mouse double click.- doubleClickZoomDuration: 200,- // {number} The duration of animations following a mouse dropping.- mouseInertiaDuration: 200,- // {number} The inertia power (mouse captor).- mouseInertiaRatio: 3,- // {number} The duration of animations following a touch dropping.- touchInertiaDuration: 200,- // {number} The inertia power (touch captor).- touchInertiaRatio: 3,- // {number} The maximum time between two clicks to make it a double click.- doubleClickTimeout: 300,- // {number} The maximum time between two taps to make it a double tap.- doubleTapTimeout: 300,- // {number} The maximum time of dragging to trigger intertia.- dragTimeout: 200,----- /**- * GLOBAL SETTINGS:- * ****************- */- // {boolean} Determines whether the instance has to refresh itself- // automatically when a "resize" event is dispatched from the- // window object.- autoResize: true,- // {boolean} Determines whether the "rescale" middleware has to be called- // automatically for each camera on refresh.- autoRescale: true,- // {boolean} If set to false, the camera method "goTo" will basically do- // nothing.- enableCamera: true,- // {boolean} If set to false, the nodes cannot be hovered.- enableHovering: true,- // {boolean} If set to true, the edges can be hovered.- enableEdgeHovering: false,- // {number} The size of the area around the edges to activate hovering.- edgeHoverPrecision: 5,- // {boolean} If set to true, the rescale middleware will ignore node sizes- // to determine the graphs boundings.- rescaleIgnoreSize: false,- // {boolean} Determines if the core has to try to catch errors on- // rendering.- skipErrors: false,----- /**- * CAMERA SETTINGS:- * ****************- */- // {number} The power degrees applied to the nodes/edges size relatively to- // the zooming level. Basically:- // > onScreenR = Math.pow(zoom, nodesPowRatio) * R- // > onScreenT = Math.pow(zoom, edgesPowRatio) * T- nodesPowRatio: 0.5,- edgesPowRatio: 0.5,----- /**- * ANIMATIONS SETTINGS:- * ********************- */- // {number} The default animation time.- animationsTime: 200- };-- // Export the previously designed settings:- sigma.settings = sigma.utils.extend(sigma.settings || {}, settings);-}).call(this);--;(function() {- 'use strict';-- /**- * Dispatcher constructor.- *- * @return {dispatcher} The new dispatcher instance.- */- var dispatcher = function() {- Object.defineProperty(this, '_handlers', {- value: {}- });- };----- /**- * Will execute the handler everytime that the indicated event (or the- * indicated events) will be triggered.- *- * @param {string} events The name of the event (or the events- * separated by spaces).- * @param {function(Object)} handler The handler to bind.- * @return {dispatcher} Returns the instance itself.- */- dispatcher.prototype.bind = function(events, handler) {- var i,- l,- event,- eArray;-- if (- arguments.length === 1 &&- typeof arguments[0] === 'object'- )- for (events in arguments[0])- this.bind(events, arguments[0][events]);- else if (- arguments.length === 2 &&- typeof arguments[1] === 'function'- ) {- eArray = typeof events === 'string' ? events.split(' ') : events;-- for (i = 0, l = eArray.length; i !== l; i += 1) {- event = eArray[i];-- // Check that event is not '':- if (!event)- continue;-- if (!this._handlers[event])- this._handlers[event] = [];-- // Using an object instead of directly the handler will make possible- // later to add flags- this._handlers[event].push({- handler: handler- });- }- } else- throw 'bind: Wrong arguments.';-- return this;- };-- /**- * Removes the handler from a specified event (or specified events).- *- * @param {?string} events The name of the event (or the events- * separated by spaces). If undefined,- * then all handlers are removed.- * @param {?function(object)} handler The handler to unbind. If undefined,- * each handler bound to the event or the- * events will be removed.- * @return {dispatcher} Returns the instance itself.- */- dispatcher.prototype.unbind = function(events, handler) {- var i,- n,- j,- m,- k,- a,- event,- eArray = typeof events === 'string' ? events.split(' ') : events;-- if (!arguments.length) {- for (k in this._handlers)- delete this._handlers[k];- return this;- }-- if (handler) {- for (i = 0, n = eArray.length; i !== n; i += 1) {- event = eArray[i];- if (this._handlers[event]) {- a = [];- for (j = 0, m = this._handlers[event].length; j !== m; j += 1)- if (this._handlers[event][j].handler !== handler)- a.push(this._handlers[event][j]);-- this._handlers[event] = a;- }-- if (this._handlers[event] && this._handlers[event].length === 0)- delete this._handlers[event];- }- } else- for (i = 0, n = eArray.length; i !== n; i += 1)- delete this._handlers[eArray[i]];-- return this;- };-- /**- * Executes each handler bound to the event- *- * @param {string} events The name of the event (or the events separated- * by spaces).- * @param {?object} data The content of the event (optional).- * @return {dispatcher} Returns the instance itself.- */- dispatcher.prototype.dispatchEvent = function(events, data) {- var i,- n,- j,- m,- a,- event,- eventName,- self = this,- eArray = typeof events === 'string' ? events.split(' ') : events;-- data = data === undefined ? {} : data;-- for (i = 0, n = eArray.length; i !== n; i += 1) {- eventName = eArray[i];-- if (this._handlers[eventName]) {- event = self.getEvent(eventName, data);- a = [];-- for (j = 0, m = this._handlers[eventName].length; j !== m; j += 1) {- this._handlers[eventName][j].handler(event);- if (!this._handlers[eventName][j].one)- a.push(this._handlers[eventName][j]);- }-- this._handlers[eventName] = a;- }- }-- return this;- };-- /**- * Return an event object.- *- * @param {string} events The name of the event.- * @param {?object} data The content of the event (optional).- * @return {object} Returns the instance itself.- */- dispatcher.prototype.getEvent = function(event, data) {- return {- type: event,- data: data || {},- target: this- };- };-- /**- * A useful function to deal with inheritance. It will make the target- * inherit the prototype of the class dispatcher as well as its constructor.- *- * @param {object} target The target.- */- dispatcher.extend = function(target, args) {- var k;-- for (k in dispatcher.prototype)- if (dispatcher.prototype.hasOwnProperty(k))- target[k] = dispatcher.prototype[k];-- dispatcher.apply(target, args);- };----- /**- * EXPORT:- * *******- */- if (typeof this.sigma !== 'undefined') {- this.sigma.classes = this.sigma.classes || {};- this.sigma.classes.dispatcher = dispatcher;- } else if (typeof exports !== 'undefined') {- if (typeof module !== 'undefined' && module.exports)- exports = module.exports = dispatcher;- exports.dispatcher = dispatcher;- } else- this.dispatcher = dispatcher;-}).call(this);--;(function() {- 'use strict';-- /**- * This utils aims to facilitate the manipulation of each instance setting.- * Using a function instead of an object brings two main advantages: First,- * it will be easier in the future to catch settings updates through a- * function than an object. Second, giving it a full object will "merge" it- * to the settings object properly, keeping us to have to always add a loop.- *- * @return {configurable} The "settings" function.- */- var configurable = function() {- var i,- l,- data = {},- datas = Array.prototype.slice.call(arguments, 0);-- /**- * The method to use to set or get any property of this instance.- *- * @param {string|object} a1 If it is a string and if a2 is undefined,- * then it will return the corresponding- * property. If it is a string and if a2 is- * set, then it will set a2 as the property- * corresponding to a1, and return this. If- * it is an object, then each pair string +- * object(or any other type) will be set as a- * property.- * @param {*?} a2 The new property corresponding to a1 if a1- * is a string.- * @return {*|configurable} Returns itself or the corresponding- * property.- *- * Polymorphism:- * *************- * Here are some basic use examples:- *- * > settings = new configurable();- * > settings('mySetting', 42);- * > settings('mySetting'); // Logs: 42- * > settings('mySetting', 123);- * > settings('mySetting'); // Logs: 123- * > settings({mySetting: 456});- * > settings('mySetting'); // Logs: 456- *- * Also, it is possible to use the function as a fallback:- * > settings({mySetting: 'abc'}, 'mySetting'); // Logs: 'abc'- * > settings({hisSetting: 'abc'}, 'mySetting'); // Logs: 456- */- var settings = function(a1, a2) {- var o,- i,- l,- k;-- if (arguments.length === 1 && typeof a1 === 'string') {- if (data[a1] !== undefined)- return data[a1];- for (i = 0, l = datas.length; i < l; i++)- if (datas[i][a1] !== undefined)- return datas[i][a1];- return undefined;- } else if (typeof a1 === 'object' && typeof a2 === 'string') {- return (a1 || {})[a2] !== undefined ? a1[a2] : settings(a2);- } else {- o = (typeof a1 === 'object' && a2 === undefined) ? a1 : {};-- if (typeof a1 === 'string')- o[a1] = a2;-- for (i = 0, k = Object.keys(o), l = k.length; i < l; i++)- data[k[i]] = o[k[i]];-- return this;- }- };-- /**- * This method returns a new configurable function, with new objects- *- * @param {object*} Any number of objects to search in.- * @return {function} Returns the function. Check its documentation to know- * more about how it works.- */- settings.embedObjects = function() {- var args = datas.concat(- data- ).concat(- Array.prototype.splice.call(arguments, 0)- );-- return configurable.apply({}, args);- };-- // Initialize- for (i = 0, l = arguments.length; i < l; i++)- settings(arguments[i]);-- return settings;- };-- /**- * EXPORT:- * *******- */- if (typeof this.sigma !== 'undefined') {- this.sigma.classes = this.sigma.classes || {};- this.sigma.classes.configurable = configurable;- } else if (typeof exports !== 'undefined') {- if (typeof module !== 'undefined' && module.exports)- exports = module.exports = configurable;- exports.configurable = configurable;- } else- this.configurable = configurable;-}).call(this);--;(function(undefined) {- 'use strict';-- var _methods = Object.create(null),- _indexes = Object.create(null),- _initBindings = Object.create(null),- _methodBindings = Object.create(null),- _methodBeforeBindings = Object.create(null),- _defaultSettings = {- immutable: true,- clone: true- },- _defaultSettingsFunction = function(key) {- return _defaultSettings[key];- };-- /**- * The graph constructor. It initializes the data and the indexes, and binds- * the custom indexes and methods to its own scope.- *- * Recognized parameters:- * **********************- * Here is the exhaustive list of every accepted parameters in the settings- * object:- *- * {boolean} clone Indicates if the data have to be cloned in methods- * to add nodes or edges.- * {boolean} immutable Indicates if nodes "id" values and edges "id",- * "source" and "target" values must be set as- * immutable.- *- * @param {?configurable} settings Eventually a settings function.- * @return {graph} The new graph instance.- */- var graph = function(settings) {- var k,- fn,- data;-- /**- * DATA:- * *****- * Every data that is callable from graph methods are stored in this "data"- * object. This object will be served as context for all these methods,- * and it is possible to add other type of data in it.- */- data = {- /**- * SETTINGS FUNCTION:- * ******************- */- settings: settings || _defaultSettingsFunction,-- /**- * MAIN DATA:- * **********- */- nodesArray: [],- edgesArray: [],-- /**- * GLOBAL INDEXES:- * ***************- * These indexes just index data by ids.- */- nodesIndex: Object.create(null),- edgesIndex: Object.create(null),-- /**- * LOCAL INDEXES:- * **************- * These indexes refer from node to nodes. Each key is an id, and each- * value is the array of the ids of related nodes.- */- inNeighborsIndex: Object.create(null),- outNeighborsIndex: Object.create(null),- allNeighborsIndex: Object.create(null),-- inNeighborsCount: Object.create(null),- outNeighborsCount: Object.create(null),- allNeighborsCount: Object.create(null)- };-- // Execute bindings:- for (k in _initBindings)- _initBindings[k].call(data);-- // Add methods to both the scope and the data objects:- for (k in _methods) {- fn = __bindGraphMethod(k, data, _methods[k]);- this[k] = fn;- data[k] = fn;- }- };----- /**- * A custom tool to bind methods such that function that are bound to it will- * be executed anytime the method is called.- *- * @param {string} methodName The name of the method to bind.- * @param {object} scope The scope where the method must be executed.- * @param {function} fn The method itself.- * @return {function} The new method.- */- function __bindGraphMethod(methodName, scope, fn) {- var result = function() {- var k,- res;-- // Execute "before" bound functions:- for (k in _methodBeforeBindings[methodName])- _methodBeforeBindings[methodName][k].apply(scope, arguments);-- // Apply the method:- res = fn.apply(scope, arguments);-- // Execute bound functions:- for (k in _methodBindings[methodName])- _methodBindings[methodName][k].apply(scope, arguments);-- // Return res:- return res;- };-- return result;- }-- /**- * This custom tool function removes every pair key/value from an hash. The- * goal is to avoid creating a new object while some other references are- * still hanging in some scopes...- *- * @param {object} obj The object to empty.- * @return {object} The empty object.- */- function __emptyObject(obj) {- var k;-- for (k in obj)- if (!('hasOwnProperty' in obj) || obj.hasOwnProperty(k))- delete obj[k];-- return obj;- }----- /**- * This global method adds a method that will be bound to the futurly created- * graph instances.- *- * Since these methods will be bound to their scope when the instances are- * created, it does not use the prototype. Because of that, methods have to- * be added before instances are created to make them available.- *- * Here is an example:- *- * > graph.addMethod('getNodesCount', function() {- * > return this.nodesArray.length;- * > });- * >- * > var myGraph = new graph();- * > console.log(myGraph.getNodesCount()); // outputs 0- *- * @param {string} methodName The name of the method.- * @param {function} fn The method itself.- * @return {object} The global graph constructor.- */- graph.addMethod = function(methodName, fn) {- if (- typeof methodName !== 'string' ||- typeof fn !== 'function' ||- arguments.length !== 2- )- throw 'addMethod: Wrong arguments.';-- if (_methods[methodName] || graph[methodName])- throw 'The method "' + methodName + '" already exists.';-- _methods[methodName] = fn;- _methodBindings[methodName] = Object.create(null);- _methodBeforeBindings[methodName] = Object.create(null);-- return this;- };-- /**- * This global method returns true if the method has already been added, and- * false else.- *- * Here are some examples:- *- * > graph.hasMethod('addNode'); // returns true- * > graph.hasMethod('hasMethod'); // returns true- * > graph.hasMethod('unexistingMethod'); // returns false- *- * @param {string} methodName The name of the method.- * @return {boolean} The result.- */- graph.hasMethod = function(methodName) {- return !!(_methods[methodName] || graph[methodName]);- };-- /**- * This global methods attaches a function to a method. Anytime the specified- * method is called, the attached function is called right after, with the- * same arguments and in the same scope. The attached function is called- * right before if the last argument is true, unless the method is the graph- * constructor.- *- * To attach a function to the graph constructor, use 'constructor' as the- * method name (first argument).- *- * The main idea is to have a clean way to keep custom indexes up to date,- * for instance:- *- * > var timesAddNodeCalled = 0;- * > graph.attach('addNode', 'timesAddNodeCalledInc', function() {- * > timesAddNodeCalled++;- * > });- * >- * > var myGraph = new graph();- * > console.log(timesAddNodeCalled); // outputs 0- * >- * > myGraph.addNode({ id: '1' }).addNode({ id: '2' });- * > console.log(timesAddNodeCalled); // outputs 2- *- * The idea for calling a function before is to provide pre-processors, for- * instance:- *- * > var colorPalette = { Person: '#C3CBE1', Place: '#9BDEBD' };- * > graph.attach('addNode', 'applyNodeColorPalette', function(n) {- * > n.color = colorPalette[n.category];- * > }, true);- * >- * > var myGraph = new graph();- * > myGraph.addNode({ id: 'n0', category: 'Person' });- * > console.log(myGraph.nodes('n0').color); // outputs '#C3CBE1'- *- * @param {string} methodName The name of the related method or- * "constructor".- * @param {string} key The key to identify the function to attach.- * @param {function} fn The function to bind.- * @param {boolean} before If true the function is called right before.- * @return {object} The global graph constructor.- */- graph.attach = function(methodName, key, fn, before) {- if (- typeof methodName !== 'string' ||- typeof key !== 'string' ||- typeof fn !== 'function' ||- arguments.length < 3 ||- arguments.length > 4- )- throw 'attach: Wrong arguments.';-- var bindings;-- if (methodName === 'constructor')- bindings = _initBindings;- else {- if (before) {- if (!_methodBeforeBindings[methodName])- throw 'The method "' + methodName + '" does not exist.';-- bindings = _methodBeforeBindings[methodName];- }- else {- if (!_methodBindings[methodName])- throw 'The method "' + methodName + '" does not exist.';-- bindings = _methodBindings[methodName];- }- }-- if (bindings[key])- throw 'A function "' + key + '" is already attached ' +- 'to the method "' + methodName + '".';-- bindings[key] = fn;-- return this;- };-- /**- * Alias of attach(methodName, key, fn, true).- */- graph.attachBefore = function(methodName, key, fn) {- return this.attach(methodName, key, fn, true);- };-- /**- * This methods is just an helper to deal with custom indexes. It takes as- * arguments the name of the index and an object containing all the different- * functions to bind to the methods.- *- * Here is a basic example, that creates an index to keep the number of nodes- * in the current graph. It also adds a method to provide a getter on that- * new index:- *- * > sigma.classes.graph.addIndex('nodesCount', {- * > constructor: function() {- * > this.nodesCount = 0;- * > },- * > addNode: function() {- * > this.nodesCount++;- * > },- * > dropNode: function() {- * > this.nodesCount--;- * > }- * > });- * >- * > sigma.classes.graph.addMethod('getNodesCount', function() {- * > return this.nodesCount;- * > });- * >- * > var myGraph = new sigma.classes.graph();- * > console.log(myGraph.getNodesCount()); // outputs 0- * >- * > myGraph.addNode({ id: '1' }).addNode({ id: '2' });- * > console.log(myGraph.getNodesCount()); // outputs 2- *- * @param {string} name The name of the index.- * @param {object} bindings The object containing the functions to bind.- * @return {object} The global graph constructor.- */- graph.addIndex = function(name, bindings) {- if (- typeof name !== 'string' ||- Object(bindings) !== bindings ||- arguments.length !== 2- )- throw 'addIndex: Wrong arguments.';-- if (_indexes[name])- throw 'The index "' + name + '" already exists.';-- var k;-- // Store the bindings:- _indexes[name] = bindings;-- // Attach the bindings:- for (k in bindings)- if (typeof bindings[k] !== 'function')- throw 'The bindings must be functions.';- else- graph.attach(k, name, bindings[k]);-- return this;- };----- /**- * This method adds a node to the graph. The node must be an object, with a- * string under the key "id". Except for this, it is possible to add any- * other attribute, that will be preserved all along the manipulations.- *- * If the graph option "clone" has a truthy value, the node will be cloned- * when added to the graph. Also, if the graph option "immutable" has a- * truthy value, its id will be defined as immutable.- *- * @param {object} node The node to add.- * @return {object} The graph instance.- */- graph.addMethod('addNode', function(node) {- // Check that the node is an object and has an id:- if (Object(node) !== node || arguments.length !== 1)- throw 'addNode: Wrong arguments.';-- if (typeof node.id !== 'string' && typeof node.id !== 'number')- throw 'The node must have a string or number id.';-- if (this.nodesIndex[node.id])- throw 'The node "' + node.id + '" already exists.';-- var k,- id = node.id,- validNode = Object.create(null);-- // Check the "clone" option:- if (this.settings('clone')) {- for (k in node)- if (k !== 'id')- validNode[k] = node[k];- } else- validNode = node;-- // Check the "immutable" option:- if (this.settings('immutable'))- Object.defineProperty(validNode, 'id', {- value: id,- enumerable: true- });- else- validNode.id = id;-- // Add empty containers for edges indexes:- this.inNeighborsIndex[id] = Object.create(null);- this.outNeighborsIndex[id] = Object.create(null);- this.allNeighborsIndex[id] = Object.create(null);-- this.inNeighborsCount[id] = 0;- this.outNeighborsCount[id] = 0;- this.allNeighborsCount[id] = 0;-- // Add the node to indexes:- this.nodesArray.push(validNode);- this.nodesIndex[validNode.id] = validNode;-- // Return the current instance:- return this;- });-- /**- * This method adds an edge to the graph. The edge must be an object, with a- * string under the key "id", and strings under the keys "source" and- * "target" that design existing nodes. Except for this, it is possible to- * add any other attribute, that will be preserved all along the- * manipulations.- *- * If the graph option "clone" has a truthy value, the edge will be cloned- * when added to the graph. Also, if the graph option "immutable" has a- * truthy value, its id, source and target will be defined as immutable.- *- * @param {object} edge The edge to add.- * @return {object} The graph instance.- */- graph.addMethod('addEdge', function(edge) {- // Check that the edge is an object and has an id:- if (Object(edge) !== edge || arguments.length !== 1)- throw 'addEdge: Wrong arguments.';-- if (typeof edge.id !== 'string' && typeof edge.id !== 'number')- throw 'The edge must have a string or number id.';-- if ((typeof edge.source !== 'string' && typeof edge.source !== 'number') ||- !this.nodesIndex[edge.source])- throw 'The edge source must have an existing node id.';-- if ((typeof edge.target !== 'string' && typeof edge.target !== 'number') ||- !this.nodesIndex[edge.target])- throw 'The edge target must have an existing node id.';-- if (this.edgesIndex[edge.id])- throw 'The edge "' + edge.id + '" already exists.';-- var k,- validEdge = Object.create(null);-- // Check the "clone" option:- if (this.settings('clone')) {- for (k in edge)- if (k !== 'id' && k !== 'source' && k !== 'target')- validEdge[k] = edge[k];- } else- validEdge = edge;-- // Check the "immutable" option:- if (this.settings('immutable')) {- Object.defineProperty(validEdge, 'id', {- value: edge.id,- enumerable: true- });-- Object.defineProperty(validEdge, 'source', {- value: edge.source,- enumerable: true- });-- Object.defineProperty(validEdge, 'target', {- value: edge.target,- enumerable: true- });- } else {- validEdge.id = edge.id;- validEdge.source = edge.source;- validEdge.target = edge.target;- }-- // Add the edge to indexes:- this.edgesArray.push(validEdge);- this.edgesIndex[validEdge.id] = validEdge;-- if (!this.inNeighborsIndex[validEdge.target][validEdge.source])- this.inNeighborsIndex[validEdge.target][validEdge.source] =- Object.create(null);- this.inNeighborsIndex[validEdge.target][validEdge.source][validEdge.id] =- validEdge;-- if (!this.outNeighborsIndex[validEdge.source][validEdge.target])- this.outNeighborsIndex[validEdge.source][validEdge.target] =- Object.create(null);- this.outNeighborsIndex[validEdge.source][validEdge.target][validEdge.id] =- validEdge;-- if (!this.allNeighborsIndex[validEdge.source][validEdge.target])- this.allNeighborsIndex[validEdge.source][validEdge.target] =- Object.create(null);- this.allNeighborsIndex[validEdge.source][validEdge.target][validEdge.id] =- validEdge;-- if (validEdge.target !== validEdge.source) {- if (!this.allNeighborsIndex[validEdge.target][validEdge.source])- this.allNeighborsIndex[validEdge.target][validEdge.source] =- Object.create(null);- this.allNeighborsIndex[validEdge.target][validEdge.source][validEdge.id] =- validEdge;- }-- // Keep counts up to date:- this.inNeighborsCount[validEdge.target]++;- this.outNeighborsCount[validEdge.source]++;- this.allNeighborsCount[validEdge.target]++;- this.allNeighborsCount[validEdge.source]++;-- return this;- });-- /**- * This method drops a node from the graph. It also removes each edge that is- * bound to it, through the dropEdge method. An error is thrown if the node- * does not exist.- *- * @param {string} id The node id.- * @return {object} The graph instance.- */- graph.addMethod('dropNode', function(id) {- // Check that the arguments are valid:- if ((typeof id !== 'string' && typeof id !== 'number') ||- arguments.length !== 1)- throw 'dropNode: Wrong arguments.';-- if (!this.nodesIndex[id])- throw 'The node "' + id + '" does not exist.';-- var i, k, l;-- // Remove the node from indexes:- delete this.nodesIndex[id];- for (i = 0, l = this.nodesArray.length; i < l; i++)- if (this.nodesArray[i].id === id) {- this.nodesArray.splice(i, 1);- break;- }-- // Remove related edges:- for (i = this.edgesArray.length - 1; i >= 0; i--)- if (this.edgesArray[i].source === id || this.edgesArray[i].target === id)- this.dropEdge(this.edgesArray[i].id);-- // Remove related edge indexes:- delete this.inNeighborsIndex[id];- delete this.outNeighborsIndex[id];- delete this.allNeighborsIndex[id];-- delete this.inNeighborsCount[id];- delete this.outNeighborsCount[id];- delete this.allNeighborsCount[id];-- for (k in this.nodesIndex) {- delete this.inNeighborsIndex[k][id];- delete this.outNeighborsIndex[k][id];- delete this.allNeighborsIndex[k][id];- }-- return this;- });-- /**- * This method drops an edge from the graph. An error is thrown if the edge- * does not exist.- *- * @param {string} id The edge id.- * @return {object} The graph instance.- */- graph.addMethod('dropEdge', function(id) {- // Check that the arguments are valid:- if ((typeof id !== 'string' && typeof id !== 'number') ||- arguments.length !== 1)- throw 'dropEdge: Wrong arguments.';-- if (!this.edgesIndex[id])- throw 'The edge "' + id + '" does not exist.';-- var i, l, edge;-- // Remove the edge from indexes:- edge = this.edgesIndex[id];- delete this.edgesIndex[id];- for (i = 0, l = this.edgesArray.length; i < l; i++)- if (this.edgesArray[i].id === id) {- this.edgesArray.splice(i, 1);- break;- }-- delete this.inNeighborsIndex[edge.target][edge.source][edge.id];- if (!Object.keys(this.inNeighborsIndex[edge.target][edge.source]).length)- delete this.inNeighborsIndex[edge.target][edge.source];-- delete this.outNeighborsIndex[edge.source][edge.target][edge.id];- if (!Object.keys(this.outNeighborsIndex[edge.source][edge.target]).length)- delete this.outNeighborsIndex[edge.source][edge.target];-- delete this.allNeighborsIndex[edge.source][edge.target][edge.id];- if (!Object.keys(this.allNeighborsIndex[edge.source][edge.target]).length)- delete this.allNeighborsIndex[edge.source][edge.target];-- if (edge.target !== edge.source) {- delete this.allNeighborsIndex[edge.target][edge.source][edge.id];- if (!Object.keys(this.allNeighborsIndex[edge.target][edge.source]).length)- delete this.allNeighborsIndex[edge.target][edge.source];- }-- this.inNeighborsCount[edge.target]--;- this.outNeighborsCount[edge.source]--;- this.allNeighborsCount[edge.source]--;- this.allNeighborsCount[edge.target]--;-- return this;- });-- /**- * This method destroys the current instance. It basically empties each index- * and methods attached to the graph.- */- graph.addMethod('kill', function() {- // Delete arrays:- this.nodesArray.length = 0;- this.edgesArray.length = 0;- delete this.nodesArray;- delete this.edgesArray;-- // Delete indexes:- delete this.nodesIndex;- delete this.edgesIndex;- delete this.inNeighborsIndex;- delete this.outNeighborsIndex;- delete this.allNeighborsIndex;- delete this.inNeighborsCount;- delete this.outNeighborsCount;- delete this.allNeighborsCount;- });-- /**- * This method empties the nodes and edges arrays, as well as the different- * indexes.- *- * @return {object} The graph instance.- */- graph.addMethod('clear', function() {- this.nodesArray.length = 0;- this.edgesArray.length = 0;-- // Due to GC issues, I prefer not to create new object. These objects are- // only available from the methods and attached functions, but still, it is- // better to prevent ghost references to unrelevant data...- __emptyObject(this.nodesIndex);- __emptyObject(this.edgesIndex);- __emptyObject(this.nodesIndex);- __emptyObject(this.inNeighborsIndex);- __emptyObject(this.outNeighborsIndex);- __emptyObject(this.allNeighborsIndex);- __emptyObject(this.inNeighborsCount);- __emptyObject(this.outNeighborsCount);- __emptyObject(this.allNeighborsCount);-- return this;- });-- /**- * This method reads an object and adds the nodes and edges, through the- * proper methods "addNode" and "addEdge".- *- * Here is an example:- *- * > var myGraph = new graph();- * > myGraph.read({- * > nodes: [- * > { id: 'n0' },- * > { id: 'n1' }- * > ],- * > edges: [- * > {- * > id: 'e0',- * > source: 'n0',- * > target: 'n1'- * > }- * > ]- * > });- * >- * > console.log(- * > myGraph.nodes().length,- * > myGraph.edges().length- * > ); // outputs 2 1- *- * @param {object} g The graph object.- * @return {object} The graph instance.- */- graph.addMethod('read', function(g) {- var i,- a,- l;-- a = g.nodes || [];- for (i = 0, l = a.length; i < l; i++)- this.addNode(a[i]);-- a = g.edges || [];- for (i = 0, l = a.length; i < l; i++)- this.addEdge(a[i]);-- return this;- });-- /**- * This methods returns one or several nodes, depending on how it is called.- *- * To get the array of nodes, call "nodes" without argument. To get a- * specific node, call it with the id of the node. The get multiple node,- * call it with an array of ids, and it will return the array of nodes, in- * the same order.- *- * @param {?(string|array)} v Eventually one id, an array of ids.- * @return {object|array} The related node or array of nodes.- */- graph.addMethod('nodes', function(v) {- // Clone the array of nodes and return it:- if (!arguments.length)- return this.nodesArray.slice(0);-- // Return the related node:- if (arguments.length === 1 &&- (typeof v === 'string' || typeof v === 'number'))- return this.nodesIndex[v];-- // Return an array of the related node:- if (- arguments.length === 1 &&- Object.prototype.toString.call(v) === '[object Array]'- ) {- var i,- l,- a = [];-- for (i = 0, l = v.length; i < l; i++)- if (typeof v[i] === 'string' || typeof v[i] === 'number')- a.push(this.nodesIndex[v[i]]);- else- throw 'nodes: Wrong arguments.';-- return a;- }-- throw 'nodes: Wrong arguments.';- });-- /**- * This methods returns the degree of one or several nodes, depending on how- * it is called. It is also possible to get incoming or outcoming degrees- * instead by specifying 'in' or 'out' as a second argument.- *- * @param {string|array} v One id, an array of ids.- * @param {?string} which Which degree is required. Values are 'in',- * 'out', and by default the normal degree.- * @return {number|array} The related degree or array of degrees.- */- graph.addMethod('degree', function(v, which) {- // Check which degree is required:- which = {- 'in': this.inNeighborsCount,- 'out': this.outNeighborsCount- }[which || ''] || this.allNeighborsCount;-- // Return the related node:- if (typeof v === 'string' || typeof v === 'number')- return which[v];-- // Return an array of the related node:- if (Object.prototype.toString.call(v) === '[object Array]') {- var i,- l,- a = [];-- for (i = 0, l = v.length; i < l; i++)- if (typeof v[i] === 'string' || typeof v[i] === 'number')- a.push(which[v[i]]);- else- throw 'degree: Wrong arguments.';-- return a;- }-- throw 'degree: Wrong arguments.';- });-- /**- * This methods returns one or several edges, depending on how it is called.- *- * To get the array of edges, call "edges" without argument. To get a- * specific edge, call it with the id of the edge. The get multiple edge,- * call it with an array of ids, and it will return the array of edges, in- * the same order.- *- * @param {?(string|array)} v Eventually one id, an array of ids.- * @return {object|array} The related edge or array of edges.- */- graph.addMethod('edges', function(v) {- // Clone the array of edges and return it:- if (!arguments.length)- return this.edgesArray.slice(0);-- // Return the related edge:- if (arguments.length === 1 &&- (typeof v === 'string' || typeof v === 'number'))- return this.edgesIndex[v];-- // Return an array of the related edge:- if (- arguments.length === 1 &&- Object.prototype.toString.call(v) === '[object Array]'- ) {- var i,- l,- a = [];-- for (i = 0, l = v.length; i < l; i++)- if (typeof v[i] === 'string' || typeof v[i] === 'number')- a.push(this.edgesIndex[v[i]]);- else- throw 'edges: Wrong arguments.';-- return a;- }-- throw 'edges: Wrong arguments.';- });--- /**- * EXPORT:- * *******- */- if (typeof sigma !== 'undefined') {- sigma.classes = sigma.classes || Object.create(null);- sigma.classes.graph = graph;- } else if (typeof exports !== 'undefined') {- if (typeof module !== 'undefined' && module.exports)- exports = module.exports = graph;- exports.graph = graph;- } else- this.graph = graph;-}).call(this);--;(function(undefined) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- sigma.utils.pkg('sigma.classes');-- /**- * The camera constructor. It just initializes its attributes and methods.- *- * @param {string} id The id.- * @param {sigma.classes.graph} graph The graph.- * @param {configurable} settings The settings function.- * @param {?object} options Eventually some overriding options.- * @return {camera} Returns the fresh new camera instance.- */- sigma.classes.camera = function(id, graph, settings, options) {- sigma.classes.dispatcher.extend(this);-- Object.defineProperty(this, 'graph', {- value: graph- });- Object.defineProperty(this, 'id', {- value: id- });- Object.defineProperty(this, 'readPrefix', {- value: 'read_cam' + id + ':'- });- Object.defineProperty(this, 'prefix', {- value: 'cam' + id + ':'- });-- this.x = 0;- this.y = 0;- this.ratio = 1;- this.angle = 0;- this.isAnimated = false;- this.settings = (typeof options === 'object' && options) ?- settings.embedObject(options) :- settings;- };-- /**- * Updates the camera position.- *- * @param {object} coordinates The new coordinates object.- * @return {camera} Returns the camera.- */- sigma.classes.camera.prototype.goTo = function(coordinates) {- if (!this.settings('enableCamera'))- return this;-- var i,- l,- c = coordinates || {},- keys = ['x', 'y', 'ratio', 'angle'];-- for (i = 0, l = keys.length; i < l; i++)- if (c[keys[i]] !== undefined) {- if (typeof c[keys[i]] === 'number' && !isNaN(c[keys[i]]))- this[keys[i]] = c[keys[i]];- else- throw 'Value for "' + keys[i] + '" is not a number.';- }-- this.dispatchEvent('coordinatesUpdated');- return this;- };-- /**- * This method takes a graph and computes for each node and edges its- * coordinates relatively to the center of the camera. Basically, it will- * compute the coordinates that will be used by the graphic renderers.- *- * Since it should be possible to use different cameras and different- * renderers, it is possible to specify a prefix to put before the new- * coordinates (to get something like "node.camera1_x")- *- * @param {?string} read The prefix of the coordinates to read.- * @param {?string} write The prefix of the coordinates to write.- * @param {?object} options Eventually an object of options. Those can be:- * - A restricted nodes array.- * - A restricted edges array.- * - A width.- * - A height.- * @return {camera} Returns the camera.- */- sigma.classes.camera.prototype.applyView = function(read, write, options) {- options = options || {};- write = write !== undefined ? write : this.prefix;- read = read !== undefined ? read : this.readPrefix;-- var nodes = options.nodes || this.graph.nodes(),- edges = options.edges || this.graph.edges();-- var i,- l,- node,- cos = Math.cos(this.angle),- sin = Math.sin(this.angle);-- for (i = 0, l = nodes.length; i < l; i++) {- node = nodes[i];- node[write + 'x'] =- (- ((node[read + 'x'] || 0) - this.x) * cos +- ((node[read + 'y'] || 0) - this.y) * sin- ) / this.ratio + (options.width || 0) / 2;- node[write + 'y'] =- (- ((node[read + 'y'] || 0) - this.y) * cos -- ((node[read + 'x'] || 0) - this.x) * sin- ) / this.ratio + (options.height || 0) / 2;- node[write + 'size'] =- (node[read + 'size'] || 0) /- Math.pow(this.ratio, this.settings('nodesPowRatio'));- }-- for (i = 0, l = edges.length; i < l; i++) {- edges[i][write + 'size'] =- (edges[i][read + 'size'] || 0) /- Math.pow(this.ratio, this.settings('edgesPowRatio'));- }-- return this;- };-- /**- * This function converts the coordinates of a point from the frame of the- * camera to the frame of the graph.- *- * @param {number} x The X coordinate of the point in the frame of the- * camera.- * @param {number} y The Y coordinate of the point in the frame of the- * camera.- * @return {object} The point coordinates in the frame of the graph.- */- sigma.classes.camera.prototype.graphPosition = function(x, y, vector) {- var X = 0,- Y = 0,- cos = Math.cos(this.angle),- sin = Math.sin(this.angle);-- // Revert the origin differential vector:- if (!vector) {- X = - (this.x * cos + this.y * sin) / this.ratio;- Y = - (this.y * cos - this.x * sin) / this.ratio;- }-- return {- x: (x * cos + y * sin) / this.ratio + X,- y: (y * cos - x * sin) / this.ratio + Y- };- };-- /**- * This function converts the coordinates of a point from the frame of the- * graph to the frame of the camera.- *- * @param {number} x The X coordinate of the point in the frame of the- * graph.- * @param {number} y The Y coordinate of the point in the frame of the- * graph.- * @return {object} The point coordinates in the frame of the camera.- */- sigma.classes.camera.prototype.cameraPosition = function(x, y, vector) {- var X = 0,- Y = 0,- cos = Math.cos(this.angle),- sin = Math.sin(this.angle);-- // Revert the origin differential vector:- if (!vector) {- X = - (this.x * cos + this.y * sin) / this.ratio;- Y = - (this.y * cos - this.x * sin) / this.ratio;- }-- return {- x: ((x - X) * cos - (y - Y) * sin) * this.ratio,- y: ((y - Y) * cos + (x - X) * sin) * this.ratio- };- };-- /**- * This method returns the transformation matrix of the camera. This is- * especially useful to apply the camera view directly in shaders, in case of- * WebGL rendering.- *- * @return {array} The transformation matrix.- */- sigma.classes.camera.prototype.getMatrix = function() {- var scale = sigma.utils.matrices.scale(1 / this.ratio),- rotation = sigma.utils.matrices.rotation(this.angle),- translation = sigma.utils.matrices.translation(-this.x, -this.y),- matrix = sigma.utils.matrices.multiply(- translation,- sigma.utils.matrices.multiply(- rotation,- scale- )- );-- return matrix;- };-- /**- * Taking a width and a height as parameters, this method returns the- * coordinates of the rectangle representing the camera on screen, in the- * graph's referentiel.- *- * To keep displaying labels of nodes going out of the screen, the method- * keeps a margin around the screen in the returned rectangle.- *- * @param {number} width The width of the screen.- * @param {number} height The height of the screen.- * @return {object} The rectangle as x1, y1, x2 and y2, representing- * two opposite points.- */- sigma.classes.camera.prototype.getRectangle = function(width, height) {- var widthVect = this.cameraPosition(width, 0, true),- heightVect = this.cameraPosition(0, height, true),- centerVect = this.cameraPosition(width / 2, height / 2, true),- marginX = this.cameraPosition(width / 4, 0, true).x,- marginY = this.cameraPosition(0, height / 4, true).y;-- return {- x1: this.x - centerVect.x - marginX,- y1: this.y - centerVect.y - marginY,- x2: this.x - centerVect.x + marginX + widthVect.x,- y2: this.y - centerVect.y - marginY + widthVect.y,- height: Math.sqrt(- Math.pow(heightVect.x, 2) +- Math.pow(heightVect.y + 2 * marginY, 2)- )- };- };-}).call(this);--;(function(undefined) {- 'use strict';-- /**- * Sigma Quadtree Module- * =====================- *- * Author: Guillaume Plique (Yomguithereal)- * Version: 0.2- */---- /**- * Quad Geometric Operations- * -------------------------- *- * A useful batch of geometric operations used by the quadtree.- */-- var _geom = {-- /**- * Transforms a graph node with x, y and size into an- * axis-aligned square.- *- * @param {object} A graph node with at least a point (x, y) and a size.- * @return {object} A square: two points (x1, y1), (x2, y2) and height.- */- pointToSquare: function(n) {- return {- x1: n.x - n.size,- y1: n.y - n.size,- x2: n.x + n.size,- y2: n.y - n.size,- height: n.size * 2- };- },-- /**- * Checks whether a rectangle is axis-aligned.- *- * @param {object} A rectangle defined by two points- * (x1, y1) and (x2, y2).- * @return {boolean} True if the rectangle is axis-aligned.- */- isAxisAligned: function(r) {- return r.x1 === r.x2 || r.y1 === r.y2;- },-- /**- * Compute top points of an axis-aligned rectangle. This is useful in- * cases when the rectangle has been rotated (left, right or bottom up) and- * later operations need to know the top points.- *- * @param {object} An axis-aligned rectangle defined by two points- * (x1, y1), (x2, y2) and height.- * @return {object} A rectangle: two points (x1, y1), (x2, y2) and height.- */- axisAlignedTopPoints: function(r) {-- // Basic- if (r.y1 === r.y2 && r.x1 < r.x2)- return r;-- // Rotated to right- if (r.x1 === r.x2 && r.y2 > r.y1)- return {- x1: r.x1 - r.height, y1: r.y1,- x2: r.x1, y2: r.y1,- height: r.height- };-- // Rotated to left- if (r.x1 === r.x2 && r.y2 < r.y1)- return {- x1: r.x1, y1: r.y2,- x2: r.x2 + r.height, y2: r.y2,- height: r.height- };-- // Bottom's up- return {- x1: r.x2, y1: r.y1 - r.height,- x2: r.x1, y2: r.y1 - r.height,- height: r.height- };- },-- /**- * Get coordinates of a rectangle's lower left corner from its top points.- *- * @param {object} A rectangle defined by two points (x1, y1) and (x2, y2).- * @return {object} Coordinates of the corner (x, y).- */- lowerLeftCoor: function(r) {- var width = (- Math.sqrt(- Math.pow(r.x2 - r.x1, 2) +- Math.pow(r.y2 - r.y1, 2)- )- );-- return {- x: r.x1 - (r.y2 - r.y1) * r.height / width,- y: r.y1 + (r.x2 - r.x1) * r.height / width- };- },-- /**- * Get coordinates of a rectangle's lower right corner from its top points- * and its lower left corner.- *- * @param {object} A rectangle defined by two points (x1, y1) and (x2, y2).- * @param {object} A corner's coordinates (x, y).- * @return {object} Coordinates of the corner (x, y).- */- lowerRightCoor: function(r, llc) {- return {- x: llc.x - r.x1 + r.x2,- y: llc.y - r.y1 + r.y2- };- },-- /**- * Get the coordinates of all the corners of a rectangle from its top point.- *- * @param {object} A rectangle defined by two points (x1, y1) and (x2, y2).- * @return {array} An array of the four corners' coordinates (x, y).- */- rectangleCorners: function(r) {- var llc = this.lowerLeftCoor(r),- lrc = this.lowerRightCoor(r, llc);-- return [- {x: r.x1, y: r.y1},- {x: r.x2, y: r.y2},- {x: llc.x, y: llc.y},- {x: lrc.x, y: lrc.y}- ];- },-- /**- * Split a square defined by its boundaries into four.- *- * @param {object} Boundaries of the square (x, y, width, height).- * @return {array} An array containing the four new squares, themselves- * defined by an array of their four corners (x, y).- */- splitSquare: function(b) {- return [- [- {x: b.x, y: b.y},- {x: b.x + b.width / 2, y: b.y},- {x: b.x, y: b.y + b.height / 2},- {x: b.x + b.width / 2, y: b.y + b.height / 2}- ],- [- {x: b.x + b.width / 2, y: b.y},- {x: b.x + b.width, y: b.y},- {x: b.x + b.width / 2, y: b.y + b.height / 2},- {x: b.x + b.width, y: b.y + b.height / 2}- ],- [- {x: b.x, y: b.y + b.height / 2},- {x: b.x + b.width / 2, y: b.y + b.height / 2},- {x: b.x, y: b.y + b.height},- {x: b.x + b.width / 2, y: b.y + b.height}- ],- [- {x: b.x + b.width / 2, y: b.y + b.height / 2},- {x: b.x + b.width, y: b.y + b.height / 2},- {x: b.x + b.width / 2, y: b.y + b.height},- {x: b.x + b.width, y: b.y + b.height}- ]- ];- },-- /**- * Compute the four axis between corners of rectangle A and corners of- * rectangle B. This is needed later to check an eventual collision.- *- * @param {array} An array of rectangle A's four corners (x, y).- * @param {array} An array of rectangle B's four corners (x, y).- * @return {array} An array of four axis defined by their coordinates (x,y).- */- axis: function(c1, c2) {- return [- {x: c1[1].x - c1[0].x, y: c1[1].y - c1[0].y},- {x: c1[1].x - c1[3].x, y: c1[1].y - c1[3].y},- {x: c2[0].x - c2[2].x, y: c2[0].y - c2[2].y},- {x: c2[0].x - c2[1].x, y: c2[0].y - c2[1].y}- ];- },-- /**- * Project a rectangle's corner on an axis.- *- * @param {object} Coordinates of a corner (x, y).- * @param {object} Coordinates of an axis (x, y).- * @return {object} The projection defined by coordinates (x, y).- */- projection: function(c, a) {- var l = (- (c.x * a.x + c.y * a.y) /- (Math.pow(a.x, 2) + Math.pow(a.y, 2))- );-- return {- x: l * a.x,- y: l * a.y- };- },-- /**- * Check whether two rectangles collide on one particular axis.- *- * @param {object} An axis' coordinates (x, y).- * @param {array} Rectangle A's corners.- * @param {array} Rectangle B's corners.- * @return {boolean} True if the rectangles collide on the axis.- */- axisCollision: function(a, c1, c2) {- var sc1 = [],- sc2 = [];-- for (var ci = 0; ci < 4; ci++) {- var p1 = this.projection(c1[ci], a),- p2 = this.projection(c2[ci], a);-- sc1.push(p1.x * a.x + p1.y * a.y);- sc2.push(p2.x * a.x + p2.y * a.y);- }-- var maxc1 = Math.max.apply(Math, sc1),- maxc2 = Math.max.apply(Math, sc2),- minc1 = Math.min.apply(Math, sc1),- minc2 = Math.min.apply(Math, sc2);-- return (minc2 <= maxc1 && maxc2 >= minc1);- },-- /**- * Check whether two rectangles collide on each one of their four axis. If- * all axis collide, then the two rectangles do collide on the plane.- *- * @param {array} Rectangle A's corners.- * @param {array} Rectangle B's corners.- * @return {boolean} True if the rectangles collide.- */- collision: function(c1, c2) {- var axis = this.axis(c1, c2),- col = true;-- for (var i = 0; i < 4; i++)- col = col && this.axisCollision(axis[i], c1, c2);-- return col;- }- };--- /**- * Quad Functions- * ------------- *- * The Quadtree functions themselves.- * For each of those functions, we consider that in a splitted quad, the- * index of each node is the following:- * 0: top left- * 1: top right- * 2: bottom left- * 3: bottom right- *- * Moreover, the hereafter quad's philosophy is to consider that if an element- * collides with more than one nodes, this element belongs to each of the- * nodes it collides with where other would let it lie on a higher node.- */-- /**- * Get the index of the node containing the point in the quad- *- * @param {object} point A point defined by coordinates (x, y).- * @param {object} quadBounds Boundaries of the quad (x, y, width, heigth).- * @return {integer} The index of the node containing the point.- */- function _quadIndex(point, quadBounds) {- var xmp = quadBounds.x + quadBounds.width / 2,- ymp = quadBounds.y + quadBounds.height / 2,- top = (point.y < ymp),- left = (point.x < xmp);-- if (top) {- if (left)- return 0;- else- return 1;- }- else {- if (left)- return 2;- else- return 3;- }- }-- /**- * Get a list of indexes of nodes containing an axis-aligned rectangle- *- * @param {object} rectangle A rectangle defined by two points (x1, y1),- * (x2, y2) and height.- * @param {array} quadCorners An array of the quad nodes' corners.- * @return {array} An array of indexes containing one to- * four integers.- */- function _quadIndexes(rectangle, quadCorners) {- var indexes = [];-- // Iterating through quads- for (var i = 0; i < 4; i++)- if ((rectangle.x2 >= quadCorners[i][0].x) &&- (rectangle.x1 <= quadCorners[i][1].x) &&- (rectangle.y1 + rectangle.height >= quadCorners[i][0].y) &&- (rectangle.y1 <= quadCorners[i][2].y))- indexes.push(i);-- return indexes;- }-- /**- * Get a list of indexes of nodes containing a non-axis-aligned rectangle- *- * @param {array} corners An array containing each corner of the- * rectangle defined by its coordinates (x, y).- * @param {array} quadCorners An array of the quad nodes' corners.- * @return {array} An array of indexes containing one to- * four integers.- */- function _quadCollision(corners, quadCorners) {- var indexes = [];-- // Iterating through quads- for (var i = 0; i < 4; i++)- if (_geom.collision(corners, quadCorners[i]))- indexes.push(i);-- return indexes;- }-- /**- * Subdivide a quad by creating a node at a precise index. The function does- * not generate all four nodes not to potentially create unused nodes.- *- * @param {integer} index The index of the node to create.- * @param {object} quad The quad object to subdivide.- * @return {object} A new quad representing the node created.- */- function _quadSubdivide(index, quad) {- var next = quad.level + 1,- subw = Math.round(quad.bounds.width / 2),- subh = Math.round(quad.bounds.height / 2),- qx = Math.round(quad.bounds.x),- qy = Math.round(quad.bounds.y),- x,- y;-- switch (index) {- case 0:- x = qx;- y = qy;- break;- case 1:- x = qx + subw;- y = qy;- break;- case 2:- x = qx;- y = qy + subh;- break;- case 3:- x = qx + subw;- y = qy + subh;- break;- }-- return _quadTree(- {x: x, y: y, width: subw, height: subh},- next,- quad.maxElements,- quad.maxLevel- );- }-- /**- * Recursively insert an element into the quadtree. Only points- * with size, i.e. axis-aligned squares, may be inserted with this- * method.- *- * @param {object} el The element to insert in the quadtree.- * @param {object} sizedPoint A sized point defined by two top points- * (x1, y1), (x2, y2) and height.- * @param {object} quad The quad in which to insert the element.- * @return {undefined} The function does not return anything.- */- function _quadInsert(el, sizedPoint, quad) {- if (quad.level < quad.maxLevel) {-- // Searching appropriate quads- var indexes = _quadIndexes(sizedPoint, quad.corners);-- // Iterating- for (var i = 0, l = indexes.length; i < l; i++) {-- // Subdividing if necessary- if (quad.nodes[indexes[i]] === undefined)- quad.nodes[indexes[i]] = _quadSubdivide(indexes[i], quad);-- // Recursion- _quadInsert(el, sizedPoint, quad.nodes[indexes[i]]);- }- }- else {-- // Pushing the element in a leaf node- quad.elements.push(el);- }- }-- /**- * Recursively retrieve every elements held by the node containing the- * searched point.- *- * @param {object} point The searched point (x, y).- * @param {object} quad The searched quad.- * @return {array} An array of elements contained in the relevant- * node.- */- function _quadRetrievePoint(point, quad) {- if (quad.level < quad.maxLevel) {- var index = _quadIndex(point, quad.bounds);-- // If node does not exist we return an empty list- if (quad.nodes[index] !== undefined) {- return _quadRetrievePoint(point, quad.nodes[index]);- }- else {- return [];- }- }- else {- return quad.elements;- }- }-- /**- * Recursively retrieve every elements contained within an rectangular area- * that may or may not be axis-aligned.- *- * @param {object|array} rectData The searched area defined either by- * an array of four corners (x, y) in- * the case of a non-axis-aligned- * rectangle or an object with two top- * points (x1, y1), (x2, y2) and height.- * @param {object} quad The searched quad.- * @param {function} collisionFunc The collision function used to search- * for node indexes.- * @param {array?} els The retrieved elements.- * @return {array} An array of elements contained in the- * area.- */- function _quadRetrieveArea(rectData, quad, collisionFunc, els) {- els = els || {};-- if (quad.level < quad.maxLevel) {- var indexes = collisionFunc(rectData, quad.corners);-- for (var i = 0, l = indexes.length; i < l; i++)- if (quad.nodes[indexes[i]] !== undefined)- _quadRetrieveArea(- rectData,- quad.nodes[indexes[i]],- collisionFunc,- els- );- } else- for (var j = 0, m = quad.elements.length; j < m; j++)- if (els[quad.elements[j].id] === undefined)- els[quad.elements[j].id] = quad.elements[j];-- return els;- }-- /**- * Creates the quadtree object itself.- *- * @param {object} bounds The boundaries of the quad defined by an- * origin (x, y), width and heigth.- * @param {integer} level The level of the quad in the tree.- * @param {integer} maxElements The max number of element in a leaf node.- * @param {integer} maxLevel The max recursion level of the tree.- * @return {object} The quadtree object.- */- function _quadTree(bounds, level, maxElements, maxLevel) {- return {- level: level || 0,- bounds: bounds,- corners: _geom.splitSquare(bounds),- maxElements: maxElements || 20,- maxLevel: maxLevel || 4,- elements: [],- nodes: []- };- }--- /**- * Sigma Quad Constructor- * ----------------------- *- * The quad API as exposed to sigma.- */-- /**- * The quad core that will become the sigma interface with the quadtree.- *- * property {object} _tree Property holding the quadtree object.- * property {object} _geom Exposition of the _geom namespace for testing.- * property {object} _cache Cache for the area method.- */- var quad = function() {- this._geom = _geom;- this._tree = null;- this._cache = {- query: false,- result: false- };- };-- /**- * Index a graph by inserting its nodes into the quadtree.- *- * @param {array} nodes An array of nodes to index.- * @param {object} params An object of parameters with at least the quad- * bounds.- * @return {object} The quadtree object.- *- * Parameters:- * ----------- * bounds: {object} boundaries of the quad defined by its origin (x, y)- * width and heigth.- * prefix: {string?} a prefix for node geometric attributes.- * maxElements: {integer?} the max number of elements in a leaf node.- * maxLevel: {integer?} the max recursion level of the tree.- */- quad.prototype.index = function(nodes, params) {-- // Enforcing presence of boundaries- if (!params.bounds)- throw 'sigma.classes.quad.index: bounds information not given.';-- // Prefix- var prefix = params.prefix || '';-- // Building the tree- this._tree = _quadTree(- params.bounds,- 0,- params.maxElements,- params.maxLevel- );-- // Inserting graph nodes into the tree- for (var i = 0, l = nodes.length; i < l; i++) {-- // Inserting node- _quadInsert(- nodes[i],- _geom.pointToSquare({- x: nodes[i][prefix + 'x'],- y: nodes[i][prefix + 'y'],- size: nodes[i][prefix + 'size']- }),- this._tree- );- }-- // Reset cache:- this._cache = {- query: false,- result: false- };-- // remove?- return this._tree;- };-- /**- * Retrieve every graph nodes held by the quadtree node containing the- * searched point.- *- * @param {number} x of the point.- * @param {number} y of the point.- * @return {array} An array of nodes retrieved.- */- quad.prototype.point = function(x, y) {- return this._tree ?- _quadRetrievePoint({x: x, y: y}, this._tree) || [] :- [];- };-- /**- * Retrieve every graph nodes within a rectangular area. The methods keep the- * last area queried in cache for optimization reason and will act differently- * for the same reason if the area is axis-aligned or not.- *- * @param {object} A rectangle defined by two top points (x1, y1), (x2, y2)- * and height.- * @return {array} An array of nodes retrieved.- */- quad.prototype.area = function(rect) {- var serialized = JSON.stringify(rect),- collisionFunc,- rectData;-- // Returning cache?- if (this._cache.query === serialized)- return this._cache.result;-- // Axis aligned ?- if (_geom.isAxisAligned(rect)) {- collisionFunc = _quadIndexes;- rectData = _geom.axisAlignedTopPoints(rect);- }- else {- collisionFunc = _quadCollision;- rectData = _geom.rectangleCorners(rect);- }-- // Retrieving nodes- var nodes = this._tree ?- _quadRetrieveArea(- rectData,- this._tree,- collisionFunc- ) :- [];-- // Object to array- var nodesArray = [];- for (var i in nodes)- nodesArray.push(nodes[i]);-- // Caching- this._cache.query = serialized;- this._cache.result = nodesArray;-- return nodesArray;- };--- /**- * EXPORT:- * *******- */- if (typeof this.sigma !== 'undefined') {- this.sigma.classes = this.sigma.classes || {};- this.sigma.classes.quad = quad;- } else if (typeof exports !== 'undefined') {- if (typeof module !== 'undefined' && module.exports)- exports = module.exports = quad;- exports.quad = quad;- } else- this.quad = quad;-}).call(this);--;(function(undefined) {- 'use strict';-- /**- * Sigma Quadtree Module for edges- * ===============================- *- * Author: Sébastien Heymann,- * from the quad of Guillaume Plique (Yomguithereal)- * Version: 0.2- */---- /**- * Quad Geometric Operations- * -------------------------- *- * A useful batch of geometric operations used by the quadtree.- */-- var _geom = {-- /**- * Transforms a graph node with x, y and size into an- * axis-aligned square.- *- * @param {object} A graph node with at least a point (x, y) and a size.- * @return {object} A square: two points (x1, y1), (x2, y2) and height.- */- pointToSquare: function(n) {- return {- x1: n.x - n.size,- y1: n.y - n.size,- x2: n.x + n.size,- y2: n.y - n.size,- height: n.size * 2- };- },-- /**- * Transforms a graph edge with x1, y1, x2, y2 and size into an- * axis-aligned square.- *- * @param {object} A graph edge with at least two points- * (x1, y1), (x2, y2) and a size.- * @return {object} A square: two points (x1, y1), (x2, y2) and height.- */- lineToSquare: function(e) {- if (e.y1 < e.y2) {- // (e.x1, e.y1) on top- if (e.x1 < e.x2) {- // (e.x1, e.y1) on left- return {- x1: e.x1 - e.size,- y1: e.y1 - e.size,- x2: e.x2 + e.size,- y2: e.y1 - e.size,- height: e.y2 - e.y1 + e.size * 2- };- }- // (e.x1, e.y1) on right- return {- x1: e.x2 - e.size,- y1: e.y1 - e.size,- x2: e.x1 + e.size,- y2: e.y1 - e.size,- height: e.y2 - e.y1 + e.size * 2- };- }-- // (e.x2, e.y2) on top- if (e.x1 < e.x2) {- // (e.x1, e.y1) on left- return {- x1: e.x1 - e.size,- y1: e.y2 - e.size,- x2: e.x2 + e.size,- y2: e.y2 - e.size,- height: e.y1 - e.y2 + e.size * 2- };- }- // (e.x2, e.y2) on right- return {- x1: e.x2 - e.size,- y1: e.y2 - e.size,- x2: e.x1 + e.size,- y2: e.y2 - e.size,- height: e.y1 - e.y2 + e.size * 2- };- },-- /**- * Transforms a graph edge of type 'curve' with x1, y1, x2, y2,- * control point and size into an axis-aligned square.- *- * @param {object} e A graph edge with at least two points- * (x1, y1), (x2, y2) and a size.- * @param {object} cp A control point (x,y).- * @return {object} A square: two points (x1, y1), (x2, y2) and height.- */- quadraticCurveToSquare: function(e, cp) {- var pt = sigma.utils.getPointOnQuadraticCurve(- 0.5,- e.x1,- e.y1,- e.x2,- e.y2,- cp.x,- cp.y- );-- // Bounding box of the two points and the point at the middle of the- // curve:- var minX = Math.min(e.x1, e.x2, pt.x),- maxX = Math.max(e.x1, e.x2, pt.x),- minY = Math.min(e.y1, e.y2, pt.y),- maxY = Math.max(e.y1, e.y2, pt.y);-- return {- x1: minX - e.size,- y1: minY - e.size,- x2: maxX + e.size,- y2: minY - e.size,- height: maxY - minY + e.size * 2- };- },-- /**- * Transforms a graph self loop into an axis-aligned square.- *- * @param {object} n A graph node with a point (x, y) and a size.- * @return {object} A square: two points (x1, y1), (x2, y2) and height.- */- selfLoopToSquare: function(n) {- // Fitting to the curve is too costly, we compute a larger bounding box- // using the control points:- var cp = sigma.utils.getSelfLoopControlPoints(n.x, n.y, n.size);-- // Bounding box of the point and the two control points:- var minX = Math.min(n.x, cp.x1, cp.x2),- maxX = Math.max(n.x, cp.x1, cp.x2),- minY = Math.min(n.y, cp.y1, cp.y2),- maxY = Math.max(n.y, cp.y1, cp.y2);-- return {- x1: minX - n.size,- y1: minY - n.size,- x2: maxX + n.size,- y2: minY - n.size,- height: maxY - minY + n.size * 2- };- },-- /**- * Checks whether a rectangle is axis-aligned.- *- * @param {object} A rectangle defined by two points- * (x1, y1) and (x2, y2).- * @return {boolean} True if the rectangle is axis-aligned.- */- isAxisAligned: function(r) {- return r.x1 === r.x2 || r.y1 === r.y2;- },-- /**- * Compute top points of an axis-aligned rectangle. This is useful in- * cases when the rectangle has been rotated (left, right or bottom up) and- * later operations need to know the top points.- *- * @param {object} An axis-aligned rectangle defined by two points- * (x1, y1), (x2, y2) and height.- * @return {object} A rectangle: two points (x1, y1), (x2, y2) and height.- */- axisAlignedTopPoints: function(r) {-- // Basic- if (r.y1 === r.y2 && r.x1 < r.x2)- return r;-- // Rotated to right- if (r.x1 === r.x2 && r.y2 > r.y1)- return {- x1: r.x1 - r.height, y1: r.y1,- x2: r.x1, y2: r.y1,- height: r.height- };-- // Rotated to left- if (r.x1 === r.x2 && r.y2 < r.y1)- return {- x1: r.x1, y1: r.y2,- x2: r.x2 + r.height, y2: r.y2,- height: r.height- };-- // Bottom's up- return {- x1: r.x2, y1: r.y1 - r.height,- x2: r.x1, y2: r.y1 - r.height,- height: r.height- };- },-- /**- * Get coordinates of a rectangle's lower left corner from its top points.- *- * @param {object} A rectangle defined by two points (x1, y1) and (x2, y2).- * @return {object} Coordinates of the corner (x, y).- */- lowerLeftCoor: function(r) {- var width = (- Math.sqrt(- Math.pow(r.x2 - r.x1, 2) +- Math.pow(r.y2 - r.y1, 2)- )- );-- return {- x: r.x1 - (r.y2 - r.y1) * r.height / width,- y: r.y1 + (r.x2 - r.x1) * r.height / width- };- },-- /**- * Get coordinates of a rectangle's lower right corner from its top points- * and its lower left corner.- *- * @param {object} A rectangle defined by two points (x1, y1) and (x2, y2).- * @param {object} A corner's coordinates (x, y).- * @return {object} Coordinates of the corner (x, y).- */- lowerRightCoor: function(r, llc) {- return {- x: llc.x - r.x1 + r.x2,- y: llc.y - r.y1 + r.y2- };- },-- /**- * Get the coordinates of all the corners of a rectangle from its top point.- *- * @param {object} A rectangle defined by two points (x1, y1) and (x2, y2).- * @return {array} An array of the four corners' coordinates (x, y).- */- rectangleCorners: function(r) {- var llc = this.lowerLeftCoor(r),- lrc = this.lowerRightCoor(r, llc);-- return [- {x: r.x1, y: r.y1},- {x: r.x2, y: r.y2},- {x: llc.x, y: llc.y},- {x: lrc.x, y: lrc.y}- ];- },-- /**- * Split a square defined by its boundaries into four.- *- * @param {object} Boundaries of the square (x, y, width, height).- * @return {array} An array containing the four new squares, themselves- * defined by an array of their four corners (x, y).- */- splitSquare: function(b) {- return [- [- {x: b.x, y: b.y},- {x: b.x + b.width / 2, y: b.y},- {x: b.x, y: b.y + b.height / 2},- {x: b.x + b.width / 2, y: b.y + b.height / 2}- ],- [- {x: b.x + b.width / 2, y: b.y},- {x: b.x + b.width, y: b.y},- {x: b.x + b.width / 2, y: b.y + b.height / 2},- {x: b.x + b.width, y: b.y + b.height / 2}- ],- [- {x: b.x, y: b.y + b.height / 2},- {x: b.x + b.width / 2, y: b.y + b.height / 2},- {x: b.x, y: b.y + b.height},- {x: b.x + b.width / 2, y: b.y + b.height}- ],- [- {x: b.x + b.width / 2, y: b.y + b.height / 2},- {x: b.x + b.width, y: b.y + b.height / 2},- {x: b.x + b.width / 2, y: b.y + b.height},- {x: b.x + b.width, y: b.y + b.height}- ]- ];- },-- /**- * Compute the four axis between corners of rectangle A and corners of- * rectangle B. This is needed later to check an eventual collision.- *- * @param {array} An array of rectangle A's four corners (x, y).- * @param {array} An array of rectangle B's four corners (x, y).- * @return {array} An array of four axis defined by their coordinates (x,y).- */- axis: function(c1, c2) {- return [- {x: c1[1].x - c1[0].x, y: c1[1].y - c1[0].y},- {x: c1[1].x - c1[3].x, y: c1[1].y - c1[3].y},- {x: c2[0].x - c2[2].x, y: c2[0].y - c2[2].y},- {x: c2[0].x - c2[1].x, y: c2[0].y - c2[1].y}- ];- },-- /**- * Project a rectangle's corner on an axis.- *- * @param {object} Coordinates of a corner (x, y).- * @param {object} Coordinates of an axis (x, y).- * @return {object} The projection defined by coordinates (x, y).- */- projection: function(c, a) {- var l = (- (c.x * a.x + c.y * a.y) /- (Math.pow(a.x, 2) + Math.pow(a.y, 2))- );-- return {- x: l * a.x,- y: l * a.y- };- },-- /**- * Check whether two rectangles collide on one particular axis.- *- * @param {object} An axis' coordinates (x, y).- * @param {array} Rectangle A's corners.- * @param {array} Rectangle B's corners.- * @return {boolean} True if the rectangles collide on the axis.- */- axisCollision: function(a, c1, c2) {- var sc1 = [],- sc2 = [];-- for (var ci = 0; ci < 4; ci++) {- var p1 = this.projection(c1[ci], a),- p2 = this.projection(c2[ci], a);-- sc1.push(p1.x * a.x + p1.y * a.y);- sc2.push(p2.x * a.x + p2.y * a.y);- }-- var maxc1 = Math.max.apply(Math, sc1),- maxc2 = Math.max.apply(Math, sc2),- minc1 = Math.min.apply(Math, sc1),- minc2 = Math.min.apply(Math, sc2);-- return (minc2 <= maxc1 && maxc2 >= minc1);- },-- /**- * Check whether two rectangles collide on each one of their four axis. If- * all axis collide, then the two rectangles do collide on the plane.- *- * @param {array} Rectangle A's corners.- * @param {array} Rectangle B's corners.- * @return {boolean} True if the rectangles collide.- */- collision: function(c1, c2) {- var axis = this.axis(c1, c2),- col = true;-- for (var i = 0; i < 4; i++)- col = col && this.axisCollision(axis[i], c1, c2);-- return col;- }- };--- /**- * Quad Functions- * ------------- *- * The Quadtree functions themselves.- * For each of those functions, we consider that in a splitted quad, the- * index of each node is the following:- * 0: top left- * 1: top right- * 2: bottom left- * 3: bottom right- *- * Moreover, the hereafter quad's philosophy is to consider that if an element- * collides with more than one nodes, this element belongs to each of the- * nodes it collides with where other would let it lie on a higher node.- */-- /**- * Get the index of the node containing the point in the quad- *- * @param {object} point A point defined by coordinates (x, y).- * @param {object} quadBounds Boundaries of the quad (x, y, width, heigth).- * @return {integer} The index of the node containing the point.- */- function _quadIndex(point, quadBounds) {- var xmp = quadBounds.x + quadBounds.width / 2,- ymp = quadBounds.y + quadBounds.height / 2,- top = (point.y < ymp),- left = (point.x < xmp);-- if (top) {- if (left)- return 0;- else- return 1;- }- else {- if (left)- return 2;- else- return 3;- }- }-- /**- * Get a list of indexes of nodes containing an axis-aligned rectangle- *- * @param {object} rectangle A rectangle defined by two points (x1, y1),- * (x2, y2) and height.- * @param {array} quadCorners An array of the quad nodes' corners.- * @return {array} An array of indexes containing one to- * four integers.- */- function _quadIndexes(rectangle, quadCorners) {- var indexes = [];-- // Iterating through quads- for (var i = 0; i < 4; i++)- if ((rectangle.x2 >= quadCorners[i][0].x) &&- (rectangle.x1 <= quadCorners[i][1].x) &&- (rectangle.y1 + rectangle.height >= quadCorners[i][0].y) &&- (rectangle.y1 <= quadCorners[i][2].y))- indexes.push(i);-- return indexes;- }-- /**- * Get a list of indexes of nodes containing a non-axis-aligned rectangle- *- * @param {array} corners An array containing each corner of the- * rectangle defined by its coordinates (x, y).- * @param {array} quadCorners An array of the quad nodes' corners.- * @return {array} An array of indexes containing one to- * four integers.- */- function _quadCollision(corners, quadCorners) {- var indexes = [];-- // Iterating through quads- for (var i = 0; i < 4; i++)- if (_geom.collision(corners, quadCorners[i]))- indexes.push(i);-- return indexes;- }-- /**- * Subdivide a quad by creating a node at a precise index. The function does- * not generate all four nodes not to potentially create unused nodes.- *- * @param {integer} index The index of the node to create.- * @param {object} quad The quad object to subdivide.- * @return {object} A new quad representing the node created.- */- function _quadSubdivide(index, quad) {- var next = quad.level + 1,- subw = Math.round(quad.bounds.width / 2),- subh = Math.round(quad.bounds.height / 2),- qx = Math.round(quad.bounds.x),- qy = Math.round(quad.bounds.y),- x,- y;-- switch (index) {- case 0:- x = qx;- y = qy;- break;- case 1:- x = qx + subw;- y = qy;- break;- case 2:- x = qx;- y = qy + subh;- break;- case 3:- x = qx + subw;- y = qy + subh;- break;- }-- return _quadTree(- {x: x, y: y, width: subw, height: subh},- next,- quad.maxElements,- quad.maxLevel- );- }-- /**- * Recursively insert an element into the quadtree. Only points- * with size, i.e. axis-aligned squares, may be inserted with this- * method.- *- * @param {object} el The element to insert in the quadtree.- * @param {object} sizedPoint A sized point defined by two top points- * (x1, y1), (x2, y2) and height.- * @param {object} quad The quad in which to insert the element.- * @return {undefined} The function does not return anything.- */- function _quadInsert(el, sizedPoint, quad) {- if (quad.level < quad.maxLevel) {-- // Searching appropriate quads- var indexes = _quadIndexes(sizedPoint, quad.corners);-- // Iterating- for (var i = 0, l = indexes.length; i < l; i++) {-- // Subdividing if necessary- if (quad.nodes[indexes[i]] === undefined)- quad.nodes[indexes[i]] = _quadSubdivide(indexes[i], quad);-- // Recursion- _quadInsert(el, sizedPoint, quad.nodes[indexes[i]]);- }- }- else {-- // Pushing the element in a leaf node- quad.elements.push(el);- }- }-- /**- * Recursively retrieve every elements held by the node containing the- * searched point.- *- * @param {object} point The searched point (x, y).- * @param {object} quad The searched quad.- * @return {array} An array of elements contained in the relevant- * node.- */- function _quadRetrievePoint(point, quad) {- if (quad.level < quad.maxLevel) {- var index = _quadIndex(point, quad.bounds);-- // If node does not exist we return an empty list- if (quad.nodes[index] !== undefined) {- return _quadRetrievePoint(point, quad.nodes[index]);- }- else {- return [];- }- }- else {- return quad.elements;- }- }-- /**- * Recursively retrieve every elements contained within an rectangular area- * that may or may not be axis-aligned.- *- * @param {object|array} rectData The searched area defined either by- * an array of four corners (x, y) in- * the case of a non-axis-aligned- * rectangle or an object with two top- * points (x1, y1), (x2, y2) and height.- * @param {object} quad The searched quad.- * @param {function} collisionFunc The collision function used to search- * for node indexes.- * @param {array?} els The retrieved elements.- * @return {array} An array of elements contained in the- * area.- */- function _quadRetrieveArea(rectData, quad, collisionFunc, els) {- els = els || {};-- if (quad.level < quad.maxLevel) {- var indexes = collisionFunc(rectData, quad.corners);-- for (var i = 0, l = indexes.length; i < l; i++)- if (quad.nodes[indexes[i]] !== undefined)- _quadRetrieveArea(- rectData,- quad.nodes[indexes[i]],- collisionFunc,- els- );- } else- for (var j = 0, m = quad.elements.length; j < m; j++)- if (els[quad.elements[j].id] === undefined)- els[quad.elements[j].id] = quad.elements[j];-- return els;- }-- /**- * Creates the quadtree object itself.- *- * @param {object} bounds The boundaries of the quad defined by an- * origin (x, y), width and heigth.- * @param {integer} level The level of the quad in the tree.- * @param {integer} maxElements The max number of element in a leaf node.- * @param {integer} maxLevel The max recursion level of the tree.- * @return {object} The quadtree object.- */- function _quadTree(bounds, level, maxElements, maxLevel) {- return {- level: level || 0,- bounds: bounds,- corners: _geom.splitSquare(bounds),- maxElements: maxElements || 40,- maxLevel: maxLevel || 8,- elements: [],- nodes: []- };- }--- /**- * Sigma Quad Constructor- * ----------------------- *- * The edgequad API as exposed to sigma.- */-- /**- * The edgequad core that will become the sigma interface with the quadtree.- *- * property {object} _tree Property holding the quadtree object.- * property {object} _geom Exposition of the _geom namespace for testing.- * property {object} _cache Cache for the area method.- * property {boolean} _enabled Can index and retreive elements.- */- var edgequad = function() {- this._geom = _geom;- this._tree = null;- this._cache = {- query: false,- result: false- };- this._enabled = true;- };-- /**- * Index a graph by inserting its edges into the quadtree.- *- * @param {object} graph A graph instance.- * @param {object} params An object of parameters with at least the quad- * bounds.- * @return {object} The quadtree object.- *- * Parameters:- * ----------- * bounds: {object} boundaries of the quad defined by its origin (x, y)- * width and heigth.- * prefix: {string?} a prefix for edge geometric attributes.- * maxElements: {integer?} the max number of elements in a leaf node.- * maxLevel: {integer?} the max recursion level of the tree.- */- edgequad.prototype.index = function(graph, params) {- if (!this._enabled)- return this._tree;-- // Enforcing presence of boundaries- if (!params.bounds)- throw 'sigma.classes.edgequad.index: bounds information not given.';-- // Prefix- var prefix = params.prefix || '',- cp,- source,- target,- n,- e;-- // Building the tree- this._tree = _quadTree(- params.bounds,- 0,- params.maxElements,- params.maxLevel- );-- var edges = graph.edges();-- // Inserting graph edges into the tree- for (var i = 0, l = edges.length; i < l; i++) {- source = graph.nodes(edges[i].source);- target = graph.nodes(edges[i].target);- e = {- x1: source[prefix + 'x'],- y1: source[prefix + 'y'],- x2: target[prefix + 'x'],- y2: target[prefix + 'y'],- size: edges[i][prefix + 'size'] || 0- };-- // Inserting edge- if (edges[i].type === 'curve' || edges[i].type === 'curvedArrow') {- if (source.id === target.id) {- n = {- x: source[prefix + 'x'],- y: source[prefix + 'y'],- size: source[prefix + 'size'] || 0- };- _quadInsert(- edges[i],- _geom.selfLoopToSquare(n),- this._tree);- }- else {- cp = sigma.utils.getQuadraticControlPoint(e.x1, e.y1, e.x2, e.y2);- _quadInsert(- edges[i],- _geom.quadraticCurveToSquare(e, cp),- this._tree);- }- }- else {- _quadInsert(- edges[i],- _geom.lineToSquare(e),- this._tree);- }- }-- // Reset cache:- this._cache = {- query: false,- result: false- };-- // remove?- return this._tree;- };-- /**- * Retrieve every graph edges held by the quadtree node containing the- * searched point.- *- * @param {number} x of the point.- * @param {number} y of the point.- * @return {array} An array of edges retrieved.- */- edgequad.prototype.point = function(x, y) {- if (!this._enabled)- return [];-- return this._tree ?- _quadRetrievePoint({x: x, y: y}, this._tree) || [] :- [];- };-- /**- * Retrieve every graph edges within a rectangular area. The methods keep the- * last area queried in cache for optimization reason and will act differently- * for the same reason if the area is axis-aligned or not.- *- * @param {object} A rectangle defined by two top points (x1, y1), (x2, y2)- * and height.- * @return {array} An array of edges retrieved.- */- edgequad.prototype.area = function(rect) {- if (!this._enabled)- return [];-- var serialized = JSON.stringify(rect),- collisionFunc,- rectData;-- // Returning cache?- if (this._cache.query === serialized)- return this._cache.result;-- // Axis aligned ?- if (_geom.isAxisAligned(rect)) {- collisionFunc = _quadIndexes;- rectData = _geom.axisAlignedTopPoints(rect);- }- else {- collisionFunc = _quadCollision;- rectData = _geom.rectangleCorners(rect);- }-- // Retrieving edges- var edges = this._tree ?- _quadRetrieveArea(- rectData,- this._tree,- collisionFunc- ) :- [];-- // Object to array- var edgesArray = [];- for (var i in edges)- edgesArray.push(edges[i]);-- // Caching- this._cache.query = serialized;- this._cache.result = edgesArray;-- return edgesArray;- };--- /**- * EXPORT:- * *******- */- if (typeof this.sigma !== 'undefined') {- this.sigma.classes = this.sigma.classes || {};- this.sigma.classes.edgequad = edgequad;- } else if (typeof exports !== 'undefined') {- if (typeof module !== 'undefined' && module.exports)- exports = module.exports = edgequad;- exports.edgequad = edgequad;- } else- this.edgequad = edgequad;-}).call(this);--;(function(undefined) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- // Initialize packages:- sigma.utils.pkg('sigma.captors');-- /**- * The user inputs default captor. It deals with mouse events, keyboards- * events and touch events.- *- * @param {DOMElement} target The DOM element where the listeners will be- * bound.- * @param {camera} camera The camera related to the target.- * @param {configurable} settings The settings function.- * @return {sigma.captor} The fresh new captor instance.- */- sigma.captors.mouse = function(target, camera, settings) {- var _self = this,- _target = target,- _camera = camera,- _settings = settings,-- // CAMERA MANAGEMENT:- // ******************- // The camera position when the user starts dragging:- _startCameraX,- _startCameraY,- _startCameraAngle,-- // The latest stage position:- _lastCameraX,- _lastCameraY,- _lastCameraAngle,- _lastCameraRatio,-- // MOUSE MANAGEMENT:- // *****************- // The mouse position when the user starts dragging:- _startMouseX,- _startMouseY,-- _isMouseDown,- _isMoving,- _hasDragged,- _downStartTime,- _movingTimeoutId;-- sigma.classes.dispatcher.extend(this);-- sigma.utils.doubleClick(_target, 'click', _doubleClickHandler);- _target.addEventListener('DOMMouseScroll', _wheelHandler, false);- _target.addEventListener('mousewheel', _wheelHandler, false);- _target.addEventListener('mousemove', _moveHandler, false);- _target.addEventListener('mousedown', _downHandler, false);- _target.addEventListener('click', _clickHandler, false);- _target.addEventListener('mouseout', _outHandler, false);- document.addEventListener('mouseup', _upHandler, false);----- /**- * This method unbinds every handlers that makes the captor work.- */- this.kill = function() {- sigma.utils.unbindDoubleClick(_target, 'click');- _target.removeEventListener('DOMMouseScroll', _wheelHandler);- _target.removeEventListener('mousewheel', _wheelHandler);- _target.removeEventListener('mousemove', _moveHandler);- _target.removeEventListener('mousedown', _downHandler);- _target.removeEventListener('click', _clickHandler);- _target.removeEventListener('mouseout', _outHandler);- document.removeEventListener('mouseup', _upHandler);- };----- // MOUSE EVENTS:- // *************-- /**- * The handler listening to the 'move' mouse event. It will effectively- * drag the graph.- *- * @param {event} e A mouse event.- */- function _moveHandler(e) {- var x,- y,- pos;-- // Dispatch event:- if (_settings('mouseEnabled'))- _self.dispatchEvent('mousemove', {- x: sigma.utils.getX(e) - sigma.utils.getWidth(e) / 2,- y: sigma.utils.getY(e) - sigma.utils.getHeight(e) / 2,- clientX: e.clientX,- clientY: e.clientY,- ctrlKey: e.ctrlKey,- metaKey: e.metaKey,- altKey: e.altKey,- shiftKey: e.shiftKey- });-- if (_settings('mouseEnabled') && _isMouseDown) {- _isMoving = true;- _hasDragged = true;-- if (_movingTimeoutId)- clearTimeout(_movingTimeoutId);-- _movingTimeoutId = setTimeout(function() {- _isMoving = false;- }, _settings('dragTimeout'));-- sigma.misc.animation.killAll(_camera);-- _camera.isMoving = true;- pos = _camera.cameraPosition(- sigma.utils.getX(e) - _startMouseX,- sigma.utils.getY(e) - _startMouseY,- true- );-- x = _startCameraX - pos.x;- y = _startCameraY - pos.y;-- if (x !== _camera.x || y !== _camera.y) {- _lastCameraX = _camera.x;- _lastCameraY = _camera.y;-- _camera.goTo({- x: x,- y: y- });- }-- if (e.preventDefault)- e.preventDefault();- else- e.returnValue = false;-- e.stopPropagation();- return false;- }- }-- /**- * The handler listening to the 'up' mouse event. It will stop dragging the- * graph.- *- * @param {event} e A mouse event.- */- function _upHandler(e) {- if (_settings('mouseEnabled') && _isMouseDown) {- _isMouseDown = false;- if (_movingTimeoutId)- clearTimeout(_movingTimeoutId);-- _camera.isMoving = false;-- var x = sigma.utils.getX(e),- y = sigma.utils.getY(e);-- if (_isMoving) {- sigma.misc.animation.killAll(_camera);- sigma.misc.animation.camera(- _camera,- {- x: _camera.x +- _settings('mouseInertiaRatio') * (_camera.x - _lastCameraX),- y: _camera.y +- _settings('mouseInertiaRatio') * (_camera.y - _lastCameraY)- },- {- easing: 'quadraticOut',- duration: _settings('mouseInertiaDuration')- }- );- } else if (- _startMouseX !== x ||- _startMouseY !== y- )- _camera.goTo({- x: _camera.x,- y: _camera.y- });-- _self.dispatchEvent('mouseup', {- x: x - sigma.utils.getWidth(e) / 2,- y: y - sigma.utils.getHeight(e) / 2,- clientX: e.clientX,- clientY: e.clientY,- ctrlKey: e.ctrlKey,- metaKey: e.metaKey,- altKey: e.altKey,- shiftKey: e.shiftKey- });-- // Update _isMoving flag:- _isMoving = false;- }- }-- /**- * The handler listening to the 'down' mouse event. It will start observing- * the mouse position for dragging the graph.- *- * @param {event} e A mouse event.- */- function _downHandler(e) {- if (_settings('mouseEnabled')) {- _startCameraX = _camera.x;- _startCameraY = _camera.y;-- _lastCameraX = _camera.x;- _lastCameraY = _camera.y;-- _startMouseX = sigma.utils.getX(e);- _startMouseY = sigma.utils.getY(e);-- _hasDragged = false;- _downStartTime = (new Date()).getTime();-- switch (e.which) {- case 2:- // Middle mouse button pressed- // Do nothing.- break;- case 3:- // Right mouse button pressed- _self.dispatchEvent('rightclick', {- x: _startMouseX - sigma.utils.getWidth(e) / 2,- y: _startMouseY - sigma.utils.getHeight(e) / 2,- clientX: e.clientX,- clientY: e.clientY,- ctrlKey: e.ctrlKey,- metaKey: e.metaKey,- altKey: e.altKey,- shiftKey: e.shiftKey- });- break;- // case 1:- default:- // Left mouse button pressed- _isMouseDown = true;-- _self.dispatchEvent('mousedown', {- x: _startMouseX - sigma.utils.getWidth(e) / 2,- y: _startMouseY - sigma.utils.getHeight(e) / 2,- clientX: e.clientX,- clientY: e.clientY,- ctrlKey: e.ctrlKey,- metaKey: e.metaKey,- altKey: e.altKey,- shiftKey: e.shiftKey- });- }- }- }-- /**- * The handler listening to the 'out' mouse event. It will just redispatch- * the event.- *- * @param {event} e A mouse event.- */- function _outHandler(e) {- if (_settings('mouseEnabled'))- _self.dispatchEvent('mouseout');- }-- /**- * The handler listening to the 'click' mouse event. It will redispatch the- * click event, but with normalized X and Y coordinates.- *- * @param {event} e A mouse event.- */- function _clickHandler(e) {- if (_settings('mouseEnabled'))- _self.dispatchEvent('click', {- x: sigma.utils.getX(e) - sigma.utils.getWidth(e) / 2,- y: sigma.utils.getY(e) - sigma.utils.getHeight(e) / 2,- clientX: e.clientX,- clientY: e.clientY,- ctrlKey: e.ctrlKey,- metaKey: e.metaKey,- altKey: e.altKey,- shiftKey: e.shiftKey,- isDragging:- (((new Date()).getTime() - _downStartTime) > 100) &&- _hasDragged- });-- if (e.preventDefault)- e.preventDefault();- else- e.returnValue = false;-- e.stopPropagation();- return false;- }-- /**- * The handler listening to the double click custom event. It will- * basically zoom into the graph.- *- * @param {event} e A mouse event.- */- function _doubleClickHandler(e) {- var pos,- ratio,- animation;-- if (_settings('mouseEnabled')) {- ratio = 1 / _settings('doubleClickZoomingRatio');-- _self.dispatchEvent('doubleclick', {- x: _startMouseX - sigma.utils.getWidth(e) / 2,- y: _startMouseY - sigma.utils.getHeight(e) / 2,- clientX: e.clientX,- clientY: e.clientY,- ctrlKey: e.ctrlKey,- metaKey: e.metaKey,- altKey: e.altKey,- shiftKey: e.shiftKey- });-- if (_settings('doubleClickEnabled')) {- pos = _camera.cameraPosition(- sigma.utils.getX(e) - sigma.utils.getWidth(e) / 2,- sigma.utils.getY(e) - sigma.utils.getHeight(e) / 2,- true- );-- animation = {- duration: _settings('doubleClickZoomDuration')- };-- sigma.utils.zoomTo(_camera, pos.x, pos.y, ratio, animation);- }-- if (e.preventDefault)- e.preventDefault();- else- e.returnValue = false;-- e.stopPropagation();- return false;- }- }-- /**- * The handler listening to the 'wheel' mouse event. It will basically zoom- * in or not into the graph.- *- * @param {event} e A mouse event.- */- function _wheelHandler(e) {- var pos,- ratio,- animation;-- if (_settings('mouseEnabled') && _settings('mouseWheelEnabled')) {- ratio = sigma.utils.getDelta(e) > 0 ?- 1 / _settings('zoomingRatio') :- _settings('zoomingRatio');-- pos = _camera.cameraPosition(- sigma.utils.getX(e) - sigma.utils.getWidth(e) / 2,- sigma.utils.getY(e) - sigma.utils.getHeight(e) / 2,- true- );-- animation = {- duration: _settings('mouseZoomDuration')- };-- sigma.utils.zoomTo(_camera, pos.x, pos.y, ratio, animation);-- if (e.preventDefault)- e.preventDefault();- else- e.returnValue = false;-- e.stopPropagation();- return false;- }- }- };-}).call(this);--;(function(undefined) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- // Initialize packages:- sigma.utils.pkg('sigma.captors');-- /**- * The user inputs default captor. It deals with mouse events, keyboards- * events and touch events.- *- * @param {DOMElement} target The DOM element where the listeners will be- * bound.- * @param {camera} camera The camera related to the target.- * @param {configurable} settings The settings function.- * @return {sigma.captor} The fresh new captor instance.- */- sigma.captors.touch = function(target, camera, settings) {- var _self = this,- _target = target,- _camera = camera,- _settings = settings,-- // CAMERA MANAGEMENT:- // ******************- // The camera position when the user starts dragging:- _startCameraX,- _startCameraY,- _startCameraAngle,- _startCameraRatio,-- // The latest stage position:- _lastCameraX,- _lastCameraY,- _lastCameraAngle,- _lastCameraRatio,-- // TOUCH MANAGEMENT:- // *****************- // Touches that are down:- _downTouches = [],-- _startTouchX0,- _startTouchY0,- _startTouchX1,- _startTouchY1,- _startTouchAngle,- _startTouchDistance,-- _touchMode,-- _isMoving,- _doubleTap,- _movingTimeoutId;-- sigma.classes.dispatcher.extend(this);-- sigma.utils.doubleClick(_target, 'touchstart', _doubleTapHandler);- _target.addEventListener('touchstart', _handleStart, false);- _target.addEventListener('touchend', _handleLeave, false);- _target.addEventListener('touchcancel', _handleLeave, false);- _target.addEventListener('touchleave', _handleLeave, false);- _target.addEventListener('touchmove', _handleMove, false);-- function position(e) {- var offset = sigma.utils.getOffset(_target);-- return {- x: e.pageX - offset.left,- y: e.pageY - offset.top- };- }----- /**- * This method unbinds every handlers that makes the captor work.- */- this.kill = function() {- sigma.utils.unbindDoubleClick(_target, 'touchstart');- _target.addEventListener('touchstart', _handleStart);- _target.addEventListener('touchend', _handleLeave);- _target.addEventListener('touchcancel', _handleLeave);- _target.addEventListener('touchleave', _handleLeave);- _target.addEventListener('touchmove', _handleMove);- };----- // TOUCH EVENTS:- // *************- /**- * The handler listening to the 'touchstart' event. It will set the touch- * mode ("_touchMode") and start observing the user touch moves.- *- * @param {event} e A touch event.- */- function _handleStart(e) {- if (_settings('touchEnabled')) {- var x0,- x1,- y0,- y1,- pos0,- pos1;-- _downTouches = e.touches;-- switch (_downTouches.length) {- case 1:- _camera.isMoving = true;- _touchMode = 1;-- _startCameraX = _camera.x;- _startCameraY = _camera.y;-- _lastCameraX = _camera.x;- _lastCameraY = _camera.y;-- pos0 = position(_downTouches[0]);- _startTouchX0 = pos0.x;- _startTouchY0 = pos0.y;-- break;- case 2:- _camera.isMoving = true;- _touchMode = 2;-- pos0 = position(_downTouches[0]);- pos1 = position(_downTouches[1]);- x0 = pos0.x;- y0 = pos0.y;- x1 = pos1.x;- y1 = pos1.y;-- _lastCameraX = _camera.x;- _lastCameraY = _camera.y;-- _startCameraAngle = _camera.angle;- _startCameraRatio = _camera.ratio;-- _startCameraX = _camera.x;- _startCameraY = _camera.y;-- _startTouchX0 = x0;- _startTouchY0 = y0;- _startTouchX1 = x1;- _startTouchY1 = y1;-- _startTouchAngle = Math.atan2(- _startTouchY1 - _startTouchY0,- _startTouchX1 - _startTouchX0- );- _startTouchDistance = Math.sqrt(- Math.pow(_startTouchY1 - _startTouchY0, 2) +- Math.pow(_startTouchX1 - _startTouchX0, 2)- );-- e.preventDefault();- return false;- }- }- }-- /**- * The handler listening to the 'touchend', 'touchcancel' and 'touchleave'- * event. It will update the touch mode if there are still at least one- * finger, and stop dragging else.- *- * @param {event} e A touch event.- */- function _handleLeave(e) {- if (_settings('touchEnabled')) {- _downTouches = e.touches;- var inertiaRatio = _settings('touchInertiaRatio');-- if (_movingTimeoutId) {- _isMoving = false;- clearTimeout(_movingTimeoutId);- }-- switch (_touchMode) {- case 2:- if (e.touches.length === 1) {- _handleStart(e);-- e.preventDefault();- break;- }- /* falls through */- case 1:- _camera.isMoving = false;- _self.dispatchEvent('stopDrag');-- if (_isMoving) {- _doubleTap = false;- sigma.misc.animation.camera(- _camera,- {- x: _camera.x +- inertiaRatio * (_camera.x - _lastCameraX),- y: _camera.y +- inertiaRatio * (_camera.y - _lastCameraY)- },- {- easing: 'quadraticOut',- duration: _settings('touchInertiaDuration')- }- );- }-- _isMoving = false;- _touchMode = 0;- break;- }- }- }-- /**- * The handler listening to the 'touchmove' event. It will effectively drag- * the graph, and eventually zooms and turn it if the user is using two- * fingers.- *- * @param {event} e A touch event.- */- function _handleMove(e) {- if (!_doubleTap && _settings('touchEnabled')) {- var x0,- x1,- y0,- y1,- cos,- sin,- end,- pos0,- pos1,- diff,- start,- dAngle,- dRatio,- newStageX,- newStageY,- newStageRatio,- newStageAngle;-- _downTouches = e.touches;- _isMoving = true;-- if (_movingTimeoutId)- clearTimeout(_movingTimeoutId);-- _movingTimeoutId = setTimeout(function() {- _isMoving = false;- }, _settings('dragTimeout'));-- switch (_touchMode) {- case 1:- pos0 = position(_downTouches[0]);- x0 = pos0.x;- y0 = pos0.y;-- diff = _camera.cameraPosition(- x0 - _startTouchX0,- y0 - _startTouchY0,- true- );-- newStageX = _startCameraX - diff.x;- newStageY = _startCameraY - diff.y;-- if (newStageX !== _camera.x || newStageY !== _camera.y) {- _lastCameraX = _camera.x;- _lastCameraY = _camera.y;-- _camera.goTo({- x: newStageX,- y: newStageY- });-- _self.dispatchEvent('mousemove', {- x: pos0.x - sigma.utils.getWidth(e) / 2,- y: pos0.y - sigma.utils.getHeight(e) / 2,- clientX: e.clientX,- clientY: e.clientY,- ctrlKey: e.ctrlKey,- metaKey: e.metaKey,- altKey: e.altKey,- shiftKey: e.shiftKey- });-- _self.dispatchEvent('drag');- }- break;- case 2:- pos0 = position(_downTouches[0]);- pos1 = position(_downTouches[1]);- x0 = pos0.x;- y0 = pos0.y;- x1 = pos1.x;- y1 = pos1.y;-- start = _camera.cameraPosition(- (_startTouchX0 + _startTouchX1) / 2 -- sigma.utils.getWidth(e) / 2,- (_startTouchY0 + _startTouchY1) / 2 -- sigma.utils.getHeight(e) / 2,- true- );- end = _camera.cameraPosition(- (x0 + x1) / 2 - sigma.utils.getWidth(e) / 2,- (y0 + y1) / 2 - sigma.utils.getHeight(e) / 2,- true- );-- dAngle = Math.atan2(y1 - y0, x1 - x0) - _startTouchAngle;- dRatio = Math.sqrt(- Math.pow(y1 - y0, 2) + Math.pow(x1 - x0, 2)- ) / _startTouchDistance;-- // Translation:- x0 = start.x;- y0 = start.y;-- // Homothetic transformation:- newStageRatio = _startCameraRatio / dRatio;- x0 = x0 * dRatio;- y0 = y0 * dRatio;-- // Rotation:- newStageAngle = _startCameraAngle - dAngle;- cos = Math.cos(-dAngle);- sin = Math.sin(-dAngle);- x1 = x0 * cos + y0 * sin;- y1 = y0 * cos - x0 * sin;- x0 = x1;- y0 = y1;-- // Finalize:- newStageX = x0 - end.x + _startCameraX;- newStageY = y0 - end.y + _startCameraY;-- if (- newStageRatio !== _camera.ratio ||- newStageAngle !== _camera.angle ||- newStageX !== _camera.x ||- newStageY !== _camera.y- ) {- _lastCameraX = _camera.x;- _lastCameraY = _camera.y;- _lastCameraAngle = _camera.angle;- _lastCameraRatio = _camera.ratio;-- _camera.goTo({- x: newStageX,- y: newStageY,- angle: newStageAngle,- ratio: newStageRatio- });-- _self.dispatchEvent('drag');- }-- break;- }-- e.preventDefault();- return false;- }- }-- /**- * The handler listening to the double tap custom event. It will- * basically zoom into the graph.- *- * @param {event} e A touch event.- */- function _doubleTapHandler(e) {- var pos,- ratio,- animation;-- if (e.touches && e.touches.length === 1 && _settings('touchEnabled')) {- _doubleTap = true;-- ratio = 1 / _settings('doubleClickZoomingRatio');-- pos = position(e.touches[0]);- _self.dispatchEvent('doubleclick', {- x: pos.x - sigma.utils.getWidth(e) / 2,- y: pos.y - sigma.utils.getHeight(e) / 2,- clientX: e.clientX,- clientY: e.clientY,- ctrlKey: e.ctrlKey,- metaKey: e.metaKey,- altKey: e.altKey,- shiftKey: e.shiftKey- });-- if (_settings('doubleClickEnabled')) {- pos = _camera.cameraPosition(- pos.x - sigma.utils.getWidth(e) / 2,- pos.y - sigma.utils.getHeight(e) / 2,- true- );-- animation = {- duration: _settings('doubleClickZoomDuration'),- onComplete: function() {- _doubleTap = false;- }- };-- sigma.utils.zoomTo(_camera, pos.x, pos.y, ratio, animation);- }-- if (e.preventDefault)- e.preventDefault();- else- e.returnValue = false;-- e.stopPropagation();- return false;- }- }- };-}).call(this);--;(function(undefined) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- if (typeof conrad === 'undefined')- throw 'conrad is not declared';-- // Initialize packages:- sigma.utils.pkg('sigma.renderers');-- /**- * This function is the constructor of the canvas sigma's renderer.- *- * @param {sigma.classes.graph} graph The graph to render.- * @param {sigma.classes.camera} camera The camera.- * @param {configurable} settings The sigma instance settings- * function.- * @param {object} object The options object.- * @return {sigma.renderers.canvas} The renderer instance.- */- sigma.renderers.canvas = function(graph, camera, settings, options) {- if (typeof options !== 'object')- throw 'sigma.renderers.canvas: Wrong arguments.';-- if (!(options.container instanceof HTMLElement))- throw 'Container not found.';-- var k,- i,- l,- a,- fn,- self = this;-- sigma.classes.dispatcher.extend(this);-- // Initialize main attributes:- Object.defineProperty(this, 'conradId', {- value: sigma.utils.id()- });- this.graph = graph;- this.camera = camera;- this.contexts = {};- this.domElements = {};- this.options = options;- this.container = this.options.container;- this.settings = (- typeof options.settings === 'object' &&- options.settings- ) ?- settings.embedObjects(options.settings) :- settings;-- // Node indexes:- this.nodesOnScreen = [];- this.edgesOnScreen = [];-- // Conrad related attributes:- this.jobs = {};-- // Find the prefix:- this.options.prefix = 'renderer' + this.conradId + ':';-- // Initialize the DOM elements:- if (- !this.settings('batchEdgesDrawing')- ) {- this.initDOM('canvas', 'scene');- this.contexts.edges = this.contexts.scene;- this.contexts.nodes = this.contexts.scene;- this.contexts.labels = this.contexts.scene;- } else {- this.initDOM('canvas', 'edges');- this.initDOM('canvas', 'scene');- this.contexts.nodes = this.contexts.scene;- this.contexts.labels = this.contexts.scene;- }-- this.initDOM('canvas', 'mouse');- this.contexts.hover = this.contexts.mouse;-- // Initialize captors:- this.captors = [];- a = this.options.captors || [sigma.captors.mouse, sigma.captors.touch];- for (i = 0, l = a.length; i < l; i++) {- fn = typeof a[i] === 'function' ? a[i] : sigma.captors[a[i]];- this.captors.push(- new fn(- this.domElements.mouse,- this.camera,- this.settings- )- );- }-- // Deal with sigma events:- sigma.misc.bindEvents.call(this, this.options.prefix);- sigma.misc.drawHovers.call(this, this.options.prefix);-- this.resize(false);- };----- /**- * This method renders the graph on the canvases.- *- * @param {?object} options Eventually an object of options.- * @return {sigma.renderers.canvas} Returns the instance itself.- */- sigma.renderers.canvas.prototype.render = function(options) {- options = options || {};-- var a,- i,- k,- l,- o,- id,- end,- job,- start,- edges,- renderers,- rendererType,- batchSize,- tempGCO,- index = {},- graph = this.graph,- nodes = this.graph.nodes,- prefix = this.options.prefix || '',- drawEdges = this.settings(options, 'drawEdges'),- drawNodes = this.settings(options, 'drawNodes'),- drawLabels = this.settings(options, 'drawLabels'),- drawEdgeLabels = this.settings(options, 'drawEdgeLabels'),- embedSettings = this.settings.embedObjects(options, {- prefix: this.options.prefix- });-- // Call the resize function:- this.resize(false);-- // Check the 'hideEdgesOnMove' setting:- if (this.settings(options, 'hideEdgesOnMove'))- if (this.camera.isAnimated || this.camera.isMoving)- drawEdges = false;-- // Apply the camera's view:- this.camera.applyView(- undefined,- this.options.prefix,- {- width: this.width,- height: this.height- }- );-- // Clear canvases:- this.clear();-- // Kill running jobs:- for (k in this.jobs)- if (conrad.hasJob(k))- conrad.killJob(k);-- // Find which nodes are on screen:- this.edgesOnScreen = [];- this.nodesOnScreen = this.camera.quadtree.area(- this.camera.getRectangle(this.width, this.height)- );-- for (a = this.nodesOnScreen, i = 0, l = a.length; i < l; i++)- index[a[i].id] = a[i];-- // Draw edges:- // - If settings('batchEdgesDrawing') is true, the edges are displayed per- // batches. If not, they are drawn in one frame.- if (drawEdges) {- // First, let's identify which edges to draw. To do this, we just keep- // every edges that have at least one extremity displayed according to- // the quadtree and the "hidden" attribute. We also do not keep hidden- // edges.- for (a = graph.edges(), i = 0, l = a.length; i < l; i++) {- o = a[i];- if (- (index[o.source] || index[o.target]) &&- (!o.hidden && !nodes(o.source).hidden && !nodes(o.target).hidden)- )- this.edgesOnScreen.push(o);- }-- // If the "batchEdgesDrawing" settings is true, edges are batched:- if (this.settings(options, 'batchEdgesDrawing')) {- id = 'edges_' + this.conradId;- batchSize = embedSettings('canvasEdgesBatchSize');-- edges = this.edgesOnScreen;- l = edges.length;-- start = 0;- end = Math.min(edges.length, start + batchSize);-- job = function() {- tempGCO = this.contexts.edges.globalCompositeOperation;- this.contexts.edges.globalCompositeOperation = 'destination-over';-- renderers = sigma.canvas.edges;- for (i = start; i < end; i++) {- o = edges[i];- (renderers[- o.type || this.settings(options, 'defaultEdgeType')- ] || renderers.def)(- o,- graph.nodes(o.source),- graph.nodes(o.target),- this.contexts.edges,- embedSettings- );- }-- // Draw edge labels:- if (drawEdgeLabels) {- renderers = sigma.canvas.edges.labels;- for (i = start; i < end; i++) {- o = edges[i];- if (!o.hidden)- (renderers[- o.type || this.settings(options, 'defaultEdgeType')- ] || renderers.def)(- o,- graph.nodes(o.source),- graph.nodes(o.target),- this.contexts.labels,- embedSettings- );- }- }-- // Restore original globalCompositeOperation:- this.contexts.edges.globalCompositeOperation = tempGCO;-- // Catch job's end:- if (end === edges.length) {- delete this.jobs[id];- return false;- }-- start = end + 1;- end = Math.min(edges.length, start + batchSize);- return true;- };-- this.jobs[id] = job;- conrad.addJob(id, job.bind(this));-- // If not, they are drawn in one frame:- } else {- renderers = sigma.canvas.edges;- for (a = this.edgesOnScreen, i = 0, l = a.length; i < l; i++) {- o = a[i];- (renderers[- o.type || this.settings(options, 'defaultEdgeType')- ] || renderers.def)(- o,- graph.nodes(o.source),- graph.nodes(o.target),- this.contexts.edges,- embedSettings- );- }-- // Draw edge labels:- // - No batching- if (drawEdgeLabels) {- renderers = sigma.canvas.edges.labels;- for (a = this.edgesOnScreen, i = 0, l = a.length; i < l; i++)- if (!a[i].hidden)- (renderers[- a[i].type || this.settings(options, 'defaultEdgeType')- ] || renderers.def)(- a[i],- graph.nodes(a[i].source),- graph.nodes(a[i].target),- this.contexts.labels,- embedSettings- );- }- }- }-- // Draw nodes:- // - No batching- if (drawNodes) {- renderers = sigma.canvas.nodes;- for (a = this.nodesOnScreen, i = 0, l = a.length; i < l; i++)- if (!a[i].hidden)- (renderers[- a[i].type || this.settings(options, 'defaultNodeType')- ] || renderers.def)(- a[i],- this.contexts.nodes,- embedSettings- );- }-- // Draw labels:- // - No batching- if (drawLabels) {- renderers = sigma.canvas.labels;- for (a = this.nodesOnScreen, i = 0, l = a.length; i < l; i++)- if (!a[i].hidden)- (renderers[- a[i].type || this.settings(options, 'defaultNodeType')- ] || renderers.def)(- a[i],- this.contexts.labels,- embedSettings- );- }-- this.dispatchEvent('render');-- return this;- };-- /**- * This method creates a DOM element of the specified type, switches its- * position to "absolute", references it to the domElements attribute, and- * finally appends it to the container.- *- * @param {string} tag The label tag.- * @param {string} id The id of the element (to store it in "domElements").- */- sigma.renderers.canvas.prototype.initDOM = function(tag, id) {- var dom = document.createElement(tag);-- dom.style.position = 'absolute';- dom.setAttribute('class', 'sigma-' + id);-- this.domElements[id] = dom;- this.container.appendChild(dom);-- if (tag.toLowerCase() === 'canvas')- this.contexts[id] = dom.getContext('2d');- };-- /**- * This method resizes each DOM elements in the container and stores the new- * dimensions. Then, it renders the graph.- *- * @param {?number} width The new width of the container.- * @param {?number} height The new height of the container.- * @return {sigma.renderers.canvas} Returns the instance itself.- */- sigma.renderers.canvas.prototype.resize = function(w, h) {- var k,- oldWidth = this.width,- oldHeight = this.height,- pixelRatio = 1;- // TODO:- // *****- // This pixelRatio is the solution to display with the good definition- // on canvases on Retina displays (ie oversampling). Unfortunately, it- // has a huge performance cost...- // > pixelRatio = window.devicePixelRatio || 1;-- if (w !== undefined && h !== undefined) {- this.width = w;- this.height = h;- } else {- this.width = this.container.offsetWidth;- this.height = this.container.offsetHeight;-- w = this.width;- h = this.height;- }-- if (oldWidth !== this.width || oldHeight !== this.height) {- for (k in this.domElements) {- this.domElements[k].style.width = w + 'px';- this.domElements[k].style.height = h + 'px';-- if (this.domElements[k].tagName.toLowerCase() === 'canvas') {- this.domElements[k].setAttribute('width', (w * pixelRatio) + 'px');- this.domElements[k].setAttribute('height', (h * pixelRatio) + 'px');-- if (pixelRatio !== 1)- this.contexts[k].scale(pixelRatio, pixelRatio);- }- }- }-- return this;- };-- /**- * This method clears each canvas.- *- * @return {sigma.renderers.canvas} Returns the instance itself.- */- sigma.renderers.canvas.prototype.clear = function() {- var k;-- for (k in this.domElements)- if (this.domElements[k].tagName === 'CANVAS')- this.domElements[k].width = this.domElements[k].width;-- return this;- };-- /**- * This method kills contexts and other attributes.- */- sigma.renderers.canvas.prototype.kill = function() {- var k,- captor;-- // Kill captors:- while ((captor = this.captors.pop()))- captor.kill();- delete this.captors;-- // Kill contexts:- for (k in this.domElements) {- this.domElements[k].parentNode.removeChild(this.domElements[k]);- delete this.domElements[k];- delete this.contexts[k];- }- delete this.domElements;- delete this.contexts;- };----- /**- * The labels, nodes and edges renderers are stored in the three following- * objects. When an element is drawn, its type will be checked and if a- * renderer with the same name exists, it will be used. If not found, the- * default renderer will be used instead.- *- * They are stored in different files, in the "./canvas" folder.- */- sigma.utils.pkg('sigma.canvas.nodes');- sigma.utils.pkg('sigma.canvas.edges');- sigma.utils.pkg('sigma.canvas.labels');-}).call(this);--;(function(undefined) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- // Initialize packages:- sigma.utils.pkg('sigma.renderers');-- /**- * This function is the constructor of the canvas sigma's renderer.- *- * @param {sigma.classes.graph} graph The graph to render.- * @param {sigma.classes.camera} camera The camera.- * @param {configurable} settings The sigma instance settings- * function.- * @param {object} object The options object.- * @return {sigma.renderers.canvas} The renderer instance.- */- sigma.renderers.webgl = function(graph, camera, settings, options) {- if (typeof options !== 'object')- throw 'sigma.renderers.webgl: Wrong arguments.';-- if (!(options.container instanceof HTMLElement))- throw 'Container not found.';-- var k,- i,- l,- a,- fn,- _self = this;-- sigma.classes.dispatcher.extend(this);-- // Conrad related attributes:- this.jobs = {};-- Object.defineProperty(this, 'conradId', {- value: sigma.utils.id()- });-- // Initialize main attributes:- this.graph = graph;- this.camera = camera;- this.contexts = {};- this.domElements = {};- this.options = options;- this.container = this.options.container;- this.settings = (- typeof options.settings === 'object' &&- options.settings- ) ?- settings.embedObjects(options.settings) :- settings;-- // Find the prefix:- this.options.prefix = this.camera.readPrefix;-- // Initialize programs hash- Object.defineProperty(this, 'nodePrograms', {- value: {}- });- Object.defineProperty(this, 'edgePrograms', {- value: {}- });- Object.defineProperty(this, 'nodeFloatArrays', {- value: {}- });- Object.defineProperty(this, 'edgeFloatArrays', {- value: {}- });-- // Initialize the DOM elements:- if (this.settings(options, 'batchEdgesDrawing')) {- this.initDOM('canvas', 'edges', true);- this.initDOM('canvas', 'nodes', true);- } else {- this.initDOM('canvas', 'scene', true);- this.contexts.nodes = this.contexts.scene;- this.contexts.edges = this.contexts.scene;- }-- this.initDOM('canvas', 'labels');- this.initDOM('canvas', 'mouse');- this.contexts.hover = this.contexts.mouse;-- // Initialize captors:- this.captors = [];- a = this.options.captors || [sigma.captors.mouse, sigma.captors.touch];- for (i = 0, l = a.length; i < l; i++) {- fn = typeof a[i] === 'function' ? a[i] : sigma.captors[a[i]];- this.captors.push(- new fn(- this.domElements.mouse,- this.camera,- this.settings- )- );- }-- // Deal with sigma events:- sigma.misc.bindEvents.call(this, this.camera.prefix);- sigma.misc.drawHovers.call(this, this.camera.prefix);-- this.resize();- };----- /**- * This method will generate the nodes and edges float arrays. This step is- * separated from the "render" method, because to keep WebGL efficient, since- * all the camera and middlewares are modelised as matrices and they do not- * require the float arrays to be regenerated.- *- * Basically, when the user moves the camera or applies some specific linear- * transformations, this process step will be skipped, and the "render"- * method will efficiently refresh the rendering.- *- * And when the user modifies the graph colors or positions (applying a new- * layout or filtering the colors, for instance), this "process" step will be- * required to regenerate the float arrays.- *- * @return {sigma.renderers.webgl} Returns the instance itself.- */- sigma.renderers.webgl.prototype.process = function() {- var a,- i,- l,- k,- type,- renderer,- graph = this.graph,- options = sigma.utils.extend(options, this.options);-- // Empty float arrays:- for (k in this.nodeFloatArrays)- delete this.nodeFloatArrays[k];-- for (k in this.edgeFloatArrays)- delete this.edgeFloatArrays[k];-- // Sort edges and nodes per types:- for (a = graph.edges(), i = 0, l = a.length; i < l; i++) {- type = a[i].type || this.settings(options, 'defaultEdgeType');- k = (type && sigma.webgl.edges[type]) ? type : 'def';-- if (!this.edgeFloatArrays[k])- this.edgeFloatArrays[k] = {- edges: []- };-- this.edgeFloatArrays[k].edges.push(a[i]);- }-- for (a = graph.nodes(), i = 0, l = a.length; i < l; i++) {- type = a[i].type || this.settings(options, 'defaultNodeType');- k = (type && sigma.webgl.nodes[type]) ? type : 'def';-- if (!this.nodeFloatArrays[k])- this.nodeFloatArrays[k] = {- nodes: []- };-- this.nodeFloatArrays[k].nodes.push(a[i]);- }-- // Push edges:- for (k in this.edgeFloatArrays) {- renderer = sigma.webgl.edges[k];-- for (a = this.edgeFloatArrays[k].edges, i = 0, l = a.length; i < l; i++) {- if (!this.edgeFloatArrays[k].array)- this.edgeFloatArrays[k].array = new Float32Array(- a.length * renderer.POINTS * renderer.ATTRIBUTES- );-- // Just check that the edge and both its extremities are visible:- if (- !a[i].hidden &&- !graph.nodes(a[i].source).hidden &&- !graph.nodes(a[i].target).hidden- )- renderer.addEdge(- a[i],- graph.nodes(a[i].source),- graph.nodes(a[i].target),- this.edgeFloatArrays[k].array,- i * renderer.POINTS * renderer.ATTRIBUTES,- options.prefix,- this.settings- );- }- }-- // Push nodes:- for (k in this.nodeFloatArrays) {- renderer = sigma.webgl.nodes[k];-- for (a = this.nodeFloatArrays[k].nodes, i = 0, l = a.length; i < l; i++) {- if (!this.nodeFloatArrays[k].array)- this.nodeFloatArrays[k].array = new Float32Array(- a.length * renderer.POINTS * renderer.ATTRIBUTES- );-- // Just check that the edge and both its extremities are visible:- if (- !a[i].hidden- )- renderer.addNode(- a[i],- this.nodeFloatArrays[k].array,- i * renderer.POINTS * renderer.ATTRIBUTES,- options.prefix,- this.settings- );- }- }-- return this;- };----- /**- * This method renders the graph. It basically calls each program (and- * generate them if they do not exist yet) to render nodes and edges, batched- * per renderer.- *- * As in the canvas renderer, it is possible to display edges, nodes and / or- * labels in batches, to make the whole thing way more scalable.- *- * @param {?object} params Eventually an object of options.- * @return {sigma.renderers.webgl} Returns the instance itself.- */- sigma.renderers.webgl.prototype.render = function(params) {- var a,- i,- l,- k,- o,- program,- renderer,- self = this,- graph = this.graph,- nodesGl = this.contexts.nodes,- edgesGl = this.contexts.edges,- matrix = this.camera.getMatrix(),- options = sigma.utils.extend(params, this.options),- drawLabels = this.settings(options, 'drawLabels'),- drawEdges = this.settings(options, 'drawEdges'),- drawNodes = this.settings(options, 'drawNodes');-- // Call the resize function:- this.resize(false);-- // Check the 'hideEdgesOnMove' setting:- if (this.settings(options, 'hideEdgesOnMove'))- if (this.camera.isAnimated || this.camera.isMoving)- drawEdges = false;-- // Clear canvases:- this.clear();-- // Translate matrix to [width/2, height/2]:- matrix = sigma.utils.matrices.multiply(- matrix,- sigma.utils.matrices.translation(this.width / 2, this.height / 2)- );-- // Kill running jobs:- for (k in this.jobs)- if (conrad.hasJob(k))- conrad.killJob(k);-- if (drawEdges) {- if (this.settings(options, 'batchEdgesDrawing'))- (function() {- var a,- k,- i,- id,- job,- arr,- end,- start,- renderer,- batchSize,- currentProgram;-- id = 'edges_' + this.conradId;- batchSize = this.settings(options, 'webglEdgesBatchSize');- a = Object.keys(this.edgeFloatArrays);-- if (!a.length)- return;- i = 0;- renderer = sigma.webgl.edges[a[i]];- arr = this.edgeFloatArrays[a[i]].array;- start = 0;- end = Math.min(- start + batchSize * renderer.POINTS,- arr.length / renderer.ATTRIBUTES- );-- job = function() {- // Check program:- if (!this.edgePrograms[a[i]])- this.edgePrograms[a[i]] = renderer.initProgram(edgesGl);-- if (start < end) {- edgesGl.useProgram(this.edgePrograms[a[i]]);- renderer.render(- edgesGl,- this.edgePrograms[a[i]],- arr,- {- settings: this.settings,- matrix: matrix,- width: this.width,- height: this.height,- ratio: this.camera.ratio,- scalingRatio: this.settings(- options,- 'webglOversamplingRatio'- ),- start: start,- count: end - start- }- );- }-- // Catch job's end:- if (- end >= arr.length / renderer.ATTRIBUTES &&- i === a.length - 1- ) {- delete this.jobs[id];- return false;- }-- if (end >= arr.length / renderer.ATTRIBUTES) {- i++;- arr = this.edgeFloatArrays[a[i]].array;- renderer = sigma.webgl.edges[a[i]];- start = 0;- end = Math.min(- start + batchSize * renderer.POINTS,- arr.length / renderer.ATTRIBUTES- );- } else {- start = end;- end = Math.min(- start + batchSize * renderer.POINTS,- arr.length / renderer.ATTRIBUTES- );- }-- return true;- };-- this.jobs[id] = job;- conrad.addJob(id, job.bind(this));- }).call(this);- else {- for (k in this.edgeFloatArrays) {- renderer = sigma.webgl.edges[k];-- // Check program:- if (!this.edgePrograms[k])- this.edgePrograms[k] = renderer.initProgram(edgesGl);-- // Render- if (this.edgeFloatArrays[k]) {- edgesGl.useProgram(this.edgePrograms[k]);- renderer.render(- edgesGl,- this.edgePrograms[k],- this.edgeFloatArrays[k].array,- {- settings: this.settings,- matrix: matrix,- width: this.width,- height: this.height,- ratio: this.camera.ratio,- scalingRatio: this.settings(options, 'webglOversamplingRatio')- }- );- }- }- }- }-- if (drawNodes) {- // Enable blending:- nodesGl.blendFunc(nodesGl.SRC_ALPHA, nodesGl.ONE_MINUS_SRC_ALPHA);- nodesGl.enable(nodesGl.BLEND);-- for (k in this.nodeFloatArrays) {- renderer = sigma.webgl.nodes[k];-- // Check program:- if (!this.nodePrograms[k])- this.nodePrograms[k] = renderer.initProgram(nodesGl);-- // Render- if (this.nodeFloatArrays[k]) {- nodesGl.useProgram(this.nodePrograms[k]);- renderer.render(- nodesGl,- this.nodePrograms[k],- this.nodeFloatArrays[k].array,- {- settings: this.settings,- matrix: matrix,- width: this.width,- height: this.height,- ratio: this.camera.ratio,- scalingRatio: this.settings(options, 'webglOversamplingRatio')- }- );- }- }- }-- if (drawLabels) {- a = this.camera.quadtree.area(- this.camera.getRectangle(this.width, this.height)- );-- // Apply camera view to these nodes:- this.camera.applyView(- undefined,- undefined,- {- nodes: a,- edges: [],- width: this.width,- height: this.height- }- );-- o = function(key) {- return self.settings({- prefix: self.camera.prefix- }, key);- };-- for (i = 0, l = a.length; i < l; i++)- if (!a[i].hidden)- (- sigma.canvas.labels[- a[i].type ||- this.settings(options, 'defaultNodeType')- ] || sigma.canvas.labels.def- )(a[i], this.contexts.labels, o);- }-- this.dispatchEvent('render');-- return this;- };----- /**- * This method creates a DOM element of the specified type, switches its- * position to "absolute", references it to the domElements attribute, and- * finally appends it to the container.- *- * @param {string} tag The label tag.- * @param {string} id The id of the element (to store it in- * "domElements").- * @param {?boolean} webgl Will init the WebGL context if true.- */- sigma.renderers.webgl.prototype.initDOM = function(tag, id, webgl) {- var gl,- dom = document.createElement(tag),- self = this;-- dom.style.position = 'absolute';- dom.setAttribute('class', 'sigma-' + id);-- this.domElements[id] = dom;- this.container.appendChild(dom);-- if (tag.toLowerCase() === 'canvas') {- this.contexts[id] = dom.getContext(webgl ? 'experimental-webgl' : '2d', {- preserveDrawingBuffer: true- });-- // Adding webgl context loss listeners- if (webgl) {- dom.addEventListener('webglcontextlost', function(e) {- e.preventDefault();- }, false);-- dom.addEventListener('webglcontextrestored', function(e) {- self.render();- }, false);- }- }- };-- /**- * This method resizes each DOM elements in the container and stores the new- * dimensions. Then, it renders the graph.- *- * @param {?number} width The new width of the container.- * @param {?number} height The new height of the container.- * @return {sigma.renderers.webgl} Returns the instance itself.- */- sigma.renderers.webgl.prototype.resize = function(w, h) {- var k,- oldWidth = this.width,- oldHeight = this.height;-- if (w !== undefined && h !== undefined) {- this.width = w;- this.height = h;- } else {- this.width = this.container.offsetWidth;- this.height = this.container.offsetHeight;-- w = this.width;- h = this.height;- }-- if (oldWidth !== this.width || oldHeight !== this.height) {- for (k in this.domElements) {- this.domElements[k].style.width = w + 'px';- this.domElements[k].style.height = h + 'px';-- if (this.domElements[k].tagName.toLowerCase() === 'canvas') {- // If simple 2D canvas:- if (this.contexts[k] && this.contexts[k].scale) {- this.domElements[k].setAttribute('width', w + 'px');- this.domElements[k].setAttribute('height', h + 'px');- } else {- this.domElements[k].setAttribute(- 'width',- (w * this.settings('webglOversamplingRatio')) + 'px'- );- this.domElements[k].setAttribute(- 'height',- (h * this.settings('webglOversamplingRatio')) + 'px'- );- }- }- }- }-- // Scale:- for (k in this.contexts)- if (this.contexts[k] && this.contexts[k].viewport)- this.contexts[k].viewport(- 0,- 0,- this.width * this.settings('webglOversamplingRatio'),- this.height * this.settings('webglOversamplingRatio')- );-- return this;- };-- /**- * This method clears each canvas.- *- * @return {sigma.renderers.webgl} Returns the instance itself.- */- sigma.renderers.webgl.prototype.clear = function() {- var k;-- for (k in this.domElements)- if (this.domElements[k].tagName === 'CANVAS')- this.domElements[k].width = this.domElements[k].width;-- this.contexts.nodes.clear(this.contexts.nodes.COLOR_BUFFER_BIT);- this.contexts.edges.clear(this.contexts.edges.COLOR_BUFFER_BIT);-- return this;- };-- /**- * This method kills contexts and other attributes.- */- sigma.renderers.webgl.prototype.kill = function() {- var k,- captor;-- // Kill captors:- while ((captor = this.captors.pop()))- captor.kill();- delete this.captors;-- // Kill contexts:- for (k in this.domElements) {- this.domElements[k].parentNode.removeChild(this.domElements[k]);- delete this.domElements[k];- delete this.contexts[k];- }- delete this.domElements;- delete this.contexts;- };----- /**- * The object "sigma.webgl.nodes" contains the different WebGL node- * renderers. The default one draw nodes as discs. Here are the attributes- * any node renderer must have:- *- * {number} POINTS The number of points required to draw a node.- * {number} ATTRIBUTES The number of attributes needed to draw one point.- * {function} addNode A function that adds a node to the data stack that- * will be given to the buffer. Here is the arguments:- * > {object} node- * > {number} index The node index in the- * nodes array.- * > {Float32Array} data The stack.- * > {object} options Some options.- * {function} render The function that will effectively render the nodes- * into the buffer.- * > {WebGLRenderingContext} gl- * > {WebGLProgram} program- * > {Float32Array} data The stack to give to the- * buffer.- * > {object} params An object containing some- * options, like width,- * height, the camera ratio.- * {function} initProgram The function that will initiate the program, with- * the relevant shaders and parameters. It must return- * the newly created program.- *- * Check sigma.webgl.nodes.def or sigma.webgl.nodes.fast to see how it- * works more precisely.- */- sigma.utils.pkg('sigma.webgl.nodes');----- /**- * The object "sigma.webgl.edges" contains the different WebGL edge- * renderers. The default one draw edges as direct lines. Here are the- * attributes any edge renderer must have:- *- * {number} POINTS The number of points required to draw an edge.- * {number} ATTRIBUTES The number of attributes needed to draw one point.- * {function} addEdge A function that adds an edge to the data stack that- * will be given to the buffer. Here is the arguments:- * > {object} edge- * > {object} source- * > {object} target- * > {Float32Array} data The stack.- * > {object} options Some options.- * {function} render The function that will effectively render the edges- * into the buffer.- * > {WebGLRenderingContext} gl- * > {WebGLProgram} program- * > {Float32Array} data The stack to give to the- * buffer.- * > {object} params An object containing some- * options, like width,- * height, the camera ratio.- * {function} initProgram The function that will initiate the program, with- * the relevant shaders and parameters. It must return- * the newly created program.- *- * Check sigma.webgl.edges.def or sigma.webgl.edges.fast to see how it- * works more precisely.- */- sigma.utils.pkg('sigma.webgl.edges');----- /**- * The object "sigma.canvas.labels" contains the different- * label renderers for the WebGL renderer. Since displaying texts in WebGL is- * definitely painful and since there a way less labels to display than nodes- * or edges, the default renderer simply renders them in a canvas.- *- * A labels renderer is a simple function, taking as arguments the related- * node, the renderer and a settings function.- */- sigma.utils.pkg('sigma.canvas.labels');-}).call(this);--;(function(undefined) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- if (typeof conrad === 'undefined')- throw 'conrad is not declared';-- // Initialize packages:- sigma.utils.pkg('sigma.renderers');-- /**- * This function is the constructor of the svg sigma's renderer.- *- * @param {sigma.classes.graph} graph The graph to render.- * @param {sigma.classes.camera} camera The camera.- * @param {configurable} settings The sigma instance settings- * function.- * @param {object} object The options object.- * @return {sigma.renderers.svg} The renderer instance.- */- sigma.renderers.svg = function(graph, camera, settings, options) {- if (typeof options !== 'object')- throw 'sigma.renderers.svg: Wrong arguments.';-- if (!(options.container instanceof HTMLElement))- throw 'Container not found.';-- var i,- l,- a,- fn,- self = this;-- sigma.classes.dispatcher.extend(this);-- // Initialize main attributes:- this.graph = graph;- this.camera = camera;- this.domElements = {- graph: null,- groups: {},- nodes: {},- edges: {},- labels: {},- hovers: {}- };- this.measurementCanvas = null;- this.options = options;- this.container = this.options.container;- this.settings = (- typeof options.settings === 'object' &&- options.settings- ) ?- settings.embedObjects(options.settings) :- settings;-- // Is the renderer meant to be freestyle?- this.settings('freeStyle', !!this.options.freeStyle);-- // SVG xmlns- this.settings('xmlns', 'http://www.w3.org/2000/svg');-- // Indexes:- this.nodesOnScreen = [];- this.edgesOnScreen = [];-- // Find the prefix:- this.options.prefix = 'renderer' + sigma.utils.id() + ':';-- // Initialize the DOM elements- this.initDOM('svg');-- // Initialize captors:- this.captors = [];- a = this.options.captors || [sigma.captors.mouse, sigma.captors.touch];- for (i = 0, l = a.length; i < l; i++) {- fn = typeof a[i] === 'function' ? a[i] : sigma.captors[a[i]];- this.captors.push(- new fn(- this.domElements.graph,- this.camera,- this.settings- )- );- }-- // Bind resize:- window.addEventListener('resize', function() {- self.resize();- });-- // Deal with sigma events:- // TODO: keep an option to override the DOM events?- sigma.misc.bindDOMEvents.call(this, this.domElements.graph);- this.bindHovers(this.options.prefix);-- // Resize- this.resize(false);- };-- /**- * This method renders the graph on the svg scene.- *- * @param {?object} options Eventually an object of options.- * @return {sigma.renderers.svg} Returns the instance itself.- */- sigma.renderers.svg.prototype.render = function(options) {- options = options || {};-- var a,- i,- k,- e,- l,- o,- source,- target,- start,- edges,- renderers,- subrenderers,- index = {},- graph = this.graph,- nodes = this.graph.nodes,- prefix = this.options.prefix || '',- drawEdges = this.settings(options, 'drawEdges'),- drawNodes = this.settings(options, 'drawNodes'),- drawLabels = this.settings(options, 'drawLabels'),- embedSettings = this.settings.embedObjects(options, {- prefix: this.options.prefix,- forceLabels: this.options.forceLabels- });-- // Check the 'hideEdgesOnMove' setting:- if (this.settings(options, 'hideEdgesOnMove'))- if (this.camera.isAnimated || this.camera.isMoving)- drawEdges = false;-- // Apply the camera's view:- this.camera.applyView(- undefined,- this.options.prefix,- {- width: this.width,- height: this.height- }- );-- // Hiding everything- // TODO: find a more sensible way to perform this operation- this.hideDOMElements(this.domElements.nodes);- this.hideDOMElements(this.domElements.edges);- this.hideDOMElements(this.domElements.labels);-- // Find which nodes are on screen- this.edgesOnScreen = [];- this.nodesOnScreen = this.camera.quadtree.area(- this.camera.getRectangle(this.width, this.height)- );-- // Node index- for (a = this.nodesOnScreen, i = 0, l = a.length; i < l; i++)- index[a[i].id] = a[i];-- // Find which edges are on screen- for (a = graph.edges(), i = 0, l = a.length; i < l; i++) {- o = a[i];- if (- (index[o.source] || index[o.target]) &&- (!o.hidden && !nodes(o.source).hidden && !nodes(o.target).hidden)- )- this.edgesOnScreen.push(o);- }-- // Display nodes- //---------------- renderers = sigma.svg.nodes;- subrenderers = sigma.svg.labels;-- //-- First we create the nodes which are not already created- if (drawNodes)- for (a = this.nodesOnScreen, i = 0, l = a.length; i < l; i++) {- if (!a[i].hidden && !this.domElements.nodes[a[i].id]) {-- // Node- e = (renderers[a[i].type] || renderers.def).create(- a[i],- embedSettings- );-- this.domElements.nodes[a[i].id] = e;- this.domElements.groups.nodes.appendChild(e);-- // Label- e = (subrenderers[a[i].type] || subrenderers.def).create(- a[i],- embedSettings- );-- this.domElements.labels[a[i].id] = e;- this.domElements.groups.labels.appendChild(e);- }- }-- //-- Second we update the nodes- if (drawNodes)- for (a = this.nodesOnScreen, i = 0, l = a.length; i < l; i++) {-- if (a[i].hidden)- continue;-- // Node- (renderers[a[i].type] || renderers.def).update(- a[i],- this.domElements.nodes[a[i].id],- embedSettings- );-- // Label- (subrenderers[a[i].type] || subrenderers.def).update(- a[i],- this.domElements.labels[a[i].id],- embedSettings- );- }-- // Display edges- //---------------- renderers = sigma.svg.edges;-- //-- First we create the edges which are not already created- if (drawEdges)- for (a = this.edgesOnScreen, i = 0, l = a.length; i < l; i++) {- if (!this.domElements.edges[a[i].id]) {- source = nodes(a[i].source);- target = nodes(a[i].target);-- e = (renderers[a[i].type] || renderers.def).create(- a[i],- source,- target,- embedSettings- );-- this.domElements.edges[a[i].id] = e;- this.domElements.groups.edges.appendChild(e);- }- }-- //-- Second we update the edges- if (drawEdges)- for (a = this.edgesOnScreen, i = 0, l = a.length; i < l; i++) {- source = nodes(a[i].source);- target = nodes(a[i].target);-- (renderers[a[i].type] || renderers.def).update(- a[i],- this.domElements.edges[a[i].id],- source,- target,- embedSettings- );- }-- this.dispatchEvent('render');-- return this;- };-- /**- * This method creates a DOM element of the specified type, switches its- * position to "absolute", references it to the domElements attribute, and- * finally appends it to the container.- *- * @param {string} tag The label tag.- * @param {string} id The id of the element (to store it in "domElements").- */- sigma.renderers.svg.prototype.initDOM = function(tag) {- var dom = document.createElementNS(this.settings('xmlns'), tag),- c = this.settings('classPrefix'),- g,- l,- i;-- dom.style.position = 'absolute';- dom.setAttribute('class', c + '-svg');-- // Setting SVG namespace- dom.setAttribute('xmlns', this.settings('xmlns'));- dom.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');- dom.setAttribute('version', '1.1');-- // Creating the measurement canvas- var canvas = document.createElement('canvas');- canvas.setAttribute('class', c + '-measurement-canvas');-- // Appending elements- this.domElements.graph = this.container.appendChild(dom);-- // Creating groups- var groups = ['edges', 'nodes', 'labels', 'hovers'];- for (i = 0, l = groups.length; i < l; i++) {- g = document.createElementNS(this.settings('xmlns'), 'g');-- g.setAttributeNS(null, 'id', c + '-group-' + groups[i]);- g.setAttributeNS(null, 'class', c + '-group');-- this.domElements.groups[groups[i]] =- this.domElements.graph.appendChild(g);- }-- // Appending measurement canvas- this.container.appendChild(canvas);- this.measurementCanvas = canvas.getContext('2d');- };-- /**- * This method hides a batch of SVG DOM elements.- *- * @param {array} elements An array of elements to hide.- * @param {object} renderer The renderer to use.- * @return {sigma.renderers.svg} Returns the instance itself.- */- sigma.renderers.svg.prototype.hideDOMElements = function(elements) {- var o,- i;-- for (i in elements) {- o = elements[i];- sigma.svg.utils.hide(o);- }-- return this;- };-- /**- * This method binds the hover events to the renderer.- *- * @param {string} prefix The renderer prefix.- */- // TODO: add option about whether to display hovers or not- sigma.renderers.svg.prototype.bindHovers = function(prefix) {- var renderers = sigma.svg.hovers,- self = this,- hoveredNode;-- function overNode(e) {- var node = e.data.node,- embedSettings = self.settings.embedObjects({- prefix: prefix- });-- if (!embedSettings('enableHovering'))- return;-- var hover = (renderers[node.type] || renderers.def).create(- node,- self.domElements.nodes[node.id],- self.measurementCanvas,- embedSettings- );-- self.domElements.hovers[node.id] = hover;-- // Inserting the hover in the dom- self.domElements.groups.hovers.appendChild(hover);- hoveredNode = node;- }-- function outNode(e) {- var node = e.data.node,- embedSettings = self.settings.embedObjects({- prefix: prefix- });-- if (!embedSettings('enableHovering'))- return;-- // Deleting element- self.domElements.groups.hovers.removeChild(- self.domElements.hovers[node.id]- );- hoveredNode = null;- delete self.domElements.hovers[node.id];-- // Reinstate- self.domElements.groups.nodes.appendChild(- self.domElements.nodes[node.id]- );- }-- // OPTIMIZE: perform a real update rather than a deletion- function update() {- if (!hoveredNode)- return;-- var embedSettings = self.settings.embedObjects({- prefix: prefix- });-- // Deleting element before update- self.domElements.groups.hovers.removeChild(- self.domElements.hovers[hoveredNode.id]- );- delete self.domElements.hovers[hoveredNode.id];-- var hover = (renderers[hoveredNode.type] || renderers.def).create(- hoveredNode,- self.domElements.nodes[hoveredNode.id],- self.measurementCanvas,- embedSettings- );-- self.domElements.hovers[hoveredNode.id] = hover;-- // Inserting the hover in the dom- self.domElements.groups.hovers.appendChild(hover);- }-- // Binding events- this.bind('overNode', overNode);- this.bind('outNode', outNode);-- // Update on render- this.bind('render', update);- };-- /**- * This method resizes each DOM elements in the container and stores the new- * dimensions. Then, it renders the graph.- *- * @param {?number} width The new width of the container.- * @param {?number} height The new height of the container.- * @return {sigma.renderers.svg} Returns the instance itself.- */- sigma.renderers.svg.prototype.resize = function(w, h) {- var oldWidth = this.width,- oldHeight = this.height,- pixelRatio = 1;-- if (w !== undefined && h !== undefined) {- this.width = w;- this.height = h;- } else {- this.width = this.container.offsetWidth;- this.height = this.container.offsetHeight;-- w = this.width;- h = this.height;- }-- if (oldWidth !== this.width || oldHeight !== this.height) {- this.domElements.graph.style.width = w + 'px';- this.domElements.graph.style.height = h + 'px';-- if (this.domElements.graph.tagName.toLowerCase() === 'svg') {- this.domElements.graph.setAttribute('width', (w * pixelRatio));- this.domElements.graph.setAttribute('height', (h * pixelRatio));- }- }-- return this;- };--- /**- * The labels, nodes and edges renderers are stored in the three following- * objects. When an element is drawn, its type will be checked and if a- * renderer with the same name exists, it will be used. If not found, the- * default renderer will be used instead.- *- * They are stored in different files, in the "./svg" folder.- */- sigma.utils.pkg('sigma.svg.nodes');- sigma.utils.pkg('sigma.svg.edges');- sigma.utils.pkg('sigma.svg.labels');-}).call(this);--;(function(global) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- // Initialize packages:- sigma.utils.pkg('sigma.renderers');-- // Check if WebGL is enabled:- var canvas,- webgl = !!global.WebGLRenderingContext;- if (webgl) {- canvas = document.createElement('canvas');- try {- webgl = !!(- canvas.getContext('webgl') ||- canvas.getContext('experimental-webgl')- );- } catch (e) {- webgl = false;- }- }-- // Copy the good renderer:- sigma.renderers.def = webgl ?- sigma.renderers.webgl :- sigma.renderers.canvas;-})(this);--;(function() {- 'use strict';-- sigma.utils.pkg('sigma.webgl.nodes');-- /**- * This node renderer will display nodes as discs, shaped in triangles with- * the gl.TRIANGLES display mode. So, to be more precise, to draw one node,- * it will store three times the center of node, with the color and the size,- * and an angle indicating which "corner" of the triangle to draw.- *- * The fragment shader does not deal with anti-aliasing, so make sure that- * you deal with it somewhere else in the code (by default, the WebGL- * renderer will oversample the rendering through the webglOversamplingRatio- * value).- */- sigma.webgl.nodes.def = {- POINTS: 3,- ATTRIBUTES: 5,- addNode: function(node, data, i, prefix, settings) {- var color = sigma.utils.floatColor(- node.color || settings('defaultNodeColor')- );-- data[i++] = node[prefix + 'x'];- data[i++] = node[prefix + 'y'];- data[i++] = node[prefix + 'size'];- data[i++] = color;- data[i++] = 0;-- data[i++] = node[prefix + 'x'];- data[i++] = node[prefix + 'y'];- data[i++] = node[prefix + 'size'];- data[i++] = color;- data[i++] = 2 * Math.PI / 3;-- data[i++] = node[prefix + 'x'];- data[i++] = node[prefix + 'y'];- data[i++] = node[prefix + 'size'];- data[i++] = color;- data[i++] = 4 * Math.PI / 3;- },- render: function(gl, program, data, params) {- var buffer;-- // Define attributes:- var positionLocation =- gl.getAttribLocation(program, 'a_position'),- sizeLocation =- gl.getAttribLocation(program, 'a_size'),- colorLocation =- gl.getAttribLocation(program, 'a_color'),- angleLocation =- gl.getAttribLocation(program, 'a_angle'),- resolutionLocation =- gl.getUniformLocation(program, 'u_resolution'),- matrixLocation =- gl.getUniformLocation(program, 'u_matrix'),- ratioLocation =- gl.getUniformLocation(program, 'u_ratio'),- scaleLocation =- gl.getUniformLocation(program, 'u_scale');-- buffer = gl.createBuffer();- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);- gl.bufferData(gl.ARRAY_BUFFER, data, gl.DYNAMIC_DRAW);-- gl.uniform2f(resolutionLocation, params.width, params.height);- gl.uniform1f(- ratioLocation,- 1 / Math.pow(params.ratio, params.settings('nodesPowRatio'))- );- gl.uniform1f(scaleLocation, params.scalingRatio);- gl.uniformMatrix3fv(matrixLocation, false, params.matrix);-- gl.enableVertexAttribArray(positionLocation);- gl.enableVertexAttribArray(sizeLocation);- gl.enableVertexAttribArray(colorLocation);- gl.enableVertexAttribArray(angleLocation);-- gl.vertexAttribPointer(- positionLocation,- 2,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 0- );- gl.vertexAttribPointer(- sizeLocation,- 1,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 8- );- gl.vertexAttribPointer(- colorLocation,- 1,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 12- );- gl.vertexAttribPointer(- angleLocation,- 1,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 16- );-- gl.drawArrays(- gl.TRIANGLES,- params.start || 0,- params.count || (data.length / this.ATTRIBUTES)- );- },- initProgram: function(gl) {- var vertexShader,- fragmentShader,- program;-- vertexShader = sigma.utils.loadShader(- gl,- [- 'attribute vec2 a_position;',- 'attribute float a_size;',- 'attribute float a_color;',- 'attribute float a_angle;',-- 'uniform vec2 u_resolution;',- 'uniform float u_ratio;',- 'uniform float u_scale;',- 'uniform mat3 u_matrix;',-- 'varying vec4 color;',- 'varying vec2 center;',- 'varying float radius;',-- 'void main() {',- // Multiply the point size twice:- 'radius = a_size * u_ratio;',-- // Scale from [[-1 1] [-1 1]] to the container:- 'vec2 position = (u_matrix * vec3(a_position, 1)).xy;',- // 'center = (position / u_resolution * 2.0 - 1.0) * vec2(1, -1);',- 'center = position * u_scale;',- 'center = vec2(center.x, u_scale * u_resolution.y - center.y);',-- 'position = position +',- '2.0 * radius * vec2(cos(a_angle), sin(a_angle));',- 'position = (position / u_resolution * 2.0 - 1.0) * vec2(1, -1);',-- 'radius = radius * u_scale;',-- 'gl_Position = vec4(position, 0, 1);',-- // Extract the color:- 'float c = a_color;',- 'color.b = mod(c, 256.0); c = floor(c / 256.0);',- 'color.g = mod(c, 256.0); c = floor(c / 256.0);',- 'color.r = mod(c, 256.0); c = floor(c / 256.0); color /= 255.0;',- 'color.a = 1.0;',- '}'- ].join('\n'),- gl.VERTEX_SHADER- );-- fragmentShader = sigma.utils.loadShader(- gl,- [- 'precision mediump float;',-- 'varying vec4 color;',- 'varying vec2 center;',- 'varying float radius;',-- 'void main(void) {',- 'vec4 color0 = vec4(0.0, 0.0, 0.0, 0.0);',-- 'vec2 m = gl_FragCoord.xy - center;',- 'float diff = radius - sqrt(m.x * m.x + m.y * m.y);',-- // Here is how we draw a disc instead of a square:- 'if (diff > 0.0)',- 'gl_FragColor = color;',- 'else',- 'gl_FragColor = color0;',- '}'- ].join('\n'),- gl.FRAGMENT_SHADER- );-- program = sigma.utils.loadProgram(gl, [vertexShader, fragmentShader]);-- return program;- }- };-})();--;(function() {- 'use strict';-- sigma.utils.pkg('sigma.webgl.nodes');-- /**- * This node renderer will display nodes in the fastest way: Nodes are basic- * squares, drawn through the gl.POINTS drawing method. The size of the nodes- * are represented with the "gl_PointSize" value in the vertex shader.- *- * It is the fastest node renderer here since the buffer just takes one line- * to draw each node (with attributes "x", "y", "size" and "color").- *- * Nevertheless, this method has some problems, especially due to some issues- * with the gl.POINTS:- * - First, if the center of a node is outside the scene, the point will not- * be drawn, even if it should be partly on screen.- * - I tried applying a fragment shader similar to the one in the default- * node renderer to display them as discs, but it did not work fine on- * some computers settings, filling the discs with weird gradients not- * depending on the actual color.- */- sigma.webgl.nodes.fast = {- POINTS: 1,- ATTRIBUTES: 4,- addNode: function(node, data, i, prefix, settings) {- data[i++] = node[prefix + 'x'];- data[i++] = node[prefix + 'y'];- data[i++] = node[prefix + 'size'];- data[i++] = sigma.utils.floatColor(- node.color || settings('defaultNodeColor')- );- },- render: function(gl, program, data, params) {- var buffer;-- // Define attributes:- var positionLocation =- gl.getAttribLocation(program, 'a_position'),- sizeLocation =- gl.getAttribLocation(program, 'a_size'),- colorLocation =- gl.getAttribLocation(program, 'a_color'),- resolutionLocation =- gl.getUniformLocation(program, 'u_resolution'),- matrixLocation =- gl.getUniformLocation(program, 'u_matrix'),- ratioLocation =- gl.getUniformLocation(program, 'u_ratio'),- scaleLocation =- gl.getUniformLocation(program, 'u_scale');-- buffer = gl.createBuffer();- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);- gl.bufferData(gl.ARRAY_BUFFER, data, gl.DYNAMIC_DRAW);-- gl.uniform2f(resolutionLocation, params.width, params.height);- gl.uniform1f(- ratioLocation,- 1 / Math.pow(params.ratio, params.settings('nodesPowRatio'))- );- gl.uniform1f(scaleLocation, params.scalingRatio);- gl.uniformMatrix3fv(matrixLocation, false, params.matrix);-- gl.enableVertexAttribArray(positionLocation);- gl.enableVertexAttribArray(sizeLocation);- gl.enableVertexAttribArray(colorLocation);-- gl.vertexAttribPointer(- positionLocation,- 2,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 0- );- gl.vertexAttribPointer(- sizeLocation,- 1,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 8- );- gl.vertexAttribPointer(- colorLocation,- 1,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 12- );-- gl.drawArrays(- gl.POINTS,- params.start || 0,- params.count || (data.length / this.ATTRIBUTES)- );- },- initProgram: function(gl) {- var vertexShader,- fragmentShader,- program;-- vertexShader = sigma.utils.loadShader(- gl,- [- 'attribute vec2 a_position;',- 'attribute float a_size;',- 'attribute float a_color;',-- 'uniform vec2 u_resolution;',- 'uniform float u_ratio;',- 'uniform float u_scale;',- 'uniform mat3 u_matrix;',-- 'varying vec4 color;',-- 'void main() {',- // Scale from [[-1 1] [-1 1]] to the container:- 'gl_Position = vec4(',- '((u_matrix * vec3(a_position, 1)).xy /',- 'u_resolution * 2.0 - 1.0) * vec2(1, -1),',- '0,',- '1',- ');',-- // Multiply the point size twice:- // - x SCALING_RATIO to correct the canvas scaling- // - x 2 to correct the formulae- 'gl_PointSize = a_size * u_ratio * u_scale * 2.0;',-- // Extract the color:- 'float c = a_color;',- 'color.b = mod(c, 256.0); c = floor(c / 256.0);',- 'color.g = mod(c, 256.0); c = floor(c / 256.0);',- 'color.r = mod(c, 256.0); c = floor(c / 256.0); color /= 255.0;',- 'color.a = 1.0;',- '}'- ].join('\n'),- gl.VERTEX_SHADER- );-- fragmentShader = sigma.utils.loadShader(- gl,- [- 'precision mediump float;',-- 'varying vec4 color;',-- 'void main(void) {',- 'gl_FragColor = color;',- '}'- ].join('\n'),- gl.FRAGMENT_SHADER- );-- program = sigma.utils.loadProgram(gl, [vertexShader, fragmentShader]);-- return program;- }- };-})();--;(function() {- 'use strict';-- sigma.utils.pkg('sigma.webgl.edges');-- /**- * This edge renderer will display edges as lines going from the source node- * to the target node. To deal with edge thicknesses, the lines are made of- * two triangles forming rectangles, with the gl.TRIANGLES drawing mode.- *- * It is expensive, since drawing a single edge requires 6 points, each- * having 7 attributes (source position, target position, thickness, color- * and a flag indicating which vertice of the rectangle it is).- */- sigma.webgl.edges.def = {- POINTS: 6,- ATTRIBUTES: 7,- addEdge: function(edge, source, target, data, i, prefix, settings) {- var w = (edge[prefix + 'size'] || 1) / 2,- x1 = source[prefix + 'x'],- y1 = source[prefix + 'y'],- x2 = target[prefix + 'x'],- y2 = target[prefix + 'y'],- color = edge.color;-- if (!color)- switch (settings('edgeColor')) {- case 'source':- color = source.color || settings('defaultNodeColor');- break;- case 'target':- color = target.color || settings('defaultNodeColor');- break;- default:- color = settings('defaultEdgeColor');- break;- }-- // Normalize color:- color = sigma.utils.floatColor(color);-- data[i++] = x1;- data[i++] = y1;- data[i++] = x2;- data[i++] = y2;- data[i++] = w;- data[i++] = 0.0;- data[i++] = color;-- data[i++] = x2;- data[i++] = y2;- data[i++] = x1;- data[i++] = y1;- data[i++] = w;- data[i++] = 1.0;- data[i++] = color;-- data[i++] = x2;- data[i++] = y2;- data[i++] = x1;- data[i++] = y1;- data[i++] = w;- data[i++] = 0.0;- data[i++] = color;-- data[i++] = x2;- data[i++] = y2;- data[i++] = x1;- data[i++] = y1;- data[i++] = w;- data[i++] = 0.0;- data[i++] = color;-- data[i++] = x1;- data[i++] = y1;- data[i++] = x2;- data[i++] = y2;- data[i++] = w;- data[i++] = 1.0;- data[i++] = color;-- data[i++] = x1;- data[i++] = y1;- data[i++] = x2;- data[i++] = y2;- data[i++] = w;- data[i++] = 0.0;- data[i++] = color;- },- render: function(gl, program, data, params) {- var buffer;-- // Define attributes:- var colorLocation =- gl.getAttribLocation(program, 'a_color'),- positionLocation1 =- gl.getAttribLocation(program, 'a_position1'),- positionLocation2 =- gl.getAttribLocation(program, 'a_position2'),- thicknessLocation =- gl.getAttribLocation(program, 'a_thickness'),- minusLocation =- gl.getAttribLocation(program, 'a_minus'),- resolutionLocation =- gl.getUniformLocation(program, 'u_resolution'),- matrixLocation =- gl.getUniformLocation(program, 'u_matrix'),- matrixHalfPiLocation =- gl.getUniformLocation(program, 'u_matrixHalfPi'),- matrixHalfPiMinusLocation =- gl.getUniformLocation(program, 'u_matrixHalfPiMinus'),- ratioLocation =- gl.getUniformLocation(program, 'u_ratio'),- scaleLocation =- gl.getUniformLocation(program, 'u_scale');-- buffer = gl.createBuffer();- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);- gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);-- gl.uniform2f(resolutionLocation, params.width, params.height);- gl.uniform1f(- ratioLocation,- params.ratio / Math.pow(params.ratio, params.settings('edgesPowRatio'))- );- gl.uniform1f(scaleLocation, params.scalingRatio);- gl.uniformMatrix3fv(matrixLocation, false, params.matrix);- gl.uniformMatrix2fv(- matrixHalfPiLocation,- false,- sigma.utils.matrices.rotation(Math.PI / 2, true)- );- gl.uniformMatrix2fv(- matrixHalfPiMinusLocation,- false,- sigma.utils.matrices.rotation(-Math.PI / 2, true)- );-- gl.enableVertexAttribArray(colorLocation);- gl.enableVertexAttribArray(positionLocation1);- gl.enableVertexAttribArray(positionLocation2);- gl.enableVertexAttribArray(thicknessLocation);- gl.enableVertexAttribArray(minusLocation);-- gl.vertexAttribPointer(positionLocation1,- 2,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 0- );- gl.vertexAttribPointer(positionLocation2,- 2,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 8- );- gl.vertexAttribPointer(thicknessLocation,- 1,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 16- );- gl.vertexAttribPointer(minusLocation,- 1,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 20- );- gl.vertexAttribPointer(colorLocation,- 1,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 24- );-- gl.drawArrays(- gl.TRIANGLES,- params.start || 0,- params.count || (data.length / this.ATTRIBUTES)- );- },- initProgram: function(gl) {- var vertexShader,- fragmentShader,- program;-- vertexShader = sigma.utils.loadShader(- gl,- [- 'attribute vec2 a_position1;',- 'attribute vec2 a_position2;',- 'attribute float a_thickness;',- 'attribute float a_minus;',- 'attribute float a_color;',-- 'uniform vec2 u_resolution;',- 'uniform float u_ratio;',- 'uniform float u_scale;',- 'uniform mat3 u_matrix;',- 'uniform mat2 u_matrixHalfPi;',- 'uniform mat2 u_matrixHalfPiMinus;',-- 'varying vec4 color;',-- 'void main() {',- // Find the good point:- 'vec2 position = a_thickness * u_ratio *',- 'normalize(a_position2 - a_position1);',-- 'mat2 matrix = a_minus * u_matrixHalfPiMinus +',- '(1.0 - a_minus) * u_matrixHalfPi;',-- 'position = matrix * position + a_position1;',-- // Scale from [[-1 1] [-1 1]] to the container:- 'gl_Position = vec4(',- '((u_matrix * vec3(position, 1)).xy /',- 'u_resolution * 2.0 - 1.0) * vec2(1, -1),',- '0,',- '1',- ');',-- // Extract the color:- 'float c = a_color;',- 'color.b = mod(c, 256.0); c = floor(c / 256.0);',- 'color.g = mod(c, 256.0); c = floor(c / 256.0);',- 'color.r = mod(c, 256.0); c = floor(c / 256.0); color /= 255.0;',- 'color.a = 1.0;',- '}'- ].join('\n'),- gl.VERTEX_SHADER- );-- fragmentShader = sigma.utils.loadShader(- gl,- [- 'precision mediump float;',-- 'varying vec4 color;',-- 'void main(void) {',- 'gl_FragColor = color;',- '}'- ].join('\n'),- gl.FRAGMENT_SHADER- );-- program = sigma.utils.loadProgram(gl, [vertexShader, fragmentShader]);-- return program;- }- };-})();--;(function() {- 'use strict';-- sigma.utils.pkg('sigma.webgl.edges');-- /**- * This edge renderer will display edges as lines with the gl.LINES display- * mode. Since this mode does not support well thickness, edges are all drawn- * with the same thickness (3px), independantly of the edge attributes or the- * zooming ratio.- */- sigma.webgl.edges.fast = {- POINTS: 2,- ATTRIBUTES: 3,- addEdge: function(edge, source, target, data, i, prefix, settings) {- var w = (edge[prefix + 'size'] || 1) / 2,- x1 = source[prefix + 'x'],- y1 = source[prefix + 'y'],- x2 = target[prefix + 'x'],- y2 = target[prefix + 'y'],- color = edge.color;-- if (!color)- switch (settings('edgeColor')) {- case 'source':- color = source.color || settings('defaultNodeColor');- break;- case 'target':- color = target.color || settings('defaultNodeColor');- break;- default:- color = settings('defaultEdgeColor');- break;- }-- // Normalize color:- color = sigma.utils.floatColor(color);-- data[i++] = x1;- data[i++] = y1;- data[i++] = color;-- data[i++] = x2;- data[i++] = y2;- data[i++] = color;- },- render: function(gl, program, data, params) {- var buffer;-- // Define attributes:- var colorLocation =- gl.getAttribLocation(program, 'a_color'),- positionLocation =- gl.getAttribLocation(program, 'a_position'),- resolutionLocation =- gl.getUniformLocation(program, 'u_resolution'),- matrixLocation =- gl.getUniformLocation(program, 'u_matrix');-- buffer = gl.createBuffer();- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);- gl.bufferData(gl.ARRAY_BUFFER, data, gl.DYNAMIC_DRAW);-- gl.uniform2f(resolutionLocation, params.width, params.height);- gl.uniformMatrix3fv(matrixLocation, false, params.matrix);-- gl.enableVertexAttribArray(positionLocation);- gl.enableVertexAttribArray(colorLocation);-- gl.vertexAttribPointer(positionLocation,- 2,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 0- );- gl.vertexAttribPointer(colorLocation,- 1,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 8- );-- gl.lineWidth(3);- gl.drawArrays(- gl.LINES,- params.start || 0,- params.count || (data.length / this.ATTRIBUTES)- );- },- initProgram: function(gl) {- var vertexShader,- fragmentShader,- program;-- vertexShader = sigma.utils.loadShader(- gl,- [- 'attribute vec2 a_position;',- 'attribute float a_color;',-- 'uniform vec2 u_resolution;',- 'uniform mat3 u_matrix;',-- 'varying vec4 color;',-- 'void main() {',- // Scale from [[-1 1] [-1 1]] to the container:- 'gl_Position = vec4(',- '((u_matrix * vec3(a_position, 1)).xy /',- 'u_resolution * 2.0 - 1.0) * vec2(1, -1),',- '0,',- '1',- ');',-- // Extract the color:- 'float c = a_color;',- 'color.b = mod(c, 256.0); c = floor(c / 256.0);',- 'color.g = mod(c, 256.0); c = floor(c / 256.0);',- 'color.r = mod(c, 256.0); c = floor(c / 256.0); color /= 255.0;',- 'color.a = 1.0;',- '}'- ].join('\n'),- gl.VERTEX_SHADER- );-- fragmentShader = sigma.utils.loadShader(- gl,- [- 'precision mediump float;',-- 'varying vec4 color;',-- 'void main(void) {',- 'gl_FragColor = color;',- '}'- ].join('\n'),- gl.FRAGMENT_SHADER- );-- program = sigma.utils.loadProgram(gl, [vertexShader, fragmentShader]);-- return program;- }- };-})();--;(function() {- 'use strict';-- sigma.utils.pkg('sigma.webgl.edges');-- /**- * This edge renderer will display edges as arrows going from the source node- * to the target node. To deal with edge thicknesses, the lines are made of- * three triangles: two forming rectangles, with the gl.TRIANGLES drawing- * mode.- *- * It is expensive, since drawing a single edge requires 9 points, each- * having a lot of attributes.- */- sigma.webgl.edges.arrow = {- POINTS: 9,- ATTRIBUTES: 11,- addEdge: function(edge, source, target, data, i, prefix, settings) {- var w = (edge[prefix + 'size'] || 1) / 2,- x1 = source[prefix + 'x'],- y1 = source[prefix + 'y'],- x2 = target[prefix + 'x'],- y2 = target[prefix + 'y'],- targetSize = target[prefix + 'size'],- color = edge.color;-- if (!color)- switch (settings('edgeColor')) {- case 'source':- color = source.color || settings('defaultNodeColor');- break;- case 'target':- color = target.color || settings('defaultNodeColor');- break;- default:- color = settings('defaultEdgeColor');- break;- }-- // Normalize color:- color = sigma.utils.floatColor(color);-- data[i++] = x1;- data[i++] = y1;- data[i++] = x2;- data[i++] = y2;- data[i++] = w;- data[i++] = targetSize;- data[i++] = 0.0;- data[i++] = 0.0;- data[i++] = 0.0;- data[i++] = 0.0;- data[i++] = color;-- data[i++] = x2;- data[i++] = y2;- data[i++] = x1;- data[i++] = y1;- data[i++] = w;- data[i++] = targetSize;- data[i++] = 1.0;- data[i++] = 1.0;- data[i++] = 0.0;- data[i++] = 0.0;- data[i++] = color;-- data[i++] = x2;- data[i++] = y2;- data[i++] = x1;- data[i++] = y1;- data[i++] = w;- data[i++] = targetSize;- data[i++] = 1.0;- data[i++] = 0.0;- data[i++] = 0.0;- data[i++] = 0.0;- data[i++] = color;-- data[i++] = x2;- data[i++] = y2;- data[i++] = x1;- data[i++] = y1;- data[i++] = w;- data[i++] = targetSize;- data[i++] = 1.0;- data[i++] = 0.0;- data[i++] = 0.0;- data[i++] = 0.0;- data[i++] = color;-- data[i++] = x1;- data[i++] = y1;- data[i++] = x2;- data[i++] = y2;- data[i++] = w;- data[i++] = targetSize;- data[i++] = 0.0;- data[i++] = 1.0;- data[i++] = 0.0;- data[i++] = 0.0;- data[i++] = color;-- data[i++] = x1;- data[i++] = y1;- data[i++] = x2;- data[i++] = y2;- data[i++] = w;- data[i++] = targetSize;- data[i++] = 0.0;- data[i++] = 0.0;- data[i++] = 0.0;- data[i++] = 0.0;- data[i++] = color;-- // Arrow head:- data[i++] = x2;- data[i++] = y2;- data[i++] = x1;- data[i++] = y1;- data[i++] = w;- data[i++] = targetSize;- data[i++] = 1.0;- data[i++] = 0.0;- data[i++] = 1.0;- data[i++] = -1.0;- data[i++] = color;-- data[i++] = x2;- data[i++] = y2;- data[i++] = x1;- data[i++] = y1;- data[i++] = w;- data[i++] = targetSize;- data[i++] = 1.0;- data[i++] = 0.0;- data[i++] = 1.0;- data[i++] = 0.0;- data[i++] = color;-- data[i++] = x2;- data[i++] = y2;- data[i++] = x1;- data[i++] = y1;- data[i++] = w;- data[i++] = targetSize;- data[i++] = 1.0;- data[i++] = 0.0;- data[i++] = 1.0;- data[i++] = 1.0;- data[i++] = color;- },- render: function(gl, program, data, params) {- var buffer;-- // Define attributes:- var positionLocation1 =- gl.getAttribLocation(program, 'a_pos1'),- positionLocation2 =- gl.getAttribLocation(program, 'a_pos2'),- thicknessLocation =- gl.getAttribLocation(program, 'a_thickness'),- targetSizeLocation =- gl.getAttribLocation(program, 'a_tSize'),- delayLocation =- gl.getAttribLocation(program, 'a_delay'),- minusLocation =- gl.getAttribLocation(program, 'a_minus'),- headLocation =- gl.getAttribLocation(program, 'a_head'),- headPositionLocation =- gl.getAttribLocation(program, 'a_headPosition'),- colorLocation =- gl.getAttribLocation(program, 'a_color'),- resolutionLocation =- gl.getUniformLocation(program, 'u_resolution'),- matrixLocation =- gl.getUniformLocation(program, 'u_matrix'),- matrixHalfPiLocation =- gl.getUniformLocation(program, 'u_matrixHalfPi'),- matrixHalfPiMinusLocation =- gl.getUniformLocation(program, 'u_matrixHalfPiMinus'),- ratioLocation =- gl.getUniformLocation(program, 'u_ratio'),- nodeRatioLocation =- gl.getUniformLocation(program, 'u_nodeRatio'),- arrowHeadLocation =- gl.getUniformLocation(program, 'u_arrowHead'),- scaleLocation =- gl.getUniformLocation(program, 'u_scale');-- buffer = gl.createBuffer();- gl.bindBuffer(gl.ARRAY_BUFFER, buffer);- gl.bufferData(gl.ARRAY_BUFFER, data, gl.STATIC_DRAW);-- gl.uniform2f(resolutionLocation, params.width, params.height);- gl.uniform1f(- ratioLocation,- params.ratio / Math.pow(params.ratio, params.settings('edgesPowRatio'))- );- gl.uniform1f(- nodeRatioLocation,- Math.pow(params.ratio, params.settings('nodesPowRatio')) /- params.ratio- );- gl.uniform1f(arrowHeadLocation, 5.0);- gl.uniform1f(scaleLocation, params.scalingRatio);- gl.uniformMatrix3fv(matrixLocation, false, params.matrix);- gl.uniformMatrix2fv(- matrixHalfPiLocation,- false,- sigma.utils.matrices.rotation(Math.PI / 2, true)- );- gl.uniformMatrix2fv(- matrixHalfPiMinusLocation,- false,- sigma.utils.matrices.rotation(-Math.PI / 2, true)- );-- gl.enableVertexAttribArray(positionLocation1);- gl.enableVertexAttribArray(positionLocation2);- gl.enableVertexAttribArray(thicknessLocation);- gl.enableVertexAttribArray(targetSizeLocation);- gl.enableVertexAttribArray(delayLocation);- gl.enableVertexAttribArray(minusLocation);- gl.enableVertexAttribArray(headLocation);- gl.enableVertexAttribArray(headPositionLocation);- gl.enableVertexAttribArray(colorLocation);-- gl.vertexAttribPointer(positionLocation1,- 2,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 0- );- gl.vertexAttribPointer(positionLocation2,- 2,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 8- );- gl.vertexAttribPointer(thicknessLocation,- 1,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 16- );- gl.vertexAttribPointer(targetSizeLocation,- 1,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 20- );- gl.vertexAttribPointer(delayLocation,- 1,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 24- );- gl.vertexAttribPointer(minusLocation,- 1,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 28- );- gl.vertexAttribPointer(headLocation,- 1,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 32- );- gl.vertexAttribPointer(headPositionLocation,- 1,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 36- );- gl.vertexAttribPointer(colorLocation,- 1,- gl.FLOAT,- false,- this.ATTRIBUTES * Float32Array.BYTES_PER_ELEMENT,- 40- );-- gl.drawArrays(- gl.TRIANGLES,- params.start || 0,- params.count || (data.length / this.ATTRIBUTES)- );- },- initProgram: function(gl) {- var vertexShader,- fragmentShader,- program;-- vertexShader = sigma.utils.loadShader(- gl,- [- 'attribute vec2 a_pos1;',- 'attribute vec2 a_pos2;',- 'attribute float a_thickness;',- 'attribute float a_tSize;',- 'attribute float a_delay;',- 'attribute float a_minus;',- 'attribute float a_head;',- 'attribute float a_headPosition;',- 'attribute float a_color;',-- 'uniform vec2 u_resolution;',- 'uniform float u_ratio;',- 'uniform float u_nodeRatio;',- 'uniform float u_arrowHead;',- 'uniform float u_scale;',- 'uniform mat3 u_matrix;',- 'uniform mat2 u_matrixHalfPi;',- 'uniform mat2 u_matrixHalfPiMinus;',-- 'varying vec4 color;',-- 'void main() {',- // Find the good point:- 'vec2 pos = normalize(a_pos2 - a_pos1);',-- 'mat2 matrix = (1.0 - a_head) *',- '(',- 'a_minus * u_matrixHalfPiMinus +',- '(1.0 - a_minus) * u_matrixHalfPi',- ') + a_head * (',- 'a_headPosition * u_matrixHalfPiMinus * 0.6 +',- '(a_headPosition * a_headPosition - 1.0) * mat2(1.0)',- ');',-- 'pos = a_pos1 + (',- // Deal with body:- '(1.0 - a_head) * a_thickness * u_ratio * matrix * pos +',- // Deal with head:- 'a_head * u_arrowHead * a_thickness * u_ratio * matrix * pos +',- // Deal with delay:- 'a_delay * pos * (',- 'a_tSize / u_nodeRatio +',- 'u_arrowHead * a_thickness * u_ratio',- ')',- ');',-- // Scale from [[-1 1] [-1 1]] to the container:- 'gl_Position = vec4(',- '((u_matrix * vec3(pos, 1)).xy /',- 'u_resolution * 2.0 - 1.0) * vec2(1, -1),',- '0,',- '1',- ');',-- // Extract the color:- 'float c = a_color;',- 'color.b = mod(c, 256.0); c = floor(c / 256.0);',- 'color.g = mod(c, 256.0); c = floor(c / 256.0);',- 'color.r = mod(c, 256.0); c = floor(c / 256.0); color /= 255.0;',- 'color.a = 1.0;',- '}'- ].join('\n'),- gl.VERTEX_SHADER- );-- fragmentShader = sigma.utils.loadShader(- gl,- [- 'precision mediump float;',-- 'varying vec4 color;',-- 'void main(void) {',- 'gl_FragColor = color;',- '}'- ].join('\n'),- gl.FRAGMENT_SHADER- );-- program = sigma.utils.loadProgram(gl, [vertexShader, fragmentShader]);-- return program;- }- };-})();--;(function(undefined) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- // Initialize packages:- sigma.utils.pkg('sigma.canvas.labels');-- /**- * This label renderer will just display the label on the right of the node.- *- * @param {object} node The node object.- * @param {CanvasRenderingContext2D} context The canvas context.- * @param {configurable} settings The settings function.- */- sigma.canvas.labels.def = function(node, context, settings) {- var fontSize,- prefix = settings('prefix') || '',- size = node[prefix + 'size'];-- if (size < settings('labelThreshold'))- return;-- if (!node.label || typeof node.label !== 'string')- return;-- fontSize = (settings('labelSize') === 'fixed') ?- settings('defaultLabelSize') :- settings('labelSizeRatio') * size;-- context.font = (settings('fontStyle') ? settings('fontStyle') + ' ' : '') +- fontSize + 'px ' + settings('font');- context.fillStyle = (settings('labelColor') === 'node') ?- (node.color || settings('defaultNodeColor')) :- settings('defaultLabelColor');-- context.fillText(- node.label,- Math.round(node[prefix + 'x'] + size + 3),- Math.round(node[prefix + 'y'] + fontSize / 3)- );- };-}).call(this);--;(function(undefined) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- // Initialize packages:- sigma.utils.pkg('sigma.canvas.hovers');-- /**- * This hover renderer will basically display the label with a background.- *- * @param {object} node The node object.- * @param {CanvasRenderingContext2D} context The canvas context.- * @param {configurable} settings The settings function.- */- sigma.canvas.hovers.def = function(node, context, settings) {- var x,- y,- w,- h,- e,- fontStyle = settings('hoverFontStyle') || settings('fontStyle'),- prefix = settings('prefix') || '',- size = node[prefix + 'size'],- fontSize = (settings('labelSize') === 'fixed') ?- settings('defaultLabelSize') :- settings('labelSizeRatio') * size;-- // Label background:- context.font = (fontStyle ? fontStyle + ' ' : '') +- fontSize + 'px ' + (settings('hoverFont') || settings('font'));-- context.beginPath();- context.fillStyle = settings('labelHoverBGColor') === 'node' ?- (node.color || settings('defaultNodeColor')) :- settings('defaultHoverLabelBGColor');-- if (node.label && settings('labelHoverShadow')) {- context.shadowOffsetX = 0;- context.shadowOffsetY = 0;- context.shadowBlur = 8;- context.shadowColor = settings('labelHoverShadowColor');- }-- if (node.label && typeof node.label === 'string') {- x = Math.round(node[prefix + 'x'] - fontSize / 2 - 2);- y = Math.round(node[prefix + 'y'] - fontSize / 2 - 2);- w = Math.round(- context.measureText(node.label).width + fontSize / 2 + size + 7- );- h = Math.round(fontSize + 4);- e = Math.round(fontSize / 2 + 2);-- context.moveTo(x, y + e);- context.arcTo(x, y, x + e, y, e);- context.lineTo(x + w, y);- context.lineTo(x + w, y + h);- context.lineTo(x + e, y + h);- context.arcTo(x, y + h, x, y + h - e, e);- context.lineTo(x, y + e);-- context.closePath();- context.fill();-- context.shadowOffsetX = 0;- context.shadowOffsetY = 0;- context.shadowBlur = 0;- }-- // Node border:- if (settings('borderSize') > 0) {- context.beginPath();- context.fillStyle = settings('nodeBorderColor') === 'node' ?- (node.color || settings('defaultNodeColor')) :- settings('defaultNodeBorderColor');- context.arc(- node[prefix + 'x'],- node[prefix + 'y'],- size + settings('borderSize'),- 0,- Math.PI * 2,- true- );- context.closePath();- context.fill();- }-- // Node:- var nodeRenderer = sigma.canvas.nodes[node.type] || sigma.canvas.nodes.def;- nodeRenderer(node, context, settings);-- // Display the label:- if (node.label && typeof node.label === 'string') {- context.fillStyle = (settings('labelHoverColor') === 'node') ?- (node.color || settings('defaultNodeColor')) :- settings('defaultLabelHoverColor');-- context.fillText(- node.label,- Math.round(node[prefix + 'x'] + size + 3),- Math.round(node[prefix + 'y'] + fontSize / 3)- );- }- };-}).call(this);--;(function() {- 'use strict';-- sigma.utils.pkg('sigma.canvas.nodes');-- /**- * The default node renderer. It renders the node as a simple disc.- *- * @param {object} node The node object.- * @param {CanvasRenderingContext2D} context The canvas context.- * @param {configurable} settings The settings function.- */- sigma.canvas.nodes.def = function(node, context, settings) {- var prefix = settings('prefix') || '';-- context.fillStyle = node.color || settings('defaultNodeColor');- context.beginPath();- context.arc(- node[prefix + 'x'],- node[prefix + 'y'],- node[prefix + 'size'],- 0,- Math.PI * 2,- true- );-- context.closePath();- context.fill();- };-})();--;(function() {- 'use strict';-- sigma.utils.pkg('sigma.canvas.edges');-- /**- * The default edge renderer. It renders the edge as a simple line.- *- * @param {object} edge The edge object.- * @param {object} source node The edge source node.- * @param {object} target node The edge target node.- * @param {CanvasRenderingContext2D} context The canvas context.- * @param {configurable} settings The settings function.- */- sigma.canvas.edges.def = function(edge, source, target, context, settings) {- var color = edge.color,- prefix = settings('prefix') || '',- size = edge[prefix + 'size'] || 1,- edgeColor = settings('edgeColor'),- defaultNodeColor = settings('defaultNodeColor'),- defaultEdgeColor = settings('defaultEdgeColor');-- if (!color)- switch (edgeColor) {- case 'source':- color = source.color || defaultNodeColor;- break;- case 'target':- color = target.color || defaultNodeColor;- break;- default:- color = defaultEdgeColor;- break;- }-- context.strokeStyle = color;- context.lineWidth = size;- context.beginPath();- context.moveTo(- source[prefix + 'x'],- source[prefix + 'y']- );- context.lineTo(- target[prefix + 'x'],- target[prefix + 'y']- );- context.stroke();- };-})();--;(function() {- 'use strict';-- sigma.utils.pkg('sigma.canvas.edges');-- /**- * This edge renderer will display edges as curves.- *- * @param {object} edge The edge object.- * @param {object} source node The edge source node.- * @param {object} target node The edge target node.- * @param {CanvasRenderingContext2D} context The canvas context.- * @param {configurable} settings The settings function.- */- sigma.canvas.edges.curve = function(edge, source, target, context, settings) {- var color = edge.color,- prefix = settings('prefix') || '',- size = edge[prefix + 'size'] || 1,- edgeColor = settings('edgeColor'),- defaultNodeColor = settings('defaultNodeColor'),- defaultEdgeColor = settings('defaultEdgeColor'),- cp = {},- sSize = source[prefix + 'size'],- sX = source[prefix + 'x'],- sY = source[prefix + 'y'],- tX = target[prefix + 'x'],- tY = target[prefix + 'y'];-- cp = (source.id === target.id) ?- sigma.utils.getSelfLoopControlPoints(sX, sY, sSize) :- sigma.utils.getQuadraticControlPoint(sX, sY, tX, tY);-- if (!color)- switch (edgeColor) {- case 'source':- color = source.color || defaultNodeColor;- break;- case 'target':- color = target.color || defaultNodeColor;- break;- default:- color = defaultEdgeColor;- break;- }-- context.strokeStyle = color;- context.lineWidth = size;- context.beginPath();- context.moveTo(sX, sY);- if (source.id === target.id) {- context.bezierCurveTo(cp.x1, cp.y1, cp.x2, cp.y2, tX, tY);- } else {- context.quadraticCurveTo(cp.x, cp.y, tX, tY);- }- context.stroke();- };-})();--;(function() {- 'use strict';-- sigma.utils.pkg('sigma.canvas.edges');-- /**- * This edge renderer will display edges as arrows going from the source node- *- * @param {object} edge The edge object.- * @param {object} source node The edge source node.- * @param {object} target node The edge target node.- * @param {CanvasRenderingContext2D} context The canvas context.- * @param {configurable} settings The settings function.- */- sigma.canvas.edges.arrow = function(edge, source, target, context, settings) {- var color = edge.color,- prefix = settings('prefix') || '',- edgeColor = settings('edgeColor'),- defaultNodeColor = settings('defaultNodeColor'),- defaultEdgeColor = settings('defaultEdgeColor'),- size = edge[prefix + 'size'] || 1,- tSize = target[prefix + 'size'],- sX = source[prefix + 'x'],- sY = source[prefix + 'y'],- tX = target[prefix + 'x'],- tY = target[prefix + 'y'],- aSize = Math.max(size * 2.5, settings('minArrowSize')),- d = Math.sqrt(Math.pow(tX - sX, 2) + Math.pow(tY - sY, 2)),- aX = sX + (tX - sX) * (d - aSize - tSize) / d,- aY = sY + (tY - sY) * (d - aSize - tSize) / d,- vX = (tX - sX) * aSize / d,- vY = (tY - sY) * aSize / d;-- if (!color)- switch (edgeColor) {- case 'source':- color = source.color || defaultNodeColor;- break;- case 'target':- color = target.color || defaultNodeColor;- break;- default:- color = defaultEdgeColor;- break;- }-- context.strokeStyle = color;- context.lineWidth = size;- context.beginPath();- context.moveTo(sX, sY);- context.lineTo(- aX,- aY- );- context.stroke();-- context.fillStyle = color;- context.beginPath();- context.moveTo(aX + vX, aY + vY);- context.lineTo(aX + vY * 0.6, aY - vX * 0.6);- context.lineTo(aX - vY * 0.6, aY + vX * 0.6);- context.lineTo(aX + vX, aY + vY);- context.closePath();- context.fill();- };-})();--;(function() {- 'use strict';-- sigma.utils.pkg('sigma.canvas.edges');-- /**- * This edge renderer will display edges as curves with arrow heading.- *- * @param {object} edge The edge object.- * @param {object} source node The edge source node.- * @param {object} target node The edge target node.- * @param {CanvasRenderingContext2D} context The canvas context.- * @param {configurable} settings The settings function.- */- sigma.canvas.edges.curvedArrow =- function(edge, source, target, context, settings) {- var color = edge.color,- prefix = settings('prefix') || '',- edgeColor = settings('edgeColor'),- defaultNodeColor = settings('defaultNodeColor'),- defaultEdgeColor = settings('defaultEdgeColor'),- cp = {},- size = edge[prefix + 'size'] || 1,- tSize = target[prefix + 'size'],- sX = source[prefix + 'x'],- sY = source[prefix + 'y'],- tX = target[prefix + 'x'],- tY = target[prefix + 'y'],- aSize = Math.max(size * 2.5, settings('minArrowSize')),- d,- aX,- aY,- vX,- vY;-- cp = (source.id === target.id) ?- sigma.utils.getSelfLoopControlPoints(sX, sY, tSize) :- sigma.utils.getQuadraticControlPoint(sX, sY, tX, tY);-- if (source.id === target.id) {- d = Math.sqrt(Math.pow(tX - cp.x1, 2) + Math.pow(tY - cp.y1, 2));- aX = cp.x1 + (tX - cp.x1) * (d - aSize - tSize) / d;- aY = cp.y1 + (tY - cp.y1) * (d - aSize - tSize) / d;- vX = (tX - cp.x1) * aSize / d;- vY = (tY - cp.y1) * aSize / d;- }- else {- d = Math.sqrt(Math.pow(tX - cp.x, 2) + Math.pow(tY - cp.y, 2));- aX = cp.x + (tX - cp.x) * (d - aSize - tSize) / d;- aY = cp.y + (tY - cp.y) * (d - aSize - tSize) / d;- vX = (tX - cp.x) * aSize / d;- vY = (tY - cp.y) * aSize / d;- }-- if (!color)- switch (edgeColor) {- case 'source':- color = source.color || defaultNodeColor;- break;- case 'target':- color = target.color || defaultNodeColor;- break;- default:- color = defaultEdgeColor;- break;- }-- context.strokeStyle = color;- context.lineWidth = size;- context.beginPath();- context.moveTo(sX, sY);- if (source.id === target.id) {- context.bezierCurveTo(cp.x2, cp.y2, cp.x1, cp.y1, aX, aY);- } else {- context.quadraticCurveTo(cp.x, cp.y, aX, aY);- }- context.stroke();-- context.fillStyle = color;- context.beginPath();- context.moveTo(aX + vX, aY + vY);- context.lineTo(aX + vY * 0.6, aY - vX * 0.6);- context.lineTo(aX - vY * 0.6, aY + vX * 0.6);- context.lineTo(aX + vX, aY + vY);- context.closePath();- context.fill();- };-})();--;(function() {- 'use strict';-- sigma.utils.pkg('sigma.canvas.edgehovers');-- /**- * This hover renderer will display the edge with a different color or size.- *- * @param {object} edge The edge object.- * @param {object} source node The edge source node.- * @param {object} target node The edge target node.- * @param {CanvasRenderingContext2D} context The canvas context.- * @param {configurable} settings The settings function.- */- sigma.canvas.edgehovers.def =- function(edge, source, target, context, settings) {- var color = edge.color,- prefix = settings('prefix') || '',- size = edge[prefix + 'size'] || 1,- edgeColor = settings('edgeColor'),- defaultNodeColor = settings('defaultNodeColor'),- defaultEdgeColor = settings('defaultEdgeColor');-- if (!color)- switch (edgeColor) {- case 'source':- color = source.color || defaultNodeColor;- break;- case 'target':- color = target.color || defaultNodeColor;- break;- default:- color = defaultEdgeColor;- break;- }-- if (settings('edgeHoverColor') === 'edge') {- color = edge.hover_color || color;- } else {- color = edge.hover_color || settings('defaultEdgeHoverColor') || color;- }- size *= settings('edgeHoverSizeRatio');-- context.strokeStyle = color;- context.lineWidth = size;- context.beginPath();- context.moveTo(- source[prefix + 'x'],- source[prefix + 'y']- );- context.lineTo(- target[prefix + 'x'],- target[prefix + 'y']- );- context.stroke();- };-})();--;(function() {- 'use strict';-- sigma.utils.pkg('sigma.canvas.edgehovers');-- /**- * This hover renderer will display the edge with a different color or size.- *- * @param {object} edge The edge object.- * @param {object} source node The edge source node.- * @param {object} target node The edge target node.- * @param {CanvasRenderingContext2D} context The canvas context.- * @param {configurable} settings The settings function.- */- sigma.canvas.edgehovers.curve =- function(edge, source, target, context, settings) {- var color = edge.color,- prefix = settings('prefix') || '',- size = settings('edgeHoverSizeRatio') * (edge[prefix + 'size'] || 1),- edgeColor = settings('edgeColor'),- defaultNodeColor = settings('defaultNodeColor'),- defaultEdgeColor = settings('defaultEdgeColor'),- cp = {},- sSize = source[prefix + 'size'],- sX = source[prefix + 'x'],- sY = source[prefix + 'y'],- tX = target[prefix + 'x'],- tY = target[prefix + 'y'];-- cp = (source.id === target.id) ?- sigma.utils.getSelfLoopControlPoints(sX, sY, sSize) :- sigma.utils.getQuadraticControlPoint(sX, sY, tX, tY);-- if (!color)- switch (edgeColor) {- case 'source':- color = source.color || defaultNodeColor;- break;- case 'target':- color = target.color || defaultNodeColor;- break;- default:- color = defaultEdgeColor;- break;- }-- if (settings('edgeHoverColor') === 'edge') {- color = edge.hover_color || color;- } else {- color = edge.hover_color || settings('defaultEdgeHoverColor') || color;- }-- context.strokeStyle = color;- context.lineWidth = size;- context.beginPath();- context.moveTo(sX, sY);- if (source.id === target.id) {- context.bezierCurveTo(cp.x1, cp.y1, cp.x2, cp.y2, tX, tY);- } else {- context.quadraticCurveTo(cp.x, cp.y, tX, tY);- }- context.stroke();- };-})();--;(function() {- 'use strict';-- sigma.utils.pkg('sigma.canvas.edgehovers');-- /**- * This hover renderer will display the edge with a different color or size.- *- * @param {object} edge The edge object.- * @param {object} source node The edge source node.- * @param {object} target node The edge target node.- * @param {CanvasRenderingContext2D} context The canvas context.- * @param {configurable} settings The settings function.- */- sigma.canvas.edgehovers.arrow =- function(edge, source, target, context, settings) {- var color = edge.color,- prefix = settings('prefix') || '',- edgeColor = settings('edgeColor'),- defaultNodeColor = settings('defaultNodeColor'),- defaultEdgeColor = settings('defaultEdgeColor'),- size = edge[prefix + 'size'] || 1,- tSize = target[prefix + 'size'],- sX = source[prefix + 'x'],- sY = source[prefix + 'y'],- tX = target[prefix + 'x'],- tY = target[prefix + 'y'];-- size = (edge.hover) ?- settings('edgeHoverSizeRatio') * size : size;- var aSize = size * 2.5,- d = Math.sqrt(Math.pow(tX - sX, 2) + Math.pow(tY - sY, 2)),- aX = sX + (tX - sX) * (d - aSize - tSize) / d,- aY = sY + (tY - sY) * (d - aSize - tSize) / d,- vX = (tX - sX) * aSize / d,- vY = (tY - sY) * aSize / d;-- if (!color)- switch (edgeColor) {- case 'source':- color = source.color || defaultNodeColor;- break;- case 'target':- color = target.color || defaultNodeColor;- break;- default:- color = defaultEdgeColor;- break;- }-- if (settings('edgeHoverColor') === 'edge') {- color = edge.hover_color || color;- } else {- color = edge.hover_color || settings('defaultEdgeHoverColor') || color;- }-- context.strokeStyle = color;- context.lineWidth = size;- context.beginPath();- context.moveTo(sX, sY);- context.lineTo(- aX,- aY- );- context.stroke();-- context.fillStyle = color;- context.beginPath();- context.moveTo(aX + vX, aY + vY);- context.lineTo(aX + vY * 0.6, aY - vX * 0.6);- context.lineTo(aX - vY * 0.6, aY + vX * 0.6);- context.lineTo(aX + vX, aY + vY);- context.closePath();- context.fill();- };-})();--;(function() {- 'use strict';-- sigma.utils.pkg('sigma.canvas.edgehovers');-- /**- * This hover renderer will display the edge with a different color or size.- *- * @param {object} edge The edge object.- * @param {object} source node The edge source node.- * @param {object} target node The edge target node.- * @param {CanvasRenderingContext2D} context The canvas context.- * @param {configurable} settings The settings function.- */- sigma.canvas.edgehovers.curvedArrow =- function(edge, source, target, context, settings) {- var color = edge.color,- prefix = settings('prefix') || '',- edgeColor = settings('edgeColor'),- defaultNodeColor = settings('defaultNodeColor'),- defaultEdgeColor = settings('defaultEdgeColor'),- cp = {},- size = settings('edgeHoverSizeRatio') * (edge[prefix + 'size'] || 1),- tSize = target[prefix + 'size'],- sX = source[prefix + 'x'],- sY = source[prefix + 'y'],- tX = target[prefix + 'x'],- tY = target[prefix + 'y'],- d,- aSize,- aX,- aY,- vX,- vY;-- cp = (source.id === target.id) ?- sigma.utils.getSelfLoopControlPoints(sX, sY, tSize) :- sigma.utils.getQuadraticControlPoint(sX, sY, tX, tY);-- if (source.id === target.id) {- d = Math.sqrt(Math.pow(tX - cp.x1, 2) + Math.pow(tY - cp.y1, 2));- aSize = size * 2.5;- aX = cp.x1 + (tX - cp.x1) * (d - aSize - tSize) / d;- aY = cp.y1 + (tY - cp.y1) * (d - aSize - tSize) / d;- vX = (tX - cp.x1) * aSize / d;- vY = (tY - cp.y1) * aSize / d;- }- else {- d = Math.sqrt(Math.pow(tX - cp.x, 2) + Math.pow(tY - cp.y, 2));- aSize = size * 2.5;- aX = cp.x + (tX - cp.x) * (d - aSize - tSize) / d;- aY = cp.y + (tY - cp.y) * (d - aSize - tSize) / d;- vX = (tX - cp.x) * aSize / d;- vY = (tY - cp.y) * aSize / d;- }-- if (!color)- switch (edgeColor) {- case 'source':- color = source.color || defaultNodeColor;- break;- case 'target':- color = target.color || defaultNodeColor;- break;- default:- color = defaultEdgeColor;- break;- }-- if (settings('edgeHoverColor') === 'edge') {- color = edge.hover_color || color;- } else {- color = edge.hover_color || settings('defaultEdgeHoverColor') || color;- }-- context.strokeStyle = color;- context.lineWidth = size;- context.beginPath();- context.moveTo(sX, sY);- if (source.id === target.id) {- context.bezierCurveTo(cp.x2, cp.y2, cp.x1, cp.y1, aX, aY);- } else {- context.quadraticCurveTo(cp.x, cp.y, aX, aY);- }- context.stroke();-- context.fillStyle = color;- context.beginPath();- context.moveTo(aX + vX, aY + vY);- context.lineTo(aX + vY * 0.6, aY - vX * 0.6);- context.lineTo(aX - vY * 0.6, aY + vX * 0.6);- context.lineTo(aX + vX, aY + vY);- context.closePath();- context.fill();- };-})();--;(function(undefined) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- // Initialize packages:- sigma.utils.pkg('sigma.canvas.extremities');-- /**- * The default renderer for hovered edge extremities. It renders the edge- * extremities as hovered.- *- * @param {object} edge The edge object.- * @param {object} source node The edge source node.- * @param {object} target node The edge target node.- * @param {CanvasRenderingContext2D} context The canvas context.- * @param {configurable} settings The settings function.- */- sigma.canvas.extremities.def =- function(edge, source, target, context, settings) {- // Source Node:- (- sigma.canvas.hovers[source.type] ||- sigma.canvas.hovers.def- ) (- source, context, settings- );-- // Target Node:- (- sigma.canvas.hovers[target.type] ||- sigma.canvas.hovers.def- ) (- target, context, settings- );- };-}).call(this);--;(function() {- 'use strict';-- sigma.utils.pkg('sigma.svg.utils');-- /**- * Some useful functions used by sigma's SVG renderer.- */- sigma.svg.utils = {-- /**- * SVG Element show.- *- * @param {DOMElement} element The DOM element to show.- */- show: function(element) {- element.style.display = '';- return this;- },-- /**- * SVG Element hide.- *- * @param {DOMElement} element The DOM element to hide.- */- hide: function(element) {- element.style.display = 'none';- return this;- }- };-})();--;(function() {- 'use strict';-- sigma.utils.pkg('sigma.svg.nodes');-- /**- * The default node renderer. It renders the node as a simple disc.- */- sigma.svg.nodes.def = {-- /**- * SVG Element creation.- *- * @param {object} node The node object.- * @param {configurable} settings The settings function.- */- create: function(node, settings) {- var prefix = settings('prefix') || '',- circle = document.createElementNS(settings('xmlns'), 'circle');-- // Defining the node's circle- circle.setAttributeNS(null, 'data-node-id', node.id);- circle.setAttributeNS(null, 'class', settings('classPrefix') + '-node');- circle.setAttributeNS(- null, 'fill', node.color || settings('defaultNodeColor'));-- // Returning the DOM Element- return circle;- },-- /**- * SVG Element update.- *- * @param {object} node The node object.- * @param {DOMElement} circle The node DOM element.- * @param {configurable} settings The settings function.- */- update: function(node, circle, settings) {- var prefix = settings('prefix') || '';-- // Applying changes- // TODO: optimize - check if necessary- circle.setAttributeNS(null, 'cx', node[prefix + 'x']);- circle.setAttributeNS(null, 'cy', node[prefix + 'y']);- circle.setAttributeNS(null, 'r', node[prefix + 'size']);-- // Updating only if not freestyle- if (!settings('freeStyle'))- circle.setAttributeNS(- null, 'fill', node.color || settings('defaultNodeColor'));-- // Showing- circle.style.display = '';-- return this;- }- };-})();--;(function() {- 'use strict';-- sigma.utils.pkg('sigma.svg.edges');-- /**- * The default edge renderer. It renders the node as a simple line.- */- sigma.svg.edges.def = {-- /**- * SVG Element creation.- *- * @param {object} edge The edge object.- * @param {object} source The source node object.- * @param {object} target The target node object.- * @param {configurable} settings The settings function.- */- create: function(edge, source, target, settings) {- var color = edge.color,- prefix = settings('prefix') || '',- edgeColor = settings('edgeColor'),- defaultNodeColor = settings('defaultNodeColor'),- defaultEdgeColor = settings('defaultEdgeColor');-- if (!color)- switch (edgeColor) {- case 'source':- color = source.color || defaultNodeColor;- break;- case 'target':- color = target.color || defaultNodeColor;- break;- default:- color = defaultEdgeColor;- break;- }-- var line = document.createElementNS(settings('xmlns'), 'line');-- // Attributes- line.setAttributeNS(null, 'data-edge-id', edge.id);- line.setAttributeNS(null, 'class', settings('classPrefix') + '-edge');- line.setAttributeNS(null, 'stroke', color);-- return line;- },-- /**- * SVG Element update.- *- * @param {object} edge The edge object.- * @param {DOMElement} line The line DOM Element.- * @param {object} source The source node object.- * @param {object} target The target node object.- * @param {configurable} settings The settings function.- */- update: function(edge, line, source, target, settings) {- var prefix = settings('prefix') || '';-- line.setAttributeNS(null, 'stroke-width', edge[prefix + 'size'] || 1);- line.setAttributeNS(null, 'x1', source[prefix + 'x']);- line.setAttributeNS(null, 'y1', source[prefix + 'y']);- line.setAttributeNS(null, 'x2', target[prefix + 'x']);- line.setAttributeNS(null, 'y2', target[prefix + 'y']);-- // Showing- line.style.display = '';-- return this;- }- };-})();--;(function() {- 'use strict';-- sigma.utils.pkg('sigma.svg.edges');-- /**- * The curve edge renderer. It renders the node as a bezier curve.- */- sigma.svg.edges.curve = {-- /**- * SVG Element creation.- *- * @param {object} edge The edge object.- * @param {object} source The source node object.- * @param {object} target The target node object.- * @param {configurable} settings The settings function.- */- create: function(edge, source, target, settings) {- var color = edge.color,- prefix = settings('prefix') || '',- edgeColor = settings('edgeColor'),- defaultNodeColor = settings('defaultNodeColor'),- defaultEdgeColor = settings('defaultEdgeColor');-- if (!color)- switch (edgeColor) {- case 'source':- color = source.color || defaultNodeColor;- break;- case 'target':- color = target.color || defaultNodeColor;- break;- default:- color = defaultEdgeColor;- break;- }-- var path = document.createElementNS(settings('xmlns'), 'path');-- // Attributes- path.setAttributeNS(null, 'data-edge-id', edge.id);- path.setAttributeNS(null, 'class', settings('classPrefix') + '-edge');- path.setAttributeNS(null, 'stroke', color);-- return path;- },-- /**- * SVG Element update.- *- * @param {object} edge The edge object.- * @param {DOMElement} line The line DOM Element.- * @param {object} source The source node object.- * @param {object} target The target node object.- * @param {configurable} settings The settings function.- */- update: function(edge, path, source, target, settings) {- var prefix = settings('prefix') || '';-- path.setAttributeNS(null, 'stroke-width', edge[prefix + 'size'] || 1);-- // Control point- var cx = (source[prefix + 'x'] + target[prefix + 'x']) / 2 +- (target[prefix + 'y'] - source[prefix + 'y']) / 4,- cy = (source[prefix + 'y'] + target[prefix + 'y']) / 2 +- (source[prefix + 'x'] - target[prefix + 'x']) / 4;-- // Path- var p = 'M' + source[prefix + 'x'] + ',' + source[prefix + 'y'] + ' ' +- 'Q' + cx + ',' + cy + ' ' +- target[prefix + 'x'] + ',' + target[prefix + 'y'];-- // Updating attributes- path.setAttributeNS(null, 'd', p);- path.setAttributeNS(null, 'fill', 'none');-- // Showing- path.style.display = '';-- return this;- }- };-})();--;(function(undefined) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- // Initialize packages:- sigma.utils.pkg('sigma.svg.labels');-- /**- * The default label renderer. It renders the label as a simple text.- */- sigma.svg.labels.def = {-- /**- * SVG Element creation.- *- * @param {object} node The node object.- * @param {configurable} settings The settings function.- */- create: function(node, settings) {- var prefix = settings('prefix') || '',- size = node[prefix + 'size'],- text = document.createElementNS(settings('xmlns'), 'text');-- var fontSize = (settings('labelSize') === 'fixed') ?- settings('defaultLabelSize') :- settings('labelSizeRatio') * size;-- var fontColor = (settings('labelColor') === 'node') ?- (node.color || settings('defaultNodeColor')) :- settings('defaultLabelColor');-- text.setAttributeNS(null, 'data-label-target', node.id);- text.setAttributeNS(null, 'class', settings('classPrefix') + '-label');- text.setAttributeNS(null, 'font-size', fontSize);- text.setAttributeNS(null, 'font-family', settings('font'));- text.setAttributeNS(null, 'fill', fontColor);-- text.innerHTML = node.label;- text.textContent = node.label;-- return text;- },-- /**- * SVG Element update.- *- * @param {object} node The node object.- * @param {DOMElement} text The label DOM element.- * @param {configurable} settings The settings function.- */- update: function(node, text, settings) {- var prefix = settings('prefix') || '',- size = node[prefix + 'size'];-- var fontSize = (settings('labelSize') === 'fixed') ?- settings('defaultLabelSize') :- settings('labelSizeRatio') * size;-- // Case when we don't want to display the label- if (!settings('forceLabels') && size < settings('labelThreshold'))- return;-- if (typeof node.label !== 'string')- return;-- // Updating- text.setAttributeNS(null, 'x',- Math.round(node[prefix + 'x'] + size + 3));- text.setAttributeNS(null, 'y',- Math.round(node[prefix + 'y'] + fontSize / 3));-- // Showing- text.style.display = '';-- return this;- }- };-}).call(this);--;(function(undefined) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- // Initialize packages:- sigma.utils.pkg('sigma.svg.hovers');-- /**- * The default hover renderer.- */- sigma.svg.hovers.def = {-- /**- * SVG Element creation.- *- * @param {object} node The node object.- * @param {CanvasElement} measurementCanvas A fake canvas handled by- * the svg to perform some measurements and- * passed by the renderer.- * @param {DOMElement} nodeCircle The node DOM Element.- * @param {configurable} settings The settings function.- */- create: function(node, nodeCircle, measurementCanvas, settings) {-- // Defining visual properties- var x,- y,- w,- h,- e,- d,- fontStyle = settings('hoverFontStyle') || settings('fontStyle'),- prefix = settings('prefix') || '',- size = node[prefix + 'size'],- fontSize = (settings('labelSize') === 'fixed') ?- settings('defaultLabelSize') :- settings('labelSizeRatio') * size,- fontColor = (settings('labelHoverColor') === 'node') ?- (node.color || settings('defaultNodeColor')) :- settings('defaultLabelHoverColor');-- // Creating elements- var group = document.createElementNS(settings('xmlns'), 'g'),- rectangle = document.createElementNS(settings('xmlns'), 'rect'),- circle = document.createElementNS(settings('xmlns'), 'circle'),- text = document.createElementNS(settings('xmlns'), 'text');-- // Defining properties- group.setAttributeNS(null, 'class', settings('classPrefix') + '-hover');- group.setAttributeNS(null, 'data-node-id', node.id);-- if (typeof node.label === 'string') {-- // Text- text.innerHTML = node.label;- text.textContent = node.label;- text.setAttributeNS(- null,- 'class',- settings('classPrefix') + '-hover-label');- text.setAttributeNS(null, 'font-size', fontSize);- text.setAttributeNS(null, 'font-family', settings('font'));- text.setAttributeNS(null, 'fill', fontColor);- text.setAttributeNS(null, 'x',- Math.round(node[prefix + 'x'] + size + 3));- text.setAttributeNS(null, 'y',- Math.round(node[prefix + 'y'] + fontSize / 3));-- // Measures- // OPTIMIZE: Find a better way than a measurement canvas- x = Math.round(node[prefix + 'x'] - fontSize / 2 - 2);- y = Math.round(node[prefix + 'y'] - fontSize / 2 - 2);- w = Math.round(- measurementCanvas.measureText(node.label).width +- fontSize / 2 + size + 9- );- h = Math.round(fontSize + 4);- e = Math.round(fontSize / 2 + 2);-- // Circle- circle.setAttributeNS(- null,- 'class',- settings('classPrefix') + '-hover-area');- circle.setAttributeNS(null, 'fill', '#fff');- circle.setAttributeNS(null, 'cx', node[prefix + 'x']);- circle.setAttributeNS(null, 'cy', node[prefix + 'y']);- circle.setAttributeNS(null, 'r', e);-- // Rectangle- rectangle.setAttributeNS(- null,- 'class',- settings('classPrefix') + '-hover-area');- rectangle.setAttributeNS(null, 'fill', '#fff');- rectangle.setAttributeNS(null, 'x', node[prefix + 'x'] + e / 4);- rectangle.setAttributeNS(null, 'y', node[prefix + 'y'] - e);- rectangle.setAttributeNS(null, 'width', w);- rectangle.setAttributeNS(null, 'height', h);- }-- // Appending childs- group.appendChild(circle);- group.appendChild(rectangle);- group.appendChild(text);- group.appendChild(nodeCircle);-- return group;- }- };-}).call(this);--;(function(undefined) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- // Initialize packages:- sigma.utils.pkg('sigma.middlewares');- sigma.utils.pkg('sigma.utils');-- /**- * This middleware will rescale the graph such that it takes an optimal space- * on the renderer.- *- * As each middleware, this function is executed in the scope of the sigma- * instance.- *- * @param {?string} readPrefix The read prefix.- * @param {?string} writePrefix The write prefix.- * @param {object} options The parameters.- */- sigma.middlewares.rescale = function(readPrefix, writePrefix, options) {- var i,- l,- a,- b,- c,- d,- scale,- margin,- n = this.graph.nodes(),- e = this.graph.edges(),- settings = this.settings.embedObjects(options || {}),- bounds = settings('bounds') || sigma.utils.getBoundaries(- this.graph,- readPrefix,- true- ),- minX = bounds.minX,- minY = bounds.minY,- maxX = bounds.maxX,- maxY = bounds.maxY,- sizeMax = bounds.sizeMax,- weightMax = bounds.weightMax,- w = settings('width') || 1,- h = settings('height') || 1,- rescaleSettings = settings('autoRescale'),- validSettings = {- nodePosition: 1,- nodeSize: 1,- edgeSize: 1- };-- /**- * What elements should we rescale?- */- if (!(rescaleSettings instanceof Array))- rescaleSettings = ['nodePosition', 'nodeSize', 'edgeSize'];-- for (i = 0, l = rescaleSettings.length; i < l; i++)- if (!validSettings[rescaleSettings[i]])- throw new Error(- 'The rescale setting "' + rescaleSettings[i] + '" is not recognized.'- );-- var np = ~rescaleSettings.indexOf('nodePosition'),- ns = ~rescaleSettings.indexOf('nodeSize'),- es = ~rescaleSettings.indexOf('edgeSize');-- /**- * First, we compute the scaling ratio, without considering the sizes- * of the nodes : Each node will have its center in the canvas, but might- * be partially out of it.- */- scale = settings('scalingMode') === 'outside' ?- Math.max(- w / Math.max(maxX - minX, 1),- h / Math.max(maxY - minY, 1)- ) :- Math.min(- w / Math.max(maxX - minX, 1),- h / Math.max(maxY - minY, 1)- );-- /**- * Then, we correct that scaling ratio considering a margin, which is- * basically the size of the biggest node.- * This has to be done as a correction since to compare the size of the- * biggest node to the X and Y values, we have to first get an- * approximation of the scaling ratio.- **/- margin =- (- settings('rescaleIgnoreSize') ?- 0 :- (settings('maxNodeSize') || sizeMax) / scale- ) +- (settings('sideMargin') || 0);- maxX += margin;- minX -= margin;- maxY += margin;- minY -= margin;-- // Fix the scaling with the new extrema:- scale = settings('scalingMode') === 'outside' ?- Math.max(- w / Math.max(maxX - minX, 1),- h / Math.max(maxY - minY, 1)- ) :- Math.min(- w / Math.max(maxX - minX, 1),- h / Math.max(maxY - minY, 1)- );-- // Size homothetic parameters:- if (!settings('maxNodeSize') && !settings('minNodeSize')) {- a = 1;- b = 0;- } else if (settings('maxNodeSize') === settings('minNodeSize')) {- a = 0;- b = +settings('maxNodeSize');- } else {- a = (settings('maxNodeSize') - settings('minNodeSize')) / sizeMax;- b = +settings('minNodeSize');- }-- if (!settings('maxEdgeSize') && !settings('minEdgeSize')) {- c = 1;- d = 0;- } else if (settings('maxEdgeSize') === settings('minEdgeSize')) {- c = 0;- d = +settings('minEdgeSize');- } else {- c = (settings('maxEdgeSize') - settings('minEdgeSize')) / weightMax;- d = +settings('minEdgeSize');- }-- // Rescale the nodes and edges:- for (i = 0, l = e.length; i < l; i++)- e[i][writePrefix + 'size'] =- e[i][readPrefix + 'size'] * (es ? c : 1) + (es ? d : 0);-- for (i = 0, l = n.length; i < l; i++) {- n[i][writePrefix + 'size'] =- n[i][readPrefix + 'size'] * (ns ? a : 1) + (ns ? b : 0);- n[i][writePrefix + 'x'] =- (n[i][readPrefix + 'x'] - (maxX + minX) / 2) * (np ? scale : 1);- n[i][writePrefix + 'y'] =- (n[i][readPrefix + 'y'] - (maxY + minY) / 2) * (np ? scale : 1);- }- };-- sigma.utils.getBoundaries = function(graph, prefix, doEdges) {- var i,- l,- e = graph.edges(),- n = graph.nodes(),- weightMax = -Infinity,- sizeMax = -Infinity,- minX = Infinity,- minY = Infinity,- maxX = -Infinity,- maxY = -Infinity;-- if (doEdges)- for (i = 0, l = e.length; i < l; i++)- weightMax = Math.max(e[i][prefix + 'size'], weightMax);-- for (i = 0, l = n.length; i < l; i++) {- sizeMax = Math.max(n[i][prefix + 'size'], sizeMax);- maxX = Math.max(n[i][prefix + 'x'], maxX);- minX = Math.min(n[i][prefix + 'x'], minX);- maxY = Math.max(n[i][prefix + 'y'], maxY);- minY = Math.min(n[i][prefix + 'y'], minY);- }-- weightMax = weightMax || 1;- sizeMax = sizeMax || 1;-- return {- weightMax: weightMax,- sizeMax: sizeMax,- minX: minX,- minY: minY,- maxX: maxX,- maxY: maxY- };- };-}).call(this);--;(function(undefined) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- // Initialize packages:- sigma.utils.pkg('sigma.middlewares');-- /**- * This middleware will just copy the graphic properties.- *- * @param {?string} readPrefix The read prefix.- * @param {?string} writePrefix The write prefix.- */- sigma.middlewares.copy = function(readPrefix, writePrefix) {- var i,- l,- a;-- if (writePrefix + '' === readPrefix + '')- return;-- a = this.graph.nodes();- for (i = 0, l = a.length; i < l; i++) {- a[i][writePrefix + 'x'] = a[i][readPrefix + 'x'];- a[i][writePrefix + 'y'] = a[i][readPrefix + 'y'];- a[i][writePrefix + 'size'] = a[i][readPrefix + 'size'];- }-- a = this.graph.edges();- for (i = 0, l = a.length; i < l; i++)- a[i][writePrefix + 'size'] = a[i][readPrefix + 'size'];- };-}).call(this);--;(function(undefined) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- // Initialize packages:- sigma.utils.pkg('sigma.misc.animation.running');-- /**- * Generates a unique ID for the animation.- *- * @return {string} Returns the new ID.- */- var _getID = (function() {- var id = 0;- return function() {- return '' + (++id);- };- })();-- /**- * This function animates a camera. It has to be called with the camera to- * animate, the values of the coordinates to reach and eventually some- * options. It returns a number id, that you can use to kill the animation,- * with the method sigma.misc.animation.kill(id).- *- * The available options are:- *- * {?number} duration The duration of the animation.- * {?function} onNewFrame A callback to execute when the animation- * enter a new frame.- * {?function} onComplete A callback to execute when the animation- * is completed or killed.- * {?(string|function)} easing The name of a function from the package- * sigma.utils.easings, or a custom easing- * function.- *- * @param {camera} camera The camera to animate.- * @param {object} target The coordinates to reach.- * @param {?object} options Eventually an object to specify some options to- * the function. The available options are- * presented in the description of the function.- * @return {number} The animation id, to make it easy to kill- * through the method "sigma.misc.animation.kill".- */- sigma.misc.animation.camera = function(camera, val, options) {- if (- !(camera instanceof sigma.classes.camera) ||- typeof val !== 'object' ||- !val- )- throw 'animation.camera: Wrong arguments.';-- if (- typeof val.x !== 'number' &&- typeof val.y !== 'number' &&- typeof val.ratio !== 'number' &&- typeof val.angle !== 'number'- )- throw 'There must be at least one valid coordinate in the given val.';-- var fn,- id,- anim,- easing,- duration,- initialVal,- o = options || {},- start = sigma.utils.dateNow();-- // Store initial values:- initialVal = {- x: camera.x,- y: camera.y,- ratio: camera.ratio,- angle: camera.angle- };-- duration = o.duration;- easing = typeof o.easing !== 'function' ?- sigma.utils.easings[o.easing || 'quadraticInOut'] :- o.easing;-- fn = function() {- var coef,- t = o.duration ? (sigma.utils.dateNow() - start) / o.duration : 1;-- // If the animation is over:- if (t >= 1) {- camera.isAnimated = false;- camera.goTo({- x: val.x !== undefined ? val.x : initialVal.x,- y: val.y !== undefined ? val.y : initialVal.y,- ratio: val.ratio !== undefined ? val.ratio : initialVal.ratio,- angle: val.angle !== undefined ? val.angle : initialVal.angle- });-- cancelAnimationFrame(id);- delete sigma.misc.animation.running[id];-- // Check callbacks:- if (typeof o.onComplete === 'function')- o.onComplete();-- // Else, let's keep going:- } else {- coef = easing(t);- camera.isAnimated = true;- camera.goTo({- x: val.x !== undefined ?- initialVal.x + (val.x - initialVal.x) * coef :- initialVal.x,- y: val.y !== undefined ?- initialVal.y + (val.y - initialVal.y) * coef :- initialVal.y,- ratio: val.ratio !== undefined ?- initialVal.ratio + (val.ratio - initialVal.ratio) * coef :- initialVal.ratio,- angle: val.angle !== undefined ?- initialVal.angle + (val.angle - initialVal.angle) * coef :- initialVal.angle- });-- // Check callbacks:- if (typeof o.onNewFrame === 'function')- o.onNewFrame();-- anim.frameId = requestAnimationFrame(fn);- }- };-- id = _getID();- anim = {- frameId: requestAnimationFrame(fn),- target: camera,- type: 'camera',- options: o,- fn: fn- };- sigma.misc.animation.running[id] = anim;-- return id;- };-- /**- * Kills a running animation. It triggers the eventual onComplete callback.- *- * @param {number} id The id of the animation to kill.- * @return {object} Returns the sigma.misc.animation package.- */- sigma.misc.animation.kill = function(id) {- if (arguments.length !== 1 || typeof id !== 'number')- throw 'animation.kill: Wrong arguments.';-- var o = sigma.misc.animation.running[id];-- if (o) {- cancelAnimationFrame(id);- delete sigma.misc.animation.running[o.frameId];-- if (o.type === 'camera')- o.target.isAnimated = false;-- // Check callbacks:- if (typeof (o.options || {}).onComplete === 'function')- o.options.onComplete();- }-- return this;- };-- /**- * Kills every running animations, or only the one with the specified type,- * if a string parameter is given.- *- * @param {?(string|object)} filter A string to filter the animations to kill- * on their type (example: "camera"), or an- * object to filter on their target.- * @return {number} Returns the number of animations killed- * that way.- */- sigma.misc.animation.killAll = function(filter) {- var o,- id,- count = 0,- type = typeof filter === 'string' ? filter : null,- target = typeof filter === 'object' ? filter : null,- running = sigma.misc.animation.running;-- for (id in running)- if (- (!type || running[id].type === type) &&- (!target || running[id].target === target)- ) {- o = sigma.misc.animation.running[id];- cancelAnimationFrame(o.frameId);- delete sigma.misc.animation.running[id];-- if (o.type === 'camera')- o.target.isAnimated = false;-- // Increment counter:- count++;-- // Check callbacks:- if (typeof (o.options || {}).onComplete === 'function')- o.options.onComplete();- }-- return count;- };-- /**- * Returns "true" if any animation that is currently still running matches- * the filter given to the function.- *- * @param {string|object} filter A string to filter the animations to kill- * on their type (example: "camera"), or an- * object to filter on their target.- * @return {boolean} Returns true if any running animation- * matches.- */- sigma.misc.animation.has = function(filter) {- var id,- type = typeof filter === 'string' ? filter : null,- target = typeof filter === 'object' ? filter : null,- running = sigma.misc.animation.running;-- for (id in running)- if (- (!type || running[id].type === type) &&- (!target || running[id].target === target)- )- return true;-- return false;- };-}).call(this);--;(function(undefined) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- // Initialize packages:- sigma.utils.pkg('sigma.misc');-- /**- * This helper will bind any no-DOM renderer (for instance canvas or WebGL)- * to its captors, to properly dispatch the good events to the sigma instance- * to manage clicking, hovering etc...- *- * It has to be called in the scope of the related renderer.- */- sigma.misc.bindEvents = function(prefix) {- var i,- l,- mX,- mY,- captor,- self = this;-- function getNodes(e) {- if (e) {- mX = 'x' in e.data ? e.data.x : mX;- mY = 'y' in e.data ? e.data.y : mY;- }-- var i,- j,- l,- n,- x,- y,- s,- inserted,- selected = [],- modifiedX = mX + self.width / 2,- modifiedY = mY + self.height / 2,- point = self.camera.cameraPosition(- mX,- mY- ),- nodes = self.camera.quadtree.point(- point.x,- point.y- );-- if (nodes.length)- for (i = 0, l = nodes.length; i < l; i++) {- n = nodes[i];- x = n[prefix + 'x'];- y = n[prefix + 'y'];- s = n[prefix + 'size'];-- if (- !n.hidden &&- modifiedX > x - s &&- modifiedX < x + s &&- modifiedY > y - s &&- modifiedY < y + s &&- Math.sqrt(- Math.pow(modifiedX - x, 2) +- Math.pow(modifiedY - y, 2)- ) < s- ) {- // Insert the node:- inserted = false;-- for (j = 0; j < selected.length; j++)- if (n.size > selected[j].size) {- selected.splice(j, 0, n);- inserted = true;- break;- }-- if (!inserted)- selected.push(n);- }- }-- return selected;- }--- function getEdges(e) {- if (!self.settings('enableEdgeHovering')) {- // No event if the setting is off:- return [];- }-- var isCanvas = (- sigma.renderers.canvas && self instanceof sigma.renderers.canvas);-- if (!isCanvas) {- // A quick hardcoded rule to prevent people from using this feature- // with the WebGL renderer (which is not good enough at the moment):- throw new Error(- 'The edge events feature is not compatible with the WebGL renderer'- );- }-- if (e) {- mX = 'x' in e.data ? e.data.x : mX;- mY = 'y' in e.data ? e.data.y : mY;- }-- var i,- j,- l,- a,- edge,- s,- maxEpsilon = self.settings('edgeHoverPrecision'),- source,- target,- cp,- nodeIndex = {},- inserted,- selected = [],- modifiedX = mX + self.width / 2,- modifiedY = mY + self.height / 2,- point = self.camera.cameraPosition(- mX,- mY- ),- edges = [];-- if (isCanvas) {- var nodesOnScreen = self.camera.quadtree.area(- self.camera.getRectangle(self.width, self.height)- );- for (a = nodesOnScreen, i = 0, l = a.length; i < l; i++)- nodeIndex[a[i].id] = a[i];- }-- if (self.camera.edgequadtree !== undefined) {- edges = self.camera.edgequadtree.point(- point.x,- point.y- );- }-- function insertEdge(selected, edge) {- inserted = false;-- for (j = 0; j < selected.length; j++)- if (edge.size > selected[j].size) {- selected.splice(j, 0, edge);- inserted = true;- break;- }-- if (!inserted)- selected.push(edge);- }-- if (edges.length)- for (i = 0, l = edges.length; i < l; i++) {- edge = edges[i];- source = self.graph.nodes(edge.source);- target = self.graph.nodes(edge.target);- // (HACK) we can't get edge[prefix + 'size'] on WebGL renderer:- s = edge[prefix + 'size'] ||- edge['read_' + prefix + 'size'];-- // First, let's identify which edges are drawn. To do this, we keep- // every edges that have at least one extremity displayed according to- // the quadtree and the "hidden" attribute. We also do not keep hidden- // edges.- // Then, let's check if the mouse is on the edge (we suppose that it- // is a line segment).-- if (- !edge.hidden &&- !source.hidden && !target.hidden &&- (!isCanvas ||- (nodeIndex[edge.source] || nodeIndex[edge.target])) &&- sigma.utils.getDistance(- source[prefix + 'x'],- source[prefix + 'y'],- modifiedX,- modifiedY) > source[prefix + 'size'] &&- sigma.utils.getDistance(- target[prefix + 'x'],- target[prefix + 'y'],- modifiedX,- modifiedY) > target[prefix + 'size']- ) {- if (edge.type == 'curve' || edge.type == 'curvedArrow') {- if (source.id === target.id) {- cp = sigma.utils.getSelfLoopControlPoints(- source[prefix + 'x'],- source[prefix + 'y'],- source[prefix + 'size']- );- if (- sigma.utils.isPointOnBezierCurve(- modifiedX,- modifiedY,- source[prefix + 'x'],- source[prefix + 'y'],- target[prefix + 'x'],- target[prefix + 'y'],- cp.x1,- cp.y1,- cp.x2,- cp.y2,- Math.max(s, maxEpsilon)- )) {- insertEdge(selected, edge);- }- }- else {- cp = sigma.utils.getQuadraticControlPoint(- source[prefix + 'x'],- source[prefix + 'y'],- target[prefix + 'x'],- target[prefix + 'y']);- if (- sigma.utils.isPointOnQuadraticCurve(- modifiedX,- modifiedY,- source[prefix + 'x'],- source[prefix + 'y'],- target[prefix + 'x'],- target[prefix + 'y'],- cp.x,- cp.y,- Math.max(s, maxEpsilon)- )) {- insertEdge(selected, edge);- }- }- } else if (- sigma.utils.isPointOnSegment(- modifiedX,- modifiedY,- source[prefix + 'x'],- source[prefix + 'y'],- target[prefix + 'x'],- target[prefix + 'y'],- Math.max(s, maxEpsilon)- )) {- insertEdge(selected, edge);- }- }- }-- return selected;- }--- function bindCaptor(captor) {- var nodes,- edges,- overNodes = {},- overEdges = {};-- function onClick(e) {- if (!self.settings('eventsEnabled'))- return;-- self.dispatchEvent('click', e.data);-- nodes = getNodes(e);- edges = getEdges(e);-- if (nodes.length) {- self.dispatchEvent('clickNode', {- node: nodes[0],- captor: e.data- });- self.dispatchEvent('clickNodes', {- node: nodes,- captor: e.data- });- } else if (edges.length) {- self.dispatchEvent('clickEdge', {- edge: edges[0],- captor: e.data- });- self.dispatchEvent('clickEdges', {- edge: edges,- captor: e.data- });- } else- self.dispatchEvent('clickStage', {captor: e.data});- }-- function onDoubleClick(e) {- if (!self.settings('eventsEnabled'))- return;-- self.dispatchEvent('doubleClick', e.data);-- nodes = getNodes(e);- edges = getEdges(e);-- if (nodes.length) {- self.dispatchEvent('doubleClickNode', {- node: nodes[0],- captor: e.data- });- self.dispatchEvent('doubleClickNodes', {- node: nodes,- captor: e.data- });- } else if (edges.length) {- self.dispatchEvent('doubleClickEdge', {- edge: edges[0],- captor: e.data- });- self.dispatchEvent('doubleClickEdges', {- edge: edges,- captor: e.data- });- } else- self.dispatchEvent('doubleClickStage', {captor: e.data});- }-- function onRightClick(e) {- if (!self.settings('eventsEnabled'))- return;-- self.dispatchEvent('rightClick', e.data);-- nodes = getNodes(e);- edges = getEdges(e);-- if (nodes.length) {- self.dispatchEvent('rightClickNode', {- node: nodes[0],- captor: e.data- });- self.dispatchEvent('rightClickNodes', {- node: nodes,- captor: e.data- });- } else if (edges.length) {- self.dispatchEvent('rightClickEdge', {- edge: edges[0],- captor: e.data- });- self.dispatchEvent('rightClickEdges', {- edge: edges,- captor: e.data- });- } else- self.dispatchEvent('rightClickStage', {captor: e.data});- }-- function onOut(e) {- if (!self.settings('eventsEnabled'))- return;-- var k,- i,- l,- le,- outNodes = [],- outEdges = [];-- for (k in overNodes)- outNodes.push(overNodes[k]);-- overNodes = {};- // Dispatch both single and multi events:- for (i = 0, l = outNodes.length; i < l; i++)- self.dispatchEvent('outNode', {- node: outNodes[i],- captor: e.data- });- if (outNodes.length)- self.dispatchEvent('outNodes', {- nodes: outNodes,- captor: e.data- });-- overEdges = {};- // Dispatch both single and multi events:- for (i = 0, le = outEdges.length; i < le; i++)- self.dispatchEvent('outEdge', {- edge: outEdges[i],- captor: e.data- });- if (outEdges.length)- self.dispatchEvent('outEdges', {- edges: outEdges,- captor: e.data- });- }-- function onMove(e) {- if (!self.settings('eventsEnabled'))- return;-- nodes = getNodes(e);- edges = getEdges(e);-- var i,- k,- node,- edge,- newOutNodes = [],- newOverNodes = [],- currentOverNodes = {},- l = nodes.length,- newOutEdges = [],- newOverEdges = [],- currentOverEdges = {},- le = edges.length;-- // Check newly overred nodes:- for (i = 0; i < l; i++) {- node = nodes[i];- currentOverNodes[node.id] = node;- if (!overNodes[node.id]) {- newOverNodes.push(node);- overNodes[node.id] = node;- }- }-- // Check no more overred nodes:- for (k in overNodes)- if (!currentOverNodes[k]) {- newOutNodes.push(overNodes[k]);- delete overNodes[k];- }-- // Dispatch both single and multi events:- for (i = 0, l = newOverNodes.length; i < l; i++)- self.dispatchEvent('overNode', {- node: newOverNodes[i],- captor: e.data- });- for (i = 0, l = newOutNodes.length; i < l; i++)- self.dispatchEvent('outNode', {- node: newOutNodes[i],- captor: e.data- });- if (newOverNodes.length)- self.dispatchEvent('overNodes', {- nodes: newOverNodes,- captor: e.data- });- if (newOutNodes.length)- self.dispatchEvent('outNodes', {- nodes: newOutNodes,- captor: e.data- });-- // Check newly overred edges:- for (i = 0; i < le; i++) {- edge = edges[i];- currentOverEdges[edge.id] = edge;- if (!overEdges[edge.id]) {- newOverEdges.push(edge);- overEdges[edge.id] = edge;- }- }-- // Check no more overred edges:- for (k in overEdges)- if (!currentOverEdges[k]) {- newOutEdges.push(overEdges[k]);- delete overEdges[k];- }-- // Dispatch both single and multi events:- for (i = 0, le = newOverEdges.length; i < le; i++)- self.dispatchEvent('overEdge', {- edge: newOverEdges[i],- captor: e.data- });- for (i = 0, le = newOutEdges.length; i < le; i++)- self.dispatchEvent('outEdge', {- edge: newOutEdges[i],- captor: e.data- });- if (newOverEdges.length)- self.dispatchEvent('overEdges', {- edges: newOverEdges,- captor: e.data- });- if (newOutEdges.length)- self.dispatchEvent('outEdges', {- edges: newOutEdges,- captor: e.data- });- }-- // Bind events:- captor.bind('click', onClick);- captor.bind('mousedown', onMove);- captor.bind('mouseup', onMove);- captor.bind('mousemove', onMove);- captor.bind('mouseout', onOut);- captor.bind('doubleclick', onDoubleClick);- captor.bind('rightclick', onRightClick);- self.bind('render', onMove);- }-- for (i = 0, l = this.captors.length; i < l; i++)- bindCaptor(this.captors[i]);- };-}).call(this);--;(function(undefined) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- // Initialize packages:- sigma.utils.pkg('sigma.misc');-- /**- * This helper will bind any DOM renderer (for instance svg)- * to its captors, to properly dispatch the good events to the sigma instance- * to manage clicking, hovering etc...- *- * It has to be called in the scope of the related renderer.- */- sigma.misc.bindDOMEvents = function(container) {- var self = this,- graph = this.graph;-- // DOMElement abstraction- function Element(domElement) {-- // Helpers- this.attr = function(attrName) {- return domElement.getAttributeNS(null, attrName);- };-- // Properties- this.tag = domElement.tagName;- this.class = this.attr('class');- this.id = this.attr('id');-- // Methods- this.isNode = function() {- return !!~this.class.indexOf(self.settings('classPrefix') + '-node');- };-- this.isEdge = function() {- return !!~this.class.indexOf(self.settings('classPrefix') + '-edge');- };-- this.isHover = function() {- return !!~this.class.indexOf(self.settings('classPrefix') + '-hover');- };- }-- // Click- function click(e) {- if (!self.settings('eventsEnabled'))- return;-- // Generic event- self.dispatchEvent('click', e);-- // Are we on a node?- var element = new Element(e.target);-- if (element.isNode())- self.dispatchEvent('clickNode', {- node: graph.nodes(element.attr('data-node-id'))- });- else- self.dispatchEvent('clickStage');-- e.preventDefault();- e.stopPropagation();- }-- // Double click- function doubleClick(e) {- if (!self.settings('eventsEnabled'))- return;-- // Generic event- self.dispatchEvent('doubleClick', e);-- // Are we on a node?- var element = new Element(e.target);-- if (element.isNode())- self.dispatchEvent('doubleClickNode', {- node: graph.nodes(element.attr('data-node-id'))- });- else- self.dispatchEvent('doubleClickStage');-- e.preventDefault();- e.stopPropagation();- }-- // On over- function onOver(e) {- var target = e.toElement || e.target;-- if (!self.settings('eventsEnabled') || !target)- return;-- var el = new Element(target);-- if (el.isNode()) {- self.dispatchEvent('overNode', {- node: graph.nodes(el.attr('data-node-id'))- });- }- else if (el.isEdge()) {- var edge = graph.edges(el.attr('data-edge-id'));- self.dispatchEvent('overEdge', {- edge: edge,- source: graph.nodes(edge.source),- target: graph.nodes(edge.target)- });- }- }-- // On out- function onOut(e) {- var target = e.fromElement || e.originalTarget;-- if (!self.settings('eventsEnabled'))- return;-- var el = new Element(target);-- if (el.isNode()) {- self.dispatchEvent('outNode', {- node: graph.nodes(el.attr('data-node-id'))- });- }- else if (el.isEdge()) {- var edge = graph.edges(el.attr('data-edge-id'));- self.dispatchEvent('outEdge', {- edge: edge,- source: graph.nodes(edge.source),- target: graph.nodes(edge.target)- });- }- }-- // Registering Events:-- // Click- container.addEventListener('click', click, false);- sigma.utils.doubleClick(container, 'click', doubleClick);-- // Touch counterparts- container.addEventListener('touchstart', click, false);- sigma.utils.doubleClick(container, 'touchstart', doubleClick);-- // Mouseover- container.addEventListener('mouseover', onOver, true);-- // Mouseout- container.addEventListener('mouseout', onOut, true);- };-}).call(this);--;(function(undefined) {- 'use strict';-- if (typeof sigma === 'undefined')- throw 'sigma is not declared';-- // Initialize packages:- sigma.utils.pkg('sigma.misc');-- /**- * This method listens to "overNode", "outNode", "overEdge" and "outEdge"- * events from a renderer and renders the nodes differently on the top layer.- * The goal is to make any node label readable with the mouse, and to- * highlight hovered nodes and edges.- *- * It has to be called in the scope of the related renderer.- */- sigma.misc.drawHovers = function(prefix) {- var self = this,- hoveredNodes = {},- hoveredEdges = {};-- this.bind('overNode', function(event) {- var node = event.data.node;- if (!node.hidden) {- hoveredNodes[node.id] = node;- draw();- }- });-- this.bind('outNode', function(event) {- delete hoveredNodes[event.data.node.id];- draw();- });-- this.bind('overEdge', function(event) {- var edge = event.data.edge;- if (!edge.hidden) {- hoveredEdges[edge.id] = edge;- draw();- }- });-- this.bind('outEdge', function(event) {- delete hoveredEdges[event.data.edge.id];- draw();- });-- this.bind('render', function(event) {- draw();- });-- function draw() {- // Clear self.contexts.hover:- self.contexts.hover.canvas.width = self.contexts.hover.canvas.width;-- var k,- source,- target,- hoveredNode,- hoveredEdge,- defaultNodeType = self.settings('defaultNodeType'),- defaultEdgeType = self.settings('defaultEdgeType'),- nodeRenderers = sigma.canvas.hovers,- edgeRenderers = sigma.canvas.edgehovers,- extremitiesRenderers = sigma.canvas.extremities,- embedSettings = self.settings.embedObjects({- prefix: prefix- });-- // Node render: single hover- if (- embedSettings('enableHovering') &&- embedSettings('singleHover') &&- Object.keys(hoveredNodes).length- ) {- hoveredNode = hoveredNodes[Object.keys(hoveredNodes)[0]];- (- nodeRenderers[hoveredNode.type] ||- nodeRenderers[defaultNodeType] ||- nodeRenderers.def- )(- hoveredNode,- self.contexts.hover,- embedSettings- );- }-- // Node render: multiple hover- if (- embedSettings('enableHovering') &&- !embedSettings('singleHover')- )- for (k in hoveredNodes)- (- nodeRenderers[hoveredNodes[k].type] ||- nodeRenderers[defaultNodeType] ||- nodeRenderers.def- )(- hoveredNodes[k],- self.contexts.hover,- embedSettings- );-- // Edge render: single hover- if (- embedSettings('enableEdgeHovering') &&- embedSettings('singleHover') &&- Object.keys(hoveredEdges).length- ) {- hoveredEdge = hoveredEdges[Object.keys(hoveredEdges)[0]];- source = self.graph.nodes(hoveredEdge.source);- target = self.graph.nodes(hoveredEdge.target);-- if (! hoveredEdge.hidden) {- (- edgeRenderers[hoveredEdge.type] ||- edgeRenderers[defaultEdgeType] ||- edgeRenderers.def- ) (- hoveredEdge,- source,- target,- self.contexts.hover,- embedSettings- );-- if (embedSettings('edgeHoverExtremities')) {- (- extremitiesRenderers[hoveredEdge.type] ||- extremitiesRenderers.def- )(- hoveredEdge,- source,- target,- self.contexts.hover,- embedSettings- );-- } else {- // Avoid edges rendered over nodes:- (- sigma.canvas.nodes[source.type] ||- sigma.canvas.nodes.def- ) (- source,- self.contexts.hover,- embedSettings- );- (- sigma.canvas.nodes[target.type] ||- sigma.canvas.nodes.def- ) (- target,- self.contexts.hover,- embedSettings- );- }- }- }-- // Edge render: multiple hover- if (- embedSettings('enableEdgeHovering') &&- !embedSettings('singleHover')- ) {- for (k in hoveredEdges) {- hoveredEdge = hoveredEdges[k];- source = self.graph.nodes(hoveredEdge.source);- target = self.graph.nodes(hoveredEdge.target);-- if (!hoveredEdge.hidden) {- (- edgeRenderers[hoveredEdge.type] ||- edgeRenderers[defaultEdgeType] ||- edgeRenderers.def- ) (- hoveredEdge,- source,- target,- self.contexts.hover,- embedSettings- );-- if (embedSettings('edgeHoverExtremities')) {- (- extremitiesRenderers[hoveredEdge.type] ||- extremitiesRenderers.def- )(- hoveredEdge,- source,- target,- self.contexts.hover,- embedSettings- );- } else {- // Avoid edges rendered over nodes:- (- sigma.canvas.nodes[source.type] ||- sigma.canvas.nodes.def- ) (- source,- self.contexts.hover,- embedSettings- );- (- sigma.canvas.nodes[target.type] ||- sigma.canvas.nodes.def- ) (- target,- self.contexts.hover,- embedSettings- );- }- }- }- }- }- };-}).call(this);diff --git a/spiderfoot/static/js/sigma.parsers.gexf.min.js b/spiderfoot/static/js/sigma.parsers.gexf.min.jsdeleted file mode 100644index bcf2a629..00000000--- a/spiderfoot/static/js/sigma.parsers.gexf.min.js+++ /dev/null@@ -1 +0,0 @@-(function(a){"use strict";function b(a){var b={id:a.id,label:a.label};return a.viz&&(b.viz=a.viz),a.attributes&&(b.attributes=a.attributes),b}function c(a){var b={id:a.id,type:a.type||"undirected",label:a.label||"",source:a.source,target:a.target,weight:+a.weight||1};return a.viz&&(b.viz=a.viz),a.attributes&&(b.attributes=a.attributes),b}function d(a){function d(){var a={};return l.els.meta?(a.lastmodifieddate=l.els.meta.getAttribute("lastmodifieddate"),h.nodeListEach(l.els.meta.childNodes,function(b){a[b.tagName.toLowerCase()]=b.textContent}),a):a}function e(a){var b=[];return l.els.model[a]&&h.nodeListEach(l.els.model[a],function(a){var c={id:a.getAttribute("id")||a.getAttribute("for"),type:a.getAttribute("type")||"string",title:a.getAttribute("title")||""},d=h.nodeListToArray(a.childNodes);d.length>0&&(c.defaultValue=d[0].textContent),b.push(c)}),b.length>0?b:!1}function f(a,b){var c={},d=b.getElementsByTagName("attvalue"),e=h.nodeListToHash(d,function(a){var b=h.namedNodeMapToObject(a.attributes),c=b.id||b["for"];return{key:c,value:b.value}});return a.map(function(a){c[a.id]=!(a.id in e)&&"defaultValue"in a?h.enforceType(a.type,a.defaultValue):h.enforceType(a.type,e[a.id])}),c}function g(a){var c=[];return h.nodeListEach(l.els.nodes,function(d){var e={id:d.getAttribute("id"),label:d.getAttribute("label")||""};a&&(e.attributes=f(a,d)),l.hasViz&&(e.viz=i(d)),c.push(b(e))}),c}function i(a){var b={},c=h.getFirstElementByTagNS(a,"viz","color");if(c){var d=["r","g","b","a"].map(function(a){return c.getAttribute(a)});b.color=h.getRGB(d)}var e=h.getFirstElementByTagNS(a,"viz","position");e&&(b.position={},["x","y","z"].map(function(a){b.position[a]=+e.getAttribute(a)}));var f=h.getFirstElementByTagNS(a,"viz","size");f&&(b.size=+f.getAttribute("value"));var g=h.getFirstElementByTagNS(a,"viz","shape");return g&&(b.shape=g.getAttribute("value")),b}function j(a,b){var d=[];return h.nodeListEach(l.els.edges,function(e){var g=h.namedNodeMapToObject(e.attributes);"type"in g||(g.type=b),a&&(g.attributes=f(a,e)),l.hasViz&&(g.viz=k(e)),d.push(c(g))}),d}function k(a){var b={},c=h.getFirstElementByTagNS(a,"viz","color");if(c){var d=["r","g","b","a"].map(function(a){return c.getAttribute(a)});b.color=h.getRGB(d)}var e=h.getFirstElementByTagNS(a,"viz","shape");e&&(b.shape=e.getAttribute("value"));var f=h.getFirstElementByTagNS(a,"viz","thickness");return f&&(b.thickness=+f.getAttribute("value")),b}var l={};l.els={root:a.getElementsByTagName("gexf")[0],graph:a.getElementsByTagName("graph")[0],meta:a.getElementsByTagName("meta")[0],nodes:a.getElementsByTagName("node"),edges:a.getElementsByTagName("edge"),model:h.getModelTags(a)},l.hasViz=!!h.getAttributeNS(l.els.root,"xmlns","viz"),l.version=l.els.root.getAttribute("version")||"1.0",l.mode=l.els.graph.getAttribute("mode")||"static";var m=l.els.graph.getAttribute("defaultedgetype");l.defaultEdgetype=m||"undirected";var n=e("node"),o=e("edge"),p={version:l.version,mode:l.mode,defaultEdgeType:l.defaultEdgetype,meta:d(),model:{},nodes:g(n),edges:j(o,l.defaultEdgetype)};return n&&(p.model.node=n),o&&(p.model.edge=o),p}function e(a,b){var c=function(){if(window.XMLHttpRequest)return new XMLHttpRequest;var a,b;if(window.ActiveXObject){a=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"];for(b in a)try{return new ActiveXObject(a[b])}catch(c){}}return null}();if(!c)throw"XMLHttpRequest not supported, cannot load the file.";var d,e="function"==typeof b;return c.overrideMimeType?(c.overrideMimeType("text/xml"),d=function(a){return a.responseXML}):d=function(a){var b=new DOMParser;return b.parseFromString(a.responseText,"application/xml")},c.open("GET",a,e),e&&(c.onreadystatechange=function(){4===c.readyState&&b(d(c))}),c.send(),e?c:d(c)}function f(a){return d(a)}function g(a,b){return"function"==typeof b?e(a,function(a){b(d(a))}):d(e(a))}var h={getModelTags:function(a){var b,c=a.getElementsByTagName("attributes"),d={},e=c.length;for(b=0;e>b;b++)d[c[b].getAttribute("class")]=c[b].childNodes;return d},nodeListToArray:function(a){for(var b=[],c=0,d=a.length;d>c;++c)"#text"!==a[c].nodeName&&b.push(a[c]);return b},nodeListEach:function(a,b){for(var c=0,d=a.length;d>c;++c)"#text"!==a[c].nodeName&&b(a[c])},nodeListToHash:function(a,b){for(var c={},d=0;d<a.length;d++)if("#text"!==a[d].nodeName){var e=b(a[d]);c[e.key]=e.value}return c},namedNodeMapToObject:function(a){for(var b={},c=0;c<a.length;c++)b[a[c].name]=a[c].value;return b},getFirstElementByTagNS:function(a,b,c){var d=a.getElementsByTagName(b+":"+c)[0];return d||(d=a.getElementsByTagNameNS(b,c)[0]),d||(d=a.getElementsByTagName(c)[0]),d},getAttributeNS:function(b,c,d){var e=b.getAttribute(c+":"+d);return e===a&&(e=b.getAttributeNS(c,d)),e===a&&(e=b.getAttribute(d)),e},enforceType:function(a,b){switch(a){case"boolean":b="true"===b;break;case"integer":case"long":case"float":case"double":b=+b;break;case"liststring":b=b?b.split("|"):[]}return b},getRGB:function(a){return a[3]?"rgba("+a.join(",")+")":"rgb("+a.slice(0,-1).join(",")+")"}};if("undefined"!=typeof this.gexf)throw'gexf: error - a variable called "gexf" already exists in the global scope';this.gexf={parse:f,fetch:g,version:"0.1.1"},"undefined"!=typeof exports&&this.exports!==exports&&(module.exports=this.gexf)}).call(this),function(a){"use strict";function b(){return"e"+c++}if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.parsers");var c=0;sigma.parsers.gexf=function(a,c,d){function e(a){for(h=a.nodes,f=0,g=h.length;g>f;f++)i=h[f],i.id=i.id,i.viz&&"object"==typeof i.viz&&(i.viz.position&&"object"==typeof i.viz.position&&(i.x=i.viz.position.x,i.y=-i.viz.position.y),i.size=i.viz.size,i.color=i.viz.color);for(h=a.edges,f=0,g=h.length;g>f;f++)i=h[f],i.id="string"==typeof i.id?i.id:b(),i.source=""+i.source,i.target=""+i.target,i.viz&&"object"==typeof i.viz&&(i.color=i.viz.color,i.size=i.viz.thickness),i.size=i.weight;if(c instanceof sigma){for(c.graph.clear(),h=a.nodes,f=0,g=h.length;g>f;f++)c.graph.addNode(h[f]);for(h=a.edges,f=0,g=h.length;g>f;f++)c.graph.addEdge(h[f])}else"object"==typeof c?(c.graph=a,c=new sigma(c)):"function"==typeof c&&(d=c,c=null);return d?void d(c||a):a}var f,g,h,i;if("string"==typeof a)gexf.fetch(a,e);else if("object"==typeof a)return e(gexf.parse(a))}}.call(this);\ No newline at end of filediff --git a/spiderfoot/static/js/alertify.min.js b/spiderfoot/static/node_modules/alertifyjs/build/alertify.min.jsold mode 100644new mode 100755similarity index 100%rename from spiderfoot/static/js/alertify.min.jsrename to spiderfoot/static/node_modules/alertifyjs/build/alertify.min.jsdiff --git a/spiderfoot/static/css/alertify.min.css b/spiderfoot/static/node_modules/alertifyjs/build/css/alertify.min.cssold mode 100644new mode 100755similarity index 99%rename from spiderfoot/static/css/alertify.min.cssrename to spiderfoot/static/node_modules/alertifyjs/build/css/alertify.min.cssindex e49d1296..5dfb5052--- a/spiderfoot/static/css/alertify.min.css+++ b/spiderfoot/static/node_modules/alertifyjs/build/css/alertify.min.css@@ -1,6 +1,6 @@-/**- * alertifyjs 1.13.1 http://alertifyjs.com- * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.- * Copyright 2019 Mohammad Younes <[email protected]> (http://alertifyjs.com)- * Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/+/**+ * alertifyjs 1.13.1 http://alertifyjs.com+ * AlertifyJS is a javascript framework for developing pretty browser dialogs and notifications.+ * Copyright 2019 Mohammad Younes <[email protected]> (http://alertifyjs.com)+ * Licensed under GPL 3 <https://opensource.org/licenses/gpl-3.0>*/.alertify .ajs-dimmer{position:fixed;z-index:1981;top:0;right:0;bottom:0;left:0;padding:0;margin:0;background-color:#252525;opacity:.5}.alertify .ajs-modal{position:fixed;top:0;right:0;left:0;bottom:0;padding:0;overflow-y:auto;z-index:1981}.alertify .ajs-dialog{position:relative;margin:5% auto;min-height:110px;max-width:500px;padding:24px 24px 0 24px;outline:0;background-color:#fff}.alertify .ajs-dialog.ajs-capture:before{content:'';position:absolute;top:0;right:0;bottom:0;left:0;display:block;z-index:1}.alertify .ajs-reset{position:absolute!important;display:inline!important;width:0!important;height:0!important;opacity:0!important}.alertify .ajs-commands{position:absolute;right:4px;margin:-14px 24px 0 0;z-index:2}.alertify .ajs-commands button{display:none;width:10px;height:10px;margin-left:10px;padding:10px;border:0;background-color:transparent;background-repeat:no-repeat;background-position:center;cursor:pointer}.alertify .ajs-commands button.ajs-close{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAh0lEQVQYlY2QsQ0EIQwEB9cBAR1CJUaI/gigDnwR6NBL/7/xWLNrZ2b8EwGotVpr7eOitWa1VjugiNB7R1UPrKrWe0dEAHBbXUqxMQbeewDmnHjvyTm7C3zDwAUd9c63YQdUVdu6EAJzzquz7HXvTiklt+H9DQFYaxFjvDqllFyMkbXWvfpXHjJrWFgdBq/hAAAAAElFTkSuQmCC)}.alertify .ajs-commands button.ajs-maximize{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAOUlEQVQYlWP8//8/AzGAhYGBgaG4uBiv6t7eXkYmooxjYGAgWiELsvHYFMCcRX2rSXcjoSBiJDbAAeD+EGu+8BZcAAAAAElFTkSuQmCC)}.alertify .ajs-header{margin:-24px;margin-bottom:0;padding:16px 24px;background-color:#fff}.alertify .ajs-body{min-height:56px}.alertify .ajs-body .ajs-content{padding:16px 24px 16px 16px}.alertify .ajs-footer{padding:4px;margin-left:-24px;margin-right:-24px;min-height:43px;background-color:#fff}.alertify .ajs-footer .ajs-buttons.ajs-primary{text-align:right}.alertify .ajs-footer .ajs-buttons.ajs-primary .ajs-button{margin:4px}.alertify .ajs-footer .ajs-buttons.ajs-auxiliary{float:left;clear:none;text-align:left}.alertify .ajs-footer .ajs-buttons.ajs-auxiliary .ajs-button{margin:4px}.alertify .ajs-footer .ajs-buttons .ajs-button{min-width:88px;min-height:35px}.alertify .ajs-handle{position:absolute;display:none;width:10px;height:10px;right:0;bottom:0;z-index:1;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMS8xNEDQYmMAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAQ0lEQVQYlaXNMQoAIAxD0dT7H657l0KX3iJuUlBUNOsPPCGJm7VDp6ryeMxMuDsAQH7owW3pyn3RS26iKxERMLN3ugOaAkaL3sWVigAAAABJRU5ErkJggg==);-webkit-transform:scaleX(1);transform:scaleX(1);cursor:se-resize}.alertify.ajs-no-overflow .ajs-body .ajs-content{overflow:hidden!important}.alertify.ajs-no-padding.ajs-maximized .ajs-body .ajs-content{left:0;right:0;padding:0}.alertify.ajs-no-padding:not(.ajs-maximized) .ajs-body{margin-left:-24px;margin-right:-24px}.alertify.ajs-no-padding:not(.ajs-maximized) .ajs-body .ajs-content{padding:0}.alertify.ajs-no-padding.ajs-resizable .ajs-body .ajs-content{left:0;right:0}.alertify.ajs-maximizable .ajs-commands button.ajs-maximize,.alertify.ajs-maximizable .ajs-commands button.ajs-restore{display:inline-block}.alertify.ajs-closable .ajs-commands button.ajs-close{display:inline-block}.alertify.ajs-maximized .ajs-dialog{width:100%!important;height:100%!important;max-width:none!important;margin:0 auto!important;top:0!important;left:0!important}.alertify.ajs-maximized.ajs-modeless .ajs-modal{position:fixed!important;min-height:100%!important;max-height:none!important;margin:0!important}.alertify.ajs-maximized .ajs-commands button.ajs-maximize{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAASklEQVQYlZWQ0QkAMQhDtXRincOZX78KVtrDCwgqJNEoIB3MPLj7lRUROlpyVXGzby6zWuY+kz6tj5sBMTMAyVV3/595RbOh3cAXsww1raeiOcoAAAAASUVORK5CYII=)}.alertify.ajs-maximized .ajs-dialog,.alertify.ajs-resizable .ajs-dialog{padding:0}.alertify.ajs-maximized .ajs-commands,.alertify.ajs-resizable .ajs-commands{margin:14px 24px 0 0}.alertify.ajs-maximized .ajs-header,.alertify.ajs-resizable .ajs-header{position:absolute;top:0;left:0;right:0;margin:0;padding:16px 24px}.alertify.ajs-maximized .ajs-body,.alertify.ajs-resizable .ajs-body{min-height:224px;display:inline-block}.alertify.ajs-maximized .ajs-body .ajs-content,.alertify.ajs-resizable .ajs-body .ajs-content{position:absolute;top:50px;right:24px;bottom:50px;left:24px;overflow:auto}.alertify.ajs-maximized .ajs-footer,.alertify.ajs-resizable .ajs-footer{position:absolute;left:0;right:0;bottom:0;margin:0}.alertify.ajs-resizable:not(.ajs-maximized) .ajs-dialog{min-width:548px}.alertify.ajs-resizable:not(.ajs-maximized) .ajs-handle{display:block}.alertify.ajs-movable:not(.ajs-maximized) .ajs-header{cursor:move}.alertify.ajs-modeless .ajs-dimmer,.alertify.ajs-modeless .ajs-reset{display:none}.alertify.ajs-modeless .ajs-modal{overflow:visible;max-width:none;max-height:0}.alertify.ajs-modeless.ajs-pinnable .ajs-commands button.ajs-pin{display:inline-block;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAQklEQVQYlcWPMQ4AIAwCqU9u38GbcbHRWN1MvKQDhQFMEpKImGJA0gCgnYw0V0rwxseg5erT4oSkQVI5d9f+e9+xA0NbLpWfitPXAAAAAElFTkSuQmCC)}.alertify.ajs-modeless.ajs-unpinned .ajs-modal{position:absolute}.alertify.ajs-modeless.ajs-unpinned .ajs-commands button.ajs-pin{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABZ0RVh0Q3JlYXRpb24gVGltZQAwNy8xMy8xNOrZqugAAAAcdEVYdFNvZnR3YXJlAEFkb2JlIEZpcmV3b3JrcyBDUzbovLKMAAAAO0lEQVQYlWP8//8/AzGAiShV6AqLi4txGs+CLoBLMYbC3t5eRmyaWfBZhwwYkX2NTxPRvibKjRhW4wMAhxkYGbLu3pEAAAAASUVORK5CYII=)}.alertify.ajs-modeless:not(.ajs-unpinned) .ajs-body{max-height:500px;overflow:auto}.alertify.ajs-basic .ajs-header{opacity:0}.alertify.ajs-basic .ajs-footer{visibility:hidden}.alertify.ajs-frameless .ajs-header{position:absolute;top:0;left:0;right:0;min-height:60px;margin:0;padding:0;opacity:0;z-index:1}.alertify.ajs-frameless .ajs-footer{display:none}.alertify.ajs-frameless .ajs-body .ajs-content{position:absolute;top:0;right:0;bottom:0;left:0}.alertify.ajs-frameless:not(.ajs-resizable) .ajs-dialog{padding-top:0}.alertify.ajs-frameless:not(.ajs-resizable) .ajs-dialog .ajs-commands{margin-top:0}.ajs-no-overflow{overflow:hidden!important;outline:0}.ajs-no-overflow.ajs-fixed{position:fixed;top:0;right:0;bottom:0;left:0;overflow-y:scroll!important}.ajs-no-selection,.ajs-no-selection *{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}@media screen and (max-width:568px){.alertify .ajs-dialog{min-width:150px}.alertify:not(.ajs-maximized) .ajs-modal{padding:0 5%}.alertify:not(.ajs-maximized).ajs-resizable .ajs-dialog{min-width:initial;min-width:auto}}@-moz-document url-prefix(){.alertify button:focus{outline:1px dotted #3593d2}}.alertify .ajs-dimmer,.alertify .ajs-modal{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-transition-property:opacity,visibility;transition-property:opacity,visibility;-webkit-transition-timing-function:linear;transition-timing-function:linear;-webkit-transition-duration:250ms;transition-duration:250ms}.alertify.ajs-hidden .ajs-dimmer,.alertify.ajs-hidden .ajs-modal{visibility:hidden;opacity:0}.alertify.ajs-in:not(.ajs-hidden) .ajs-dialog{-webkit-animation-duration:.5s;animation-duration:.5s}.alertify.ajs-out.ajs-hidden .ajs-dialog{-webkit-animation-duration:250ms;animation-duration:250ms}.alertify .ajs-dialog.ajs-shake{-webkit-animation-name:ajs-shake;animation-name:ajs-shake;-webkit-animation-duration:.1s;animation-duration:.1s;-webkit-animation-fill-mode:both;animation-fill-mode:both}@-webkit-keyframes ajs-shake{0%,100%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}20%,40%,60%,80%{-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}}@keyframes ajs-shake{0%,100%{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}10%,30%,50%,70%,90%{-webkit-transform:translate3d(-10px,0,0);transform:translate3d(-10px,0,0)}20%,40%,60%,80%{-webkit-transform:translate3d(10px,0,0);transform:translate3d(10px,0,0)}}.alertify.ajs-slide.ajs-in:not(.ajs-hidden) .ajs-dialog{-webkit-animation-name:ajs-slideIn;animation-name:ajs-slideIn;-webkit-animation-timing-function:cubic-bezier(.175,.885,.32,1.275);animation-timing-function:cubic-bezier(.175,.885,.32,1.275)}.alertify.ajs-slide.ajs-out.ajs-hidden .ajs-dialog{-webkit-animation-name:ajs-slideOut;animation-name:ajs-slideOut;-webkit-animation-timing-function:cubic-bezier(.6,-.28,.735,.045);animation-timing-function:cubic-bezier(.6,-.28,.735,.045)}.alertify.ajs-zoom.ajs-in:not(.ajs-hidden) .ajs-dialog{-webkit-animation-name:ajs-zoomIn;animation-name:ajs-zoomIn}.alertify.ajs-zoom.ajs-out.ajs-hidden .ajs-dialog{-webkit-animation-name:ajs-zoomOut;animation-name:ajs-zoomOut}.alertify.ajs-fade.ajs-in:not(.ajs-hidden) .ajs-dialog{-webkit-animation-name:ajs-fadeIn;animation-name:ajs-fadeIn}.alertify.ajs-fade.ajs-out.ajs-hidden .ajs-dialog{-webkit-animation-name:ajs-fadeOut;animation-name:ajs-fadeOut}.alertify.ajs-pulse.ajs-in:not(.ajs-hidden) .ajs-dialog{-webkit-animation-name:ajs-pulseIn;animation-name:ajs-pulseIn}.alertify.ajs-pulse.ajs-out.ajs-hidden .ajs-dialog{-webkit-animation-name:ajs-pulseOut;animation-name:ajs-pulseOut}.alertify.ajs-flipx.ajs-in:not(.ajs-hidden) .ajs-dialog{-webkit-animation-name:ajs-flipInX;animation-name:ajs-flipInX}.alertify.ajs-flipx.ajs-out.ajs-hidden .ajs-dialog{-webkit-animation-name:ajs-flipOutX;animation-name:ajs-flipOutX}.alertify.ajs-flipy.ajs-in:not(.ajs-hidden) .ajs-dialog{-webkit-animation-name:ajs-flipInY;animation-name:ajs-flipInY}.alertify.ajs-flipy.ajs-out.ajs-hidden .ajs-dialog{-webkit-animation-name:ajs-flipOutY;animation-name:ajs-flipOutY}@-webkit-keyframes ajs-pulseIn{0%,100%,20%,40%,60%,80%{-webkit-transition-timing-function:cubic-bezier(.215,.61,.355,1);transition-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}20%{-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}40%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}60%{opacity:1;-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}80%{-webkit-transform:scale3d(.97,.97,.97);transform:scale3d(.97,.97,.97)}100%{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}}@keyframes ajs-pulseIn{0%,100%,20%,40%,60%,80%{-webkit-transition-timing-function:cubic-bezier(.215,.61,.355,1);transition-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}20%{-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}40%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}60%{opacity:1;-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}80%{-webkit-transform:scale3d(.97,.97,.97);transform:scale3d(.97,.97,.97)}100%{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}}@-webkit-keyframes ajs-pulseOut{20%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}50%,55%{opacity:1;-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}100%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}}@keyframes ajs-pulseOut{20%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}50%,55%{opacity:1;-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}100%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}}@-webkit-keyframes ajs-zoomIn{0%{opacity:0;-webkit-transform:scale3d(.25,.25,.25);transform:scale3d(.25,.25,.25)}100%{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}}@keyframes ajs-zoomIn{0%{opacity:0;-webkit-transform:scale3d(.25,.25,.25);transform:scale3d(.25,.25,.25)}100%{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}}@-webkit-keyframes ajs-zoomOut{0%{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}100%{opacity:0;-webkit-transform:scale3d(.25,.25,.25);transform:scale3d(.25,.25,.25)}}@keyframes ajs-zoomOut{0%{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}100%{opacity:0;-webkit-transform:scale3d(.25,.25,.25);transform:scale3d(.25,.25,.25)}}@-webkit-keyframes ajs-fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes ajs-fadeIn{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes ajs-fadeOut{0%{opacity:1}100%{opacity:0}}@keyframes ajs-fadeOut{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes ajs-flipInX{0%{-webkit-transform:perspective(400px) rotate3d(1,0,0,90deg);transform:perspective(400px) rotate3d(1,0,0,90deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in;opacity:0}40%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-20deg);transform:perspective(400px) rotate3d(1,0,0,-20deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in}60%{-webkit-transform:perspective(400px) rotate3d(1,0,0,10deg);transform:perspective(400px) rotate3d(1,0,0,10deg);opacity:1}80%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-5deg);transform:perspective(400px) rotate3d(1,0,0,-5deg)}100%{-webkit-transform:perspective(400px);transform:perspective(400px)}}@keyframes ajs-flipInX{0%{-webkit-transform:perspective(400px) rotate3d(1,0,0,90deg);transform:perspective(400px) rotate3d(1,0,0,90deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in;opacity:0}40%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-20deg);transform:perspective(400px) rotate3d(1,0,0,-20deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in}60%{-webkit-transform:perspective(400px) rotate3d(1,0,0,10deg);transform:perspective(400px) rotate3d(1,0,0,10deg);opacity:1}80%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-5deg);transform:perspective(400px) rotate3d(1,0,0,-5deg)}100%{-webkit-transform:perspective(400px);transform:perspective(400px)}}@-webkit-keyframes ajs-flipOutX{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-20deg);transform:perspective(400px) rotate3d(1,0,0,-20deg);opacity:1}100%{-webkit-transform:perspective(400px) rotate3d(1,0,0,90deg);transform:perspective(400px) rotate3d(1,0,0,90deg);opacity:0}}@keyframes ajs-flipOutX{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotate3d(1,0,0,-20deg);transform:perspective(400px) rotate3d(1,0,0,-20deg);opacity:1}100%{-webkit-transform:perspective(400px) rotate3d(1,0,0,90deg);transform:perspective(400px) rotate3d(1,0,0,90deg);opacity:0}}@-webkit-keyframes ajs-flipInY{0%{-webkit-transform:perspective(400px) rotate3d(0,1,0,90deg);transform:perspective(400px) rotate3d(0,1,0,90deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in;opacity:0}40%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-20deg);transform:perspective(400px) rotate3d(0,1,0,-20deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in}60%{-webkit-transform:perspective(400px) rotate3d(0,1,0,10deg);transform:perspective(400px) rotate3d(0,1,0,10deg);opacity:1}80%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-5deg);transform:perspective(400px) rotate3d(0,1,0,-5deg)}100%{-webkit-transform:perspective(400px);transform:perspective(400px)}}@keyframes ajs-flipInY{0%{-webkit-transform:perspective(400px) rotate3d(0,1,0,90deg);transform:perspective(400px) rotate3d(0,1,0,90deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in;opacity:0}40%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-20deg);transform:perspective(400px) rotate3d(0,1,0,-20deg);-webkit-transition-timing-function:ease-in;transition-timing-function:ease-in}60%{-webkit-transform:perspective(400px) rotate3d(0,1,0,10deg);transform:perspective(400px) rotate3d(0,1,0,10deg);opacity:1}80%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-5deg);transform:perspective(400px) rotate3d(0,1,0,-5deg)}100%{-webkit-transform:perspective(400px);transform:perspective(400px)}}@-webkit-keyframes ajs-flipOutY{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-15deg);transform:perspective(400px) rotate3d(0,1,0,-15deg);opacity:1}100%{-webkit-transform:perspective(400px) rotate3d(0,1,0,90deg);transform:perspective(400px) rotate3d(0,1,0,90deg);opacity:0}}@keyframes ajs-flipOutY{0%{-webkit-transform:perspective(400px);transform:perspective(400px)}30%{-webkit-transform:perspective(400px) rotate3d(0,1,0,-15deg);transform:perspective(400px) rotate3d(0,1,0,-15deg);opacity:1}100%{-webkit-transform:perspective(400px) rotate3d(0,1,0,90deg);transform:perspective(400px) rotate3d(0,1,0,90deg);opacity:0}}@-webkit-keyframes ajs-slideIn{0%{margin-top:-100%}100%{margin-top:5%}}@keyframes ajs-slideIn{0%{margin-top:-100%}100%{margin-top:5%}}@-webkit-keyframes ajs-slideOut{0%{margin-top:5%}100%{margin-top:-100%}}@keyframes ajs-slideOut{0%{margin-top:5%}100%{margin-top:-100%}}.alertify-notifier{position:fixed;width:0;overflow:visible;z-index:1982;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.alertify-notifier .ajs-message{position:relative;width:260px;max-height:0;padding:0;opacity:0;margin:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-transition-duration:250ms;transition-duration:250ms;-webkit-transition-timing-function:linear;transition-timing-function:linear}.alertify-notifier .ajs-message.ajs-visible{-webkit-transition-duration:.5s;transition-duration:.5s;-webkit-transition-timing-function:cubic-bezier(.175,.885,.32,1.275);transition-timing-function:cubic-bezier(.175,.885,.32,1.275);opacity:1;max-height:100%;padding:15px;margin-top:10px}.alertify-notifier .ajs-message.ajs-success{background:rgba(91,189,114,.95)}.alertify-notifier .ajs-message.ajs-error{background:rgba(217,92,92,.95)}.alertify-notifier .ajs-message.ajs-warning{background:rgba(252,248,215,.95)}.alertify-notifier .ajs-message .ajs-close{position:absolute;top:0;right:0;width:16px;height:16px;cursor:pointer;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAABGdBTUEAALGPC/xhBQAAAFBJREFUGBl1j0EKADEIA+ve/P9f9bh1hEihNBfjVCO1v7RKVqJK4h8gM5cAPR42AkQEpSXPwMTyoi13n5N9YqJehm3Fnr7nL1D0ZEbD5OubGyC7a9gx+9eNAAAAAElFTkSuQmCC);background-repeat:no-repeat;background-position:center center;background-color:rgba(0,0,0,.5);border-top-right-radius:2px}.alertify-notifier.ajs-top{top:10px}.alertify-notifier.ajs-bottom{bottom:10px}.alertify-notifier.ajs-right{right:10px}.alertify-notifier.ajs-right .ajs-message{right:-320px}.alertify-notifier.ajs-right .ajs-message.ajs-visible{right:290px}.alertify-notifier.ajs-left{left:10px}.alertify-notifier.ajs-left .ajs-message{left:-300px}.alertify-notifier.ajs-left .ajs-message.ajs-visible{left:0}.alertify-notifier.ajs-center{left:50%}.alertify-notifier.ajs-center .ajs-message{-webkit-transform:translateX(-50%);transform:translateX(-50%)}.alertify-notifier.ajs-center .ajs-message.ajs-visible{left:50%;-webkit-transition-timing-function:cubic-bezier(.57,.43,.1,.65);transition-timing-function:cubic-bezier(.57,.43,.1,.65)}.alertify-notifier.ajs-center.ajs-top .ajs-message{top:-300px}.alertify-notifier.ajs-center.ajs-top .ajs-message.ajs-visible{top:0}.alertify-notifier.ajs-center.ajs-bottom .ajs-message{bottom:-300px}.alertify-notifier.ajs-center.ajs-bottom .ajs-message.ajs-visible{bottom:0}.ajs-no-transition.alertify .ajs-dialog,.ajs-no-transition.alertify .ajs-dimmer,.ajs-no-transition.alertify .ajs-modal{-webkit-transition:none!important;transition:none!important;-webkit-animation:none!important;animation:none!important}.ajs-no-transition.alertify-notifier .ajs-message{-webkit-transition:none!important;transition:none!important;-webkit-animation:none!important;animation:none!important}@media (prefers-reduced-motion:reduce){.alertify .ajs-dialog,.alertify .ajs-dimmer,.alertify .ajs-modal{-webkit-transition:none!important;transition:none!important;-webkit-animation:none!important;animation:none!important}.alertify-notifier .ajs-message{-webkit-transition:none!important;transition:none!important;-webkit-animation:none!important;animation:none!important}}\ No newline at end of filediff --git a/spiderfoot/static/css/bootstrap.min.css b/spiderfoot/static/node_modules/bootstrap/dist/css/bootstrap.min.cssold mode 100644new mode 100755similarity index 99%rename from spiderfoot/static/css/bootstrap.min.cssrename to spiderfoot/static/node_modules/bootstrap/dist/css/bootstrap.min.cssindex 74d979b7..5b96335f--- a/spiderfoot/static/css/bootstrap.min.css+++ b/spiderfoot/static/node_modules/bootstrap/dist/css/bootstrap.min.css@@ -3,3 +3,4 @@* Copyright 2011-2019 Twitter, Inc.* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)*//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;-moz-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,:after,:before{color:#000!important;text-shadow:none!important;background:0 0!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}@font-face{font-family:"Glyphicons Halflings";src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format("embedded-opentype"),url(../fonts/glyphicons-halflings-regular.woff2) format("woff2"),url(../fonts/glyphicons-halflings-regular.woff) format("woff"),url(../fonts/glyphicons-halflings-regular.ttf) format("truetype"),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format("svg")}.glyphicon{position:relative;top:1px;display:inline-block;font-family:"Glyphicons Halflings";font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-eur:before,.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:focus,a:hover{color:#23527c;text-decoration:underline}a:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#777}.h1,.h2,.h3,h1,h2,h3{margin-top:20px;margin-bottom:10px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:10px;margin-bottom:10px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:36px}.h2,h2{font-size:30px}.h3,h3{font-size:24px}.h4,h4{font-size:18px}.h5,h5{font-size:14px}.h6,h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}.small,small{font-size:85%}.mark,mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:focus,a.text-primary:hover{color:#286090}.text-success{color:#3c763d}a.text-success:focus,a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:focus,a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:focus,a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:focus,a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:focus,a.bg-primary:hover{background-color:#286090}.bg-success{background-color:#dff0d8}a.bg-success:focus,a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:focus,a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:focus,a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:focus,a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ol,ul{margin-top:0;margin-bottom:10px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dd,dt{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[data-original-title],abbr[title]{cursor:help}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child{margin-bottom:0}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote .small:before,blockquote footer:before,blockquote small:before{content:"\2014 \00A0"}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:""}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:"\00A0 \2014"}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;font-weight:700;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.row-no-gutters{margin-right:0;margin-left:0}.row-no-gutters [class*=col-]{padding-right:0;padding-left:0}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#dff0d8}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#d0e9c6}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#d9edf7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#c4e3f3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#fcf8e3}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#faf2cc}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#f2dede}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#ebcccc}.table-responsive{min-height:.01%;overflow-x:auto}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s,-webkit-box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{background-color:transparent;border:0}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=datetime-local].form-control,input[type=month].form-control,input[type=time].form-control{line-height:34px}.input-group-sm input[type=date],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],.input-group-sm input[type=time],input[type=date].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm,input[type=time].input-sm{line-height:30px}.input-group-lg input[type=date],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],.input-group-lg input[type=time],input[type=date].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg,input[type=time].input-lg{line-height:46px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox.disabled label,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .radio label{cursor:not-allowed}.checkbox label,.radio label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-top:4px\9;margin-left:-20px}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.checkbox-inline.disabled,.radio-inline.disabled,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio-inline{cursor:not-allowed}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}.form-control-static{min-height:34px;padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .checkbox,.form-horizontal .radio{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#333;text-decoration:none}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;filter:alpha(opacity=65);opacity:.65;-webkit-box-shadow:none;box-shadow:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default.focus,.btn-default:focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default.active,.btn-default:active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;background-image:none;border-color:#adadad}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary.active,.btn-primary:active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;background-image:none;border-color:#204d74}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;background-image:none;border-color:#398439}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#398439;border-color:#255625}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info.active,.btn-info:active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;background-image:none;border-color:#269abc}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning.active,.btn-warning:active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;background-image:none;border-color:#d58512}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger.active,.btn-danger:active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;background-image:none;border-color:#ac2925}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#337ab7;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#777;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-property:height,visibility;-o-transition-property:height,visibility;transition-property:height,visibility;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown,.dropup{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;background-color:#337ab7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#777}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#eee;border-color:#337ab7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}@media (min-width:768px){.navbar-fixed-bottom,.navbar-fixed-top{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-right:15px;margin-top:8px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{padding:10px 15px;margin-right:-15px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);margin-top:8px;margin-bottom:8px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#9d9d9d}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#9d9d9d}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-link{color:#9d9d9d}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#9d9d9d}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#337ab7;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#23527c;background-color:#eee;border-color:#ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#fff;cursor:default;background-color:#337ab7;border-color:#337ab7}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:focus,.label-default[href]:hover{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#286090}.label-success{background-color:#5cb85c}.label-success[href]:focus,.label-success[href]:hover{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:focus,.label-info[href]:hover{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:middle;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}a.badge:focus,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#337ab7;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron .h1,.jumbotron h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{padding-right:15px;padding-left:15px;border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-right:60px;padding-left:60px}.jumbotron .h1,.jumbotron h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-right:auto;margin-left:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#337ab7}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0%;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{overflow:hidden;zoom:1}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{color:#777;cursor:not-allowed;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#c7ddef}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{color:#555;text-decoration:none;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-left-radius:0;border-top-right-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-right:15px;padding-left:15px}.panel>.table-responsive:first-child>.table:first-child,.panel>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table-responsive:last-child>.table:last-child,.panel>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out,-o-transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:400;line-height:1.42857143;line-break:auto;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;font-size:12px;filter:alpha(opacity=0);opacity:0}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px;bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:400;line-height:1.42857143;line-break:auto;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;font-size:14px;background-color:#fff;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover>.arrow{border-width:11px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.popover-title{padding:8px 14px;margin:0;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>a>img,.carousel-inner>.item>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:-webkit-transform .6s ease-in-out;transition:transform .6s ease-in-out;transition:transform .6s ease-in-out,-webkit-transform .6s ease-in-out,-o-transform .6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);left:0}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);left:0}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);left:0}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);background-color:rgba(0,0,0,0);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;outline:0;filter:alpha(opacity=90);opacity:.9}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;z-index:5;display:inline-block;margin-top:-10px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;font-family:serif;line-height:1}.carousel-control .icon-prev:before{content:"\2039"}.carousel-control .icon-next:before{content:"\203a"}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{display:table;content:" "}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-lg,.visible-md,.visible-sm,.visible-xs{display:none!important}.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}}+/*# sourceMappingURL=bootstrap.min.css.map */\ No newline at end of filediff --git a/spiderfoot/static/js/bootstrap.min.js b/spiderfoot/static/node_modules/bootstrap/dist/js/bootstrap.min.jsold mode 100644new mode 100755similarity index 100%rename from spiderfoot/static/js/bootstrap.min.jsrename to spiderfoot/static/node_modules/bootstrap/dist/js/bootstrap.min.jsdiff --git a/spiderfoot/static/fonts/glyphicons-halflings-regular.woff b/spiderfoot/static/node_modules/bootstrap/fonts/glyphicons-halflings-regular.woffold mode 100644new mode 100755similarity index 100%rename from spiderfoot/static/fonts/glyphicons-halflings-regular.woffrename to spiderfoot/static/node_modules/bootstrap/fonts/glyphicons-halflings-regular.woffdiff --git a/spiderfoot/static/fonts/glyphicons-halflings-regular.woff2 b/spiderfoot/static/node_modules/bootstrap/fonts/glyphicons-halflings-regular.woff2old mode 100644new mode 100755similarity index 100%rename from spiderfoot/static/fonts/glyphicons-halflings-regular.woff2rename to spiderfoot/static/node_modules/bootstrap/fonts/glyphicons-halflings-regular.woff2diff --git a/spiderfoot/static/node_modules/jquery/dist/jquery.min.js b/spiderfoot/static/node_modules/jquery/dist/jquery.min.jsnew file mode 100755index 00000000..c4c6022f--- /dev/null+++ b/spiderfoot/static/node_modules/jquery/dist/jquery.min.js@@ -0,0 +1,2 @@+/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */+!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}S.fn=S.prototype={jquery:f,constructor:S,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=S.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return S.each(this,e)},map:function(n){return this.pushStack(S.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,function(e,t){return(t+1)%2}))},odd:function(){return this.pushStack(S.grep(this,function(e,t){return t%2}))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},S.extend=S.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(S.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||S.isPlainObject(n)?n:{},i=!1,a[t]=S.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},S.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){b(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(p(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},makeArray:function(e,t){var n=t||[];return null!=e&&(p(Object(e))?S.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(p(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g(a)},guid:1,support:y}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=t[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var d=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,S="sizzle"+1*new Date,p=n.document,k=0,r=0,m=ue(),x=ue(),A=ue(),N=ue(),j=function(e,t){return e===t&&(l=!0),0},D={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",B=new RegExp(M+"+","g"),$=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="<a id='"+S+"'></a><select id='"+S+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!=C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!=C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&D.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(j),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(B," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[k,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===k&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[S]||(a[S]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[k,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[S]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace($,"$1"));return s[S]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[k,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[S]||(e[S]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===k&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[S]&&(v=Ce(v)),y&&!y[S]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[S]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace($,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace($," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=A[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[S]?i.push(a):o.push(a);(a=A(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=k+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t==C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument==C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(k=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(k=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=S.split("").sort(j).join("")===S,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);S.find=d,S.expr=d.selectors,S.expr[":"]=S.expr.pseudos,S.uniqueSort=S.unique=d.uniqueSort,S.text=d.getText,S.isXMLDoc=d.isXML,S.contains=d.contains,S.escapeSelector=d.escape;var h=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&S(e).is(n))break;r.push(e)}return r},T=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},k=S.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var N=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1<i.call(n,e)!==r}):S.filter(n,e,r)}S.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?S.find.matchesSelector(r,e)?[r]:[]:S.find.matches(e,S.grep(t,function(e){return 1===e.nodeType}))},S.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(S(e).filter(function(){for(t=0;t<r;t++)if(S.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)S.find(e,i[t],n);return 1<r?S.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&k.test(e)?S(e):e||[],!1).length}});var D,q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(S.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&S(e);if(!k.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&S.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?S.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(S(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),S.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t,n){return h(e,"parentNode",n)},next:function(e){return O(e,"nextSibling")},prev:function(e){return O(e,"previousSibling")},nextAll:function(e){return h(e,"nextSibling")},prevAll:function(e){return h(e,"previousSibling")},nextUntil:function(e,t,n){return h(e,"nextSibling",n)},prevUntil:function(e,t,n){return h(e,"previousSibling",n)},siblings:function(e){return T((e.parentNode||{}).firstChild,e)},children:function(e){return T(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),S.merge([],e.childNodes))}},function(r,i){S.fn[r]=function(e,t){var n=S.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=S.filter(t,n)),1<this.length&&(H[r]||S.uniqueSort(n),L.test(r)&&n.reverse()),this.pushStack(n)}});var P=/[^\x20\t\r\n\f]+/g;function R(e){return e}function M(e){throw e}function I(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}S.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},S.each(e.match(P)||[],function(e,t){n[t]=!0}),n):S.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){S.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return S.each(arguments,function(e,t){var n;while(-1<(n=S.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<S.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},S.extend({Deferred:function(e){var o=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return S.Deferred(function(r){S.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,R,s),l(u,o,M,s)):(u++,t.call(e,l(u,o,R,s),l(u,o,M,s),l(u,o,R,o.notifyWith))):(a!==R&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==M&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(S.Deferred.getStackHook&&(t.stackTrace=S.Deferred.getStackHook()),C.setTimeout(t))}}return S.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:R,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:R)),o[2][3].add(l(0,e,m(n)?n:M))}).promise()},promise:function(e){return null!=e?S.extend(e,a):a}},s={};return S.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=S.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(I(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)I(i[t],a(t),o.reject);return o.promise()}});var W=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&W.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},S.readyException=function(e){C.setTimeout(function(){throw e})};var F=S.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),S.ready()}S.fn.ready=function(e){return F.then(e)["catch"](function(e){S.readyException(e)}),this},S.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--S.readyWait:S.isReady)||(S.isReady=!0)!==e&&0<--S.readyWait||F.resolveWith(E,[S])}}),S.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(S.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var $=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)$(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(S(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},_=/^-ms-/,z=/-([a-z])/g;function U(e,t){return t.toUpperCase()}function X(e){return e.replace(_,"ms-").replace(z,U)}var V=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function G(){this.expando=S.expando+G.uid++}G.uid=1,G.prototype={cache:function(e){var t=e[this.expando];return t||(t={},V(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[X(t)]=n;else for(r in t)i[X(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][X(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(X):(t=X(t))in r?[t]:t.match(P)||[]).length;while(n--)delete r[t[n]]}(void 0===t||S.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!S.isEmptyObject(t)}};var Y=new G,Q=new G,J=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,K=/[A-Z]/g;function Z(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(K,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:J.test(i)?JSON.parse(i):i)}catch(e){}Q.set(e,t,n)}else n=void 0;return n}S.extend({hasData:function(e){return Q.hasData(e)||Y.hasData(e)},data:function(e,t,n){return Q.access(e,t,n)},removeData:function(e,t){Q.remove(e,t)},_data:function(e,t,n){return Y.access(e,t,n)},_removeData:function(e,t){Y.remove(e,t)}}),S.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=Q.get(o),1===o.nodeType&&!Y.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=X(r.slice(5)),Z(o,r,i[r]));Y.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){Q.set(this,n)}):$(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=Q.get(o,n))?t:void 0!==(t=Z(o,n))?t:void 0;this.each(function(){Q.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){Q.remove(this,e)})}}),S.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Y.get(e,t),n&&(!r||Array.isArray(n)?r=Y.access(e,t,S.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=S.queue(e,t),r=n.length,i=n.shift(),o=S._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){S.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Y.get(e,n)||Y.access(e,n,{empty:S.Callbacks("once memory").add(function(){Y.remove(e,[t+"queue",n])})})}}),S.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?S.queue(this[0],t):void 0===n?this:this.each(function(){var e=S.queue(this,t,n);S._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&S.dequeue(this,t)})},dequeue:function(e){return this.each(function(){S.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=S.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Y.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var ee=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,te=new RegExp("^(?:([+-])=|)("+ee+")([a-z%]*)$","i"),ne=["Top","Right","Bottom","Left"],re=E.documentElement,ie=function(e){return S.contains(e.ownerDocument,e)},oe={composed:!0};re.getRootNode&&(ie=function(e){return S.contains(e.ownerDocument,e)||e.getRootNode(oe)===e.ownerDocument});var ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ie(e)&&"none"===S.css(e,"display")};function se(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return S.css(e,t,"")},u=s(),l=n&&n[3]||(S.cssNumber[t]?"":"px"),c=e.nodeType&&(S.cssNumber[t]||"px"!==l&&+u)&&te.exec(S.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)S.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,S.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ue={};function le(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Y.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&ae(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ue[s])||(o=a.body.appendChild(a.createElement(s)),u=S.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ue[s]=u)))):"none"!==n&&(l[c]="none",Y.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}S.fn.extend({show:function(){return le(this,!0)},hide:function(){return le(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?S(this).show():S(this).hide()})}});var ce,fe,pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="<option></option>",y.option=!!ce.lastChild;var ge={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Y.set(e[n],"globalEval",!t||Y.get(t[n],"globalEval"))}ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td,y.option||(ge.optgroup=ge.option=[1,"<select multiple='multiple'>","</select>"]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))S.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;S.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<S.inArray(o,r))i&&i.push(o);else if(l=ie(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}var be=/^([^.]*)(?:\.(.+)|)/;function we(){return!0}function Te(){return!1}function Ce(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ee(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ee(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Te;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}function Se(e,i,o){o?(Y.set(e,i,!1),S.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Y.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(S.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Y.set(this,i,r),t=o(this,i),this[i](),r!==(n=Y.get(this,i))||t?Y.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n&&n.value}else r.length&&(Y.set(this,i,{value:S.event.trigger(S.extend(r[0],S.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Y.get(e,i)&&S.event.add(e,i,we)}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(V(t)){n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(re,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;while(l--)d=g=(s=be.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(P)||[""]).length;while(l--)if(d=g=(s=be.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),u=S.event.fix(e),l=(Y.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(s[0]=u,t=1;t<arguments.length;t++)s[t]=arguments[t];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){a=S.event.handlers.call(this,u,l),t=0;while((i=a[t++])&&!u.isPropagationStopped()){u.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!u.isImmediatePropagationStopped())u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(r=((S.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,s))&&!1===(u.result=r)&&(u.preventDefault(),u.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<S(i,this).index(l):S.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[S.expando]?e:new S.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click",we),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&Se(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Y.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},S.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},S.Event=function(e,t){if(!(this instanceof S.Event))return new S.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?we:Te,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&S.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Te,isPropagationStopped:Te,isImmediatePropagationStopped:Te,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=we,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=we,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=we,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},function(e,t){S.event.special[e]={setup:function(){return Se(this,e,Ce),!1},trigger:function(){return Se(this,e),!0},_default:function(){return!0},delegateType:t}}),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){S.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||S.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),S.fn.extend({on:function(e,t,n,r){return Ee(this,e,t,n,r)},one:function(e,t,n,r){return Ee(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,S(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Te),this.each(function(){S.event.remove(this,e,n,t)})}});var ke=/<script|<style|<link/i,Ae=/checked\s*(?:[^=]|=\s*.checked.)/i,Ne=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n<r;n++)S.event.add(t,i,s[i][n]);Q.hasData(e)&&(o=Q.access(e),a=S.extend({},o),Q.set(t,a))}}function He(n,r,i,o){r=g(r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&Ae.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),He(t,r,i,o)});if(f&&(t=(e=xe(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=S.map(ve(e,"script"),De)).length;c<f;c++)u=e,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,S.map(a,qe),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Y.access(u,"globalEval")&&S.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):b(u.textContent.replace(Ne,""),u,l))}return n}function Oe(e,t,n){for(var r,i=t?S.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||S.cleanData(ve(r)),r.parentNode&&(n&&ie(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}S.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=ie(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Le(o[r],a[r]);else Le(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=S.event.special,o=0;void 0!==(n=e[o]);o++)if(V(n)){if(t=n[Y.expando]){if(t.events)for(r in t.events)i[r]?S.event.remove(n,r):S.removeEvent(n,r,t.handle);n[Y.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),S.fn.extend({detach:function(e){return Oe(this,e,!0)},remove:function(e){return Oe(this,e)},text:function(e){return $(this,function(e){return void 0===e?S.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return He(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||je(this,e).appendChild(e)})},prepend:function(){return He(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=je(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return He(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(S.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return S.clone(this,e,t)})},html:function(e){return $(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ke.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=S.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(S.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return He(this,arguments,function(e){var t=this.parentNode;S.inArray(this,n)<0&&(S.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){S.fn[e]=function(e){for(var t,n=[],r=S(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),S(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var Pe=new RegExp("^("+ee+")(?!px)[a-z%]+$","i"),Re=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Me=function(e,t,n){var r,i,o={};for(i in t)o[i]=e.style[i],e.style[i]=t[i];for(i in r=n.call(e),t)e.style[i]=o[i];return r},Ie=new RegExp(ne.join("|"),"i");function We(e,t,n){var r,i,o,a,s=e.style;return(n=n||Re(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||ie(e)||(a=S.style(e,t)),!y.pixelBoxStyles()&&Pe.test(a)&&Ie.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function Fe(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",re.appendChild(u).appendChild(l);var e=C.getComputedStyle(l);n="1%"!==e.top,s=12===t(e.marginLeft),l.style.right="60%",o=36===t(e.right),r=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),re.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s,u=E.createElement("div"),l=E.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===l.style.backgroundClip,S.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),s},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,r;return null==a&&(e=E.createElement("table"),t=E.createElement("tr"),n=E.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",re.appendChild(e).appendChild(t).appendChild(n),r=C.getComputedStyle(t),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===t.offsetHeight,re.removeChild(e)),a}}))}();var Be=["Webkit","Moz","ms"],$e=E.createElement("div").style,_e={};function ze(e){var t=S.cssProps[e]||_e[e];return t||(e in $e?e:_e[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Be.length;while(n--)if((e=Be[n]+t)in $e)return e}(e)||e)}var Ue=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,Ve={position:"absolute",visibility:"hidden",display:"block"},Ge={letterSpacing:"0",fontWeight:"400"};function Ye(e,t,n){var r=te.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Qe(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=S.css(e,n+ne[a],!0,i)),r?("content"===n&&(u-=S.css(e,"padding"+ne[a],!0,i)),"margin"!==n&&(u-=S.css(e,"border"+ne[a]+"Width",!0,i))):(u+=S.css(e,"padding"+ne[a],!0,i),"padding"!==n?u+=S.css(e,"border"+ne[a]+"Width",!0,i):s+=S.css(e,"border"+ne[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function Je(e,t,n){var r=Re(e),i=(!y.boxSizingReliable()||n)&&"border-box"===S.css(e,"boxSizing",!1,r),o=i,a=We(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Pe.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||!y.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===S.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+Qe(e,t,n||(i?"border":"content"),o,r,a)+"px"}function Ke(e,t,n,r,i){return new Ke.prototype.init(e,t,n,r,i)}S.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=We(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=X(t),u=Xe.test(t),l=e.style;if(u||(t=ze(s)),a=S.cssHooks[t]||S.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=te.exec(n))&&i[1]&&(n=se(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(S.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=X(t);return Xe.test(t)||(t=ze(s)),(a=S.cssHooks[t]||S.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=We(e,t,r)),"normal"===i&&t in Ge&&(i=Ge[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),S.each(["height","width"],function(e,u){S.cssHooks[u]={get:function(e,t,n){if(t)return!Ue.test(S.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?Je(e,u,n):Me(e,Ve,function(){return Je(e,u,n)})},set:function(e,t,n){var r,i=Re(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===S.css(e,"boxSizing",!1,i),s=n?Qe(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-Qe(e,u,"border",!1,i)-.5)),s&&(r=te.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=S.css(e,u)),Ye(0,t,s)}}}),S.cssHooks.marginLeft=Fe(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(We(e,"marginLeft"))||e.getBoundingClientRect().left-Me(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),S.each({margin:"",padding:"",border:"Width"},function(i,o){S.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+ne[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(S.cssHooks[i+o].set=Ye)}),S.fn.extend({css:function(e,t){return $(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Re(e),i=t.length;a<i;a++)o[t[a]]=S.css(e,t[a],!1,r);return o}return void 0!==n?S.style(e,t,n):S.css(e,t)},e,t,1<arguments.length)}}),((S.Tween=Ke).prototype={constructor:Ke,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||S.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var e=Ke.propHooks[this.prop];return e&&e.get?e.get(this):Ke.propHooks._default.get(this)},run:function(e){var t,n=Ke.propHooks[this.prop];return this.options.duration?this.pos=t=S.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):Ke.propHooks._default.set(this),this}}).init.prototype=Ke.prototype,(Ke.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=S.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){S.fx.step[e.prop]?S.fx.step[e.prop](e):1!==e.elem.nodeType||!S.cssHooks[e.prop]&&null==e.elem.style[ze(e.prop)]?e.elem[e.prop]=e.now:S.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=Ke.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},S.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},S.fx=Ke.prototype.init,S.fx.step={};var Ze,et,tt,nt,rt=/^(?:toggle|show|hide)$/,it=/queueHooks$/;function ot(){et&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(ot):C.setTimeout(ot,S.fx.interval),S.fx.tick())}function at(){return C.setTimeout(function(){Ze=void 0}),Ze=Date.now()}function st(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=ne[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function ut(e,t,n){for(var r,i=(lt.tweeners[t]||[]).concat(lt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function lt(o,e,t){var n,a,r=0,i=lt.prefilters.length,s=S.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=Ze||at(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},t),originalProperties:e,originalOptions:t,startTime:Ze||at(),duration:t.duration,tweens:[],createTween:function(e,t){var n=S.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=X(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=S.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=lt.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return S.map(c,ut,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(lt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return se(n.elem,e,te.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(P);for(var n,r=0,i=e.length;r<i;r++)n=e[r],lt.tweeners[n]=lt.tweeners[n]||[],lt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),v=Y.get(e,"fxshow");for(r in n.queue||(null==(a=S._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,S.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],rt.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||S.style(e,r)}if((u=!S.isEmptyObject(t))||!S.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Y.get(e,"display")),"none"===(c=S.css(e,"display"))&&(l?c=l:(le([e],!0),l=e.style.display||l,c=S.css(e,"display"),le([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Y.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&le([e],!0),p.done(function(){for(r in g||le([e]),Y.remove(e,"fxshow"),d)S.style(e,r,d[r])})),u=ut(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?lt.prefilters.unshift(e):lt.prefilters.push(e)}}),S.speed=function(e,t,n){var r=e&&"object"==typeof e?S.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return S.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in S.fx.speeds?r.duration=S.fx.speeds[r.duration]:r.duration=S.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&S.dequeue(this,r.queue)},r},S.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=S.isEmptyObject(t),o=S.speed(e,n,r),a=function(){var e=lt(this,S.extend({},t),o);(i||Y.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=S.timers,r=Y.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&it.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||S.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Y.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=S.timers,o=n?n.length:0;for(t.finish=!0,S.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),S.each(["toggle","show","hide"],function(e,r){var i=S.fn[r];S.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(st(r,!0),e,t,n)}}),S.each({slideDown:st("show"),slideUp:st("hide"),slideToggle:st("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){S.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),S.timers=[],S.fx.tick=function(){var e,t=0,n=S.timers;for(Ze=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||S.fx.stop(),Ze=void 0},S.fx.timer=function(e){S.timers.push(e),S.fx.start()},S.fx.interval=13,S.fx.start=function(){et||(et=!0,ot())},S.fx.stop=function(){et=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(r,e){return r=S.fx&&S.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},tt=E.createElement("input"),nt=E.createElement("select").appendChild(E.createElement("option")),tt.type="checkbox",y.checkOn=""!==tt.value,y.optSelected=nt.selected,(tt=E.createElement("input")).value="t",tt.type="radio",y.radioValue="t"===tt.value;var ct,ft=S.expr.attrHandle;S.fn.extend({attr:function(e,t){return $(this,S.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){S.removeAttr(this,e)})}}),S.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?S.prop(e,t,n):(1===o&&S.isXMLDoc(e)||(i=S.attrHooks[t.toLowerCase()]||(S.expr.match.bool.test(t)?ct:void 0)),void 0!==n?null===n?void S.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=S.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(P);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),ct={set:function(e,t,n){return!1===t?S.removeAttr(e,n):e.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),function(e,t){var a=ft[t]||S.find.attr;ft[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=ft[o],ft[o]=r,r=null!=a(e,t,n)?o:null,ft[o]=i),r}});var pt=/^(?:input|select|textarea|button)$/i,dt=/^(?:a|area)$/i;function ht(e){return(e.match(P)||[]).join(" ")}function gt(e){return e.getAttribute&&e.getAttribute("class")||""}function vt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(P)||[]}S.fn.extend({prop:function(e,t){return $(this,S.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[S.propFix[e]||e]})}}),S.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(e)||(t=S.propFix[t]||t,i=S.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=S.find.attr(e,"tabindex");return t?parseInt(t,10):pt.test(e.nodeName)||dt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(S.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){S.propFix[this.toLowerCase()]=this}),S.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).addClass(t.call(this,e,gt(this)))});if((e=vt(t)).length)while(n=this[u++])if(i=gt(n),r=1===n.nodeType&&" "+ht(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=ht(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){S(this).removeClass(t.call(this,e,gt(this)))});if(!arguments.length)return this.attr("class","");if((e=vt(t)).length)while(n=this[u++])if(i=gt(n),r=1===n.nodeType&&" "+ht(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=ht(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){S(this).toggleClass(i.call(this,e,gt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=S(this),r=vt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=gt(this))&&Y.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Y.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+ht(gt(n))+" ").indexOf(t))return!0;return!1}});var yt=/\r/g;S.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,S(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=S.map(t,function(e){return null==e?"":e+""})),(r=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=S.valHooks[t.type]||S.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(yt,""):null==e?"":e:void 0}}),S.extend({valHooks:{option:{get:function(e){var t=S.find.attr(e,"value");return null!=t?t:ht(S.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=S(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=S.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<S.inArray(S.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],function(){S.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<S.inArray(S(e).val(),t)}},y.checkOn||(S.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var mt=/^(?:focusinfocus|focusoutblur)$/,xt=function(e){e.stopPropagation()};S.extend(S.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!mt.test(d+S.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[S.expando]?e:new S.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:S.makeArray(t,[e]),c=S.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,mt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Y.get(o,"events")||Object.create(null))[e.type]&&Y.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&V(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!V(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),S.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,xt),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,xt),S.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=S.extend(new S.Event,n,{type:e,isSimulated:!0});S.event.trigger(r,null,t)}}),S.fn.extend({trigger:function(e,t){return this.each(function(){S.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return S.event.trigger(e,t,n,!0)}}),y.focusin||S.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){S.event.simulate(r,e.target,S.event.fix(e))};S.event.special[r]={setup:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r);t||e.addEventListener(n,i,!0),Y.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this.document||this,t=Y.access(e,r)-1;t?Y.access(e,r,t):(e.removeEventListener(n,i,!0),Y.remove(e,r))}}});var bt=C.location,wt={guid:Date.now()},Tt=/\?/;S.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,function(e){return e.textContent}).join("\n"):e)),t};var Ct=/\[\]$/,Et=/\r?\n/g,St=/^(?:submit|button|image|reset|file)$/i,kt=/^(?:input|select|textarea|keygen)/i;function At(n,e,r,i){var t;if(Array.isArray(e))S.each(e,function(e,t){r||Ct.test(n)?i(n,t):At(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)At(n+"["+t+"]",e[t],r,i)}S.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!S.isPlainObject(e))S.each(e,function(){i(this.name,this.value)});else for(n in e)At(n,e[n],t,i);return r.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=S.prop(this,"elements");return e?S.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!S(this).is(":disabled")&&kt.test(this.nodeName)&&!St.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,function(e){return{name:t.name,value:e.replace(Et,"\r\n")}}):{name:t.name,value:n.replace(Et,"\r\n")}}).get()}});var Nt=/%20/g,jt=/#.*$/,Dt=/([?&])_=[^&]*/,qt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Lt=/^(?:GET|HEAD)$/,Ht=/^\/\//,Ot={},Pt={},Rt="*/".concat("*"),Mt=E.createElement("a");function It(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(P)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function Wt(t,i,o,a){var s={},u=t===Pt;function l(e){var r;return s[e]=!0,S.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function Ft(e,t){var n,r,i=S.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&S.extend(!0,e,r),e}Mt.href=bt.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:bt.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(bt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Rt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Ft(Ft(e,S.ajaxSettings),t):Ft(S.ajaxSettings,e)},ajaxPrefilter:It(Ot),ajaxTransport:It(Pt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=S.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?S(y):S.event,x=S.Deferred(),b=S.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=qt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||bt.href)+"").replace(Ht,bt.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(P)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Mt.protocol+"//"+Mt.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=S.param(v.data,v.traditional)),Wt(Ot,v,t,T),h)return T;for(i in(g=S.event&&v.global)&&0==S.active++&&S.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Lt.test(v.type),f=v.url.replace(jt,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Nt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(Tt.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Dt,"$1"),o=(Tt.test(f)?"&":"?")+"_="+wt.guid+++o),v.url=f+o),v.ifModified&&(S.lastModified[f]&&T.setRequestHeader("If-Modified-Since",S.lastModified[f]),S.etag[f]&&T.setRequestHeader("If-None-Match",S.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+Rt+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=Wt(Pt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),!i&&-1<S.inArray("script",v.dataTypes)&&S.inArray("json",v.dataTypes)<0&&(v.converters["text script"]=function(){}),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(S.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(S.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return S.get(e,t,n,"json")},getScript:function(e,t){return S.get(e,void 0,t,"script")}}),S.each(["get","post"],function(e,i){S[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),S.ajax(S.extend({url:e,type:i,dataType:r,data:t,success:n},S.isPlainObject(e)&&e))}}),S.ajaxPrefilter(function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")}),S._evalUrl=function(e,t,n){return S.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){S.globalEval(e,t,n)}})},S.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=S(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){S(this).wrapInner(n.call(this,e))}):this.each(function(){var e=S(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){S(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){S(this).replaceWith(this.childNodes)}),this}}),S.expr.pseudos.hidden=function(e){return!S.expr.pseudos.visible(e)},S.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var Bt={0:200,1223:204},$t=S.ajaxSettings.xhr();y.cors=!!$t&&"withCredentials"in $t,y.ajax=$t=!!$t,S.ajaxTransport(function(i){var o,a;if(y.cors||$t&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Bt[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),S.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return S.globalEval(e),e}}}),S.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),S.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=S("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=ht(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&S.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?S("<div>").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}});var Xt=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||S.guid++,i},S.holdReady=function(e){e?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=m,S.isWindow=x,S.camelCase=X,S.type=w,S.now=Date.now,S.isNumeric=function(e){var t=S.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},S.trim=function(e){return null==e?"":(e+"").replace(Xt,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return S});var Vt=C.jQuery,Gt=C.$;return S.noConflict=function(e){return C.$===S&&(C.$=Gt),e&&C.jQuery===S&&(C.jQuery=Vt),S},"undefined"==typeof e&&(C.jQuery=C.$=S),S});diff --git a/spiderfoot/static/node_modules/sigma/build/plugins/sigma.layout.forceAtlas2.min.js b/spiderfoot/static/node_modules/sigma/build/plugins/sigma.layout.forceAtlas2.min.jsnew file mode 100755index 00000000..369b028b--- /dev/null+++ b/spiderfoot/static/node_modules/sigma/build/plugins/sigma.layout.forceAtlas2.min.js@@ -0,0 +1 @@+(function(undefined){"use strict";function Supervisor(sigInst,options){var _this=this,workerFn=sigInst.getForceAtlas2Worker&&sigInst.getForceAtlas2Worker();if(options=options||{},_root.URL=_root.URL||_root.webkitURL,this.sigInst=sigInst,this.graph=this.sigInst.graph,this.ppn=10,this.ppe=3,this.config={},this.shouldUseWorker=!1!==options.worker&&webWorkers,this.workerUrl=options.workerUrl,this.started=!1,this.running=!1,this.shouldUseWorker){if(this.workerUrl)this.worker=new Worker(this.workerUrl);else{var blob=this.makeBlob(workerFn);this.worker=new Worker(URL.createObjectURL(blob))}this.worker.postMessage=this.worker.webkitPostMessage||this.worker.postMessage}else eval(workerFn);this.msgName=this.worker?"message":"newCoords",this.listener=function(t){_this.nodesByteArray=new Float32Array(t.data.nodes),_this.running&&(_this.applyLayoutChanges(),_this.sendByteArrayToWorker(),_this.sigInst.refresh())},(this.worker||document).addEventListener(this.msgName,this.listener),this.graphToByteArrays(),sigInst.bind("kill",function(){sigInst.killForceAtlas2()})}if("undefined"==typeof sigma)throw"sigma is not declared";var _root=this,webWorkers="Worker"in _root;Supervisor.prototype.makeBlob=function(t){var e;try{e=new Blob([t],{type:"application/javascript"})}catch(s){_root.BlobBuilder=_root.BlobBuilder||_root.WebKitBlobBuilder||_root.MozBlobBuilder,e=new BlobBuilder,e.append(t),e=e.getBlob()}return e},Supervisor.prototype.graphToByteArrays=function(){var t,e,s,r=this.graph.nodes(),i=this.graph.edges(),o=r.length*this.ppn,n=i.length*this.ppe,a={};for(this.nodesByteArray=new Float32Array(o),this.edgesByteArray=new Float32Array(n),t=e=0,s=r.length;t<s;t++)a[r[t].id]=e,this.nodesByteArray[e]=r[t].x,this.nodesByteArray[e+1]=r[t].y,this.nodesByteArray[e+2]=0,this.nodesByteArray[e+3]=0,this.nodesByteArray[e+4]=0,this.nodesByteArray[e+5]=0,this.nodesByteArray[e+6]=1+this.graph.degree(r[t].id),this.nodesByteArray[e+7]=1,this.nodesByteArray[e+8]=r[t].size,this.nodesByteArray[e+9]=0,e+=this.ppn;for(t=e=0,s=i.length;t<s;t++)this.edgesByteArray[e]=a[i[t].source],this.edgesByteArray[e+1]=a[i[t].target],this.edgesByteArray[e+2]=i[t].weight||0,e+=this.ppe},Supervisor.prototype.applyLayoutChanges=function(){for(var t=this.graph.nodes(),e=0,s=0,r=this.nodesByteArray.length;s<r;s+=this.ppn)t[e].x=this.nodesByteArray[s],t[e].y=this.nodesByteArray[s+1],e++},Supervisor.prototype.sendByteArrayToWorker=function(t){var e={action:t||"loop",nodes:this.nodesByteArray.buffer},s=[this.nodesByteArray.buffer];"start"===t&&(e.config=this.config||{},e.edges=this.edgesByteArray.buffer,s.push(this.edgesByteArray.buffer)),this.shouldUseWorker?this.worker.postMessage(e,s):_root.postMessage(e,"*")},Supervisor.prototype.start=function(){if(!this.running){this.running=!0;var t,e;for(t in this.sigInst.cameras)e=this.sigInst.cameras[t],e.edgequadtree._enabled=!1;this.started?this.sendByteArrayToWorker():(this.sendByteArrayToWorker("start"),this.started=!0)}},Supervisor.prototype.stop=function(){if(this.running){var t,e,s;for(t in this.sigInst.cameras)e=this.sigInst.cameras[t],e.edgequadtree._enabled=!0,s=sigma.utils.getBoundaries(this.graph,e.readPrefix),e.settings("drawEdges")&&e.settings("enableEdgeHovering")&&e.edgequadtree.index(this.sigInst.graph,{prefix:e.readPrefix,bounds:{x:s.minX,y:s.minY,width:s.maxX-s.minX,height:s.maxY-s.minY}});this.running=!1}},Supervisor.prototype.killWorker=function(){this.worker?this.worker.terminate():(_root.postMessage({action:"kill"},"*"),document.removeEventListener(this.msgName,this.listener))},Supervisor.prototype.configure=function(t){if(this.config=t,this.started){var e={action:"config",config:this.config};this.shouldUseWorker?this.worker.postMessage(e):_root.postMessage(e,"*")}},sigma.prototype.startForceAtlas2=function(t){return this.supervisor||(this.supervisor=new Supervisor(this,t)),t&&this.supervisor.configure(t),this.supervisor.start(),this},sigma.prototype.stopForceAtlas2=function(){return this.supervisor?(this.supervisor.stop(),this):this},sigma.prototype.killForceAtlas2=function(){return this.supervisor?(this.supervisor.stop(),this.supervisor.killWorker(),this.supervisor=null,this):this},sigma.prototype.configForceAtlas2=function(t){return this.supervisor||(this.supervisor=new Supervisor(this,t)),this.supervisor.configure(t),this},sigma.prototype.isForceAtlas2Running=function(t){return!!this.supervisor&&this.supervisor.running}}).call(this),function(undefined){"use strict";function no_crush(t){var e,s,r,i=["x","y","dx","dy","old_dx","old_dy","mass","convergence","size","fixed"],o=["source","target","weight"],n=["node","centerX","centerY","size","nextSibling","firstChild","mass","massCenterX","massCenterY"];for(s=0,r=n.length;s<r;s++)e=new RegExp("rp\\(([^,]*), '"+n[s]+"'\\)","g"),t=t.replace(e,0===s?"$1":"$1 + "+s);for(s=0,r=i.length;s<r;s++)e=new RegExp("np\\(([^,]*), '"+i[s]+"'\\)","g"),t=t.replace(e,0===s?"$1":"$1 + "+s);for(s=0,r=o.length;s<r;s++)e=new RegExp("ep\\(([^,]*), '"+o[s]+"'\\)","g"),t=t.replace(e,0===s?"$1":"$1 + "+s);return t}function getWorkerFn(){return";("+(crush?crush(Worker.toString()):Worker.toString())+").call(this);"}var _root=this,inWebWorker=!("document"in _root),Worker=function(t){function e(){var t,e,s={},r=arguments.length;for(t=r-1;t>=0;t--)for(e in arguments[t])s[e]=arguments[t][e];return s}function s(t){var e;for(e in t)"hasOwnProperty"in t&&!t.hasOwnProperty(e)||delete t[e];return t}function r(t,e,s){s=s||{};a=t,h=e,u.nodesLength=a.length,u.edgesLength=h.length,i(s)}function i(t){u.settings=e(t,u.settings)}function o(){var t,e,s,r,i,o,n,g,d,l,c,f,y,w,v;for(s=0;s<u.nodesLength;s+=u.ppn)a[s+4]=a[s+2],a[s+5]=a[s+3],a[s+2]=0,a[s+3]=0;if(u.settings.outboundAttractionDistribution){for(d=0,s=0;s<u.nodesLength;s+=u.ppn)d+=a[s+6];d/=u.nodesLength}if(u.settings.barnesHutOptimize){var k,m,b=1/0,M=-1/0,A=1/0,B=-1/0;for(p=[],s=0;s<u.nodesLength;s+=u.ppn)b=Math.min(b,a[s]),M=Math.max(M,a[s]),A=Math.min(A,a[s+1]),B=Math.max(B,a[s+1]);for(p[0]=-1,p[1]=(b+M)/2,p[2]=(A+B)/2,p[3]=Math.max(M-b,B-A),p[4]=-1,p[5]=-1,p[6]=0,p[7]=0,p[8]=0,t=1,s=0;s<u.nodesLength;s+=u.ppn)for(e=0;;)if(p[e+5]>=0)k=a[s]<p[e+1]?a[s+1]<p[e+2]?p[e+5]:p[e+5]+u.ppr:a[s+1]<p[e+2]?p[e+5]+2*u.ppr:p[e+5]+3*u.ppr,p[e+7]=(p[e+7]*p[e+6]+a[s]*a[s+6])/(p[e+6]+a[s+6]),p[e+8]=(p[e+8]*p[e+6]+a[s+1]*a[s+6])/(p[e+6]+a[s+6]),p[e+6]+=a[s+6],e=k;else{if(p[e]<0){p[e]=s;break}if(p[e+5]=t*u.ppr,n=p[e+3]/2,g=p[e+5],p[g]=-1,p[g+1]=p[e+1]-n,p[g+2]=p[e+2]-n,p[g+3]=n,p[g+4]=g+u.ppr,p[g+5]=-1,p[g+6]=0,p[g+7]=0,p[g+8]=0,g+=u.ppr,p[g]=-1,p[g+1]=p[e+1]-n,p[g+2]=p[e+2]+n,p[g+3]=n,p[g+4]=g+u.ppr,p[g+5]=-1,p[g+6]=0,p[g+7]=0,p[g+8]=0,g+=u.ppr,p[g]=-1,p[g+1]=p[e+1]+n,p[g+2]=p[e+2]-n,p[g+3]=n,p[g+4]=g+u.ppr,p[g+5]=-1,p[g+6]=0,p[g+7]=0,p[g+8]=0,g+=u.ppr,p[g]=-1,p[g+1]=p[e+1]+n,p[g+2]=p[e+2]+n,p[g+3]=n,p[g+4]=p[e+4],p[g+5]=-1,p[g+6]=0,p[g+7]=0,p[g+8]=0,t+=4,k=a[p[e]]<p[e+1]?a[p[e]+1]<p[e+2]?p[e+5]:p[e+5]+u.ppr:a[p[e]+1]<p[e+2]?p[e+5]+2*u.ppr:p[e+5]+3*u.ppr,p[e+6]=a[p[e]+6],p[e+7]=a[p[e]],p[e+8]=a[p[e]+1],p[k]=p[e],p[e]=-1,m=a[s]<p[e+1]?a[s+1]<p[e+2]?p[e+5]:p[e+5]+u.ppr:a[s+1]<p[e+2]?p[e+5]+2*u.ppr:p[e+5]+3*u.ppr,k!==m){p[m]=s;break}e=k}}if(u.settings.barnesHutOptimize)for(l=u.settings.scalingRatio,s=0;s<u.nodesLength;s+=u.ppn)for(e=0;;)if(p[e+5]>=0){if(w=Math.sqrt(Math.pow(a[s]-p[e+7],2)+Math.pow(a[s+1]-p[e+8],2)),2*p[e+3]/w<u.settings.barnesHutTheta){if(c=a[s]-p[e+7],f=a[s+1]-p[e+8],u.settings.adjustSizes?w>0?(v=l*a[s+6]*p[e+6]/w/w,a[s+2]+=c*v,a[s+3]+=f*v):w<0&&(v=-l*a[s+6]*p[e+6]/w,a[s+2]+=c*v,a[s+3]+=f*v):w>0&&(v=l*a[s+6]*p[e+6]/w/w,a[s+2]+=c*v,a[s+3]+=f*v),p[e+4]<0)break;e=p[e+4];continue}e=p[e+5]}else{if(p[e]>=0&&p[e]!==s&&(c=a[s]-a[p[e]],f=a[s+1]-a[p[e]+1],w=Math.sqrt(c*c+f*f),u.settings.adjustSizes?w>0?(v=l*a[s+6]*a[p[e]+6]/w/w,a[s+2]+=c*v,a[s+3]+=f*v):w<0&&(v=-l*a[s+6]*a[p[e]+6]/w,a[s+2]+=c*v,a[s+3]+=f*v):w>0&&(v=l*a[s+6]*a[p[e]+6]/w/w,a[s+2]+=c*v,a[s+3]+=f*v)),p[e+4]<0)break;e=p[e+4]}else for(l=u.settings.scalingRatio,r=0;r<u.nodesLength;r+=u.ppn)for(i=0;i<r;i+=u.ppn)c=a[r]-a[i],f=a[r+1]-a[i+1],u.settings.adjustSizes?(w=Math.sqrt(c*c+f*f)-a[r+8]-a[i+8],w>0?(v=l*a[r+6]*a[i+6]/w/w,a[r+2]+=c*v,a[r+3]+=f*v,a[i+2]+=c*v,a[i+3]+=f*v):w<0&&(v=100*l*a[r+6]*a[i+6],a[r+2]+=c*v,a[r+3]+=f*v,a[i+2]-=c*v,a[i+3]-=f*v)):(w=Math.sqrt(c*c+f*f))>0&&(v=l*a[r+6]*a[i+6]/w/w,a[r+2]+=c*v,a[r+3]+=f*v,a[i+2]-=c*v,a[i+3]-=f*v);for(g=u.settings.gravity/u.settings.scalingRatio,l=u.settings.scalingRatio,s=0;s<u.nodesLength;s+=u.ppn)v=0,c=a[s],f=a[s+1],w=Math.sqrt(Math.pow(c,2)+Math.pow(f,2)),u.settings.strongGravityMode?w>0&&(v=l*a[s+6]*g):w>0&&(v=l*a[s+6]*g/w),a[s+2]-=c*v,a[s+3]-=f*v;for(l=1*(u.settings.outboundAttractionDistribution?d:1),o=0;o<u.edgesLength;o+=u.ppe)r=h[o],i=h[o+1],n=h[o+2],y=Math.pow(n,u.settings.edgeWeightInfluence),c=a[r]-a[i],f=a[r+1]-a[i+1],u.settings.adjustSizes?(w=Math.sqrt(Math.pow(c,2)+Math.pow(f,2)-a[r+8]-a[i+8]),u.settings.linLogMode?u.settings.outboundAttractionDistribution?w>0&&(v=-l*y*Math.log(1+w)/w/a[r+6]):w>0&&(v=-l*y*Math.log(1+w)/w):u.settings.outboundAttractionDistribution?w>0&&(v=-l*y/a[r+6]):w>0&&(v=-l*y)):(w=Math.sqrt(Math.pow(c,2)+Math.pow(f,2)),u.settings.linLogMode?u.settings.outboundAttractionDistribution?w>0&&(v=-l*y*Math.log(1+w)/w/a[r+6]):w>0&&(v=-l*y*Math.log(1+w)/w):u.settings.outboundAttractionDistribution?(w=1,v=-l*y/a[r+6]):(w=1,v=-l*y)),w>0&&(a[r+2]+=c*v,a[r+3]+=f*v,a[i+2]-=c*v,a[i+3]-=f*v);var W,L,F,_;if(u.settings.adjustSizes)for(s=0;s<u.nodesLength;s+=u.ppn)a[s+9]||(W=Math.sqrt(Math.pow(a[s+2],2)+Math.pow(a[s+3],2)),W>u.maxForce&&(a[s+2]=a[s+2]*u.maxForce/W,a[s+3]=a[s+3]*u.maxForce/W),L=a[s+6]*Math.sqrt((a[s+4]-a[s+2])*(a[s+4]-a[s+2])+(a[s+5]-a[s+3])*(a[s+5]-a[s+3])),F=Math.sqrt((a[s+4]+a[s+2])*(a[s+4]+a[s+2])+(a[s+5]+a[s+3])*(a[s+5]+a[s+3]))/2,_=.1*Math.log(1+F)/(1+Math.sqrt(L)),a[s]=a[s]+a[s+2]*(_/u.settings.slowDown),a[s+1]=a[s+1]+a[s+3]*(_/u.settings.slowDown));else for(s=0;s<u.nodesLength;s+=u.ppn)a[s+9]||(L=a[s+6]*Math.sqrt((a[s+4]-a[s+2])*(a[s+4]-a[s+2])+(a[s+5]-a[s+3])*(a[s+5]-a[s+3])),F=Math.sqrt((a[s+4]+a[s+2])*(a[s+4]+a[s+2])+(a[s+5]+a[s+3])*(a[s+5]+a[s+3]))/2,_=a[s+7]*Math.log(1+F)/(1+Math.sqrt(L)),a[s+7]=Math.min(1,Math.sqrt(_*(Math.pow(a[s+2],2)+Math.pow(a[s+3],2))/(1+Math.sqrt(L)))),a[s]=a[s]+a[s+2]*(_/u.settings.slowDown),a[s+1]=a[s+1]+a[s+3]*(_/u.settings.slowDown));u.iterations++}function n(t){for(var e=0;e<t;e++)o();g()}var a,h,p,g,u={ppn:10,ppe:3,ppr:9,maxForce:10,iterations:0,converged:!1,settings:{linLogMode:!1,outboundAttractionDistribution:!1,adjustSizes:!1,edgeWeightInfluence:0,scalingRatio:1,strongGravityMode:!1,gravity:1,slowDown:1,barnesHutOptimize:!1,barnesHutTheta:.5,startingIterations:1,iterationsPerRender:1}};g="undefined"!=typeof window&&window.document?function(){var t;document.createEvent?(t=document.createEvent("Event"),t.initEvent("newCoords",!0,!1)):(t=document.createEventObject(),t.eventType="newCoords"),t.eventName="newCoords",t.data={nodes:a.buffer},requestAnimationFrame(function(){document.dispatchEvent(t)})}:function(){self.postMessage({nodes:a.buffer},[a.buffer])};var d=function(t){switch(t.data.action){case"start":r(new Float32Array(t.data.nodes),new Float32Array(t.data.edges),t.data.config),n(u.settings.startingIterations);break;case"loop":a=new Float32Array(t.data.nodes),n(u.settings.iterationsPerRender);break;case"config":i(t.data.config);break;case"kill":s(u),a=null,h=null,p=null,self.removeEventListener("message",d)}};self.addEventListener("message",d)},crush=null;if(inWebWorker)eval(getWorkerFn());else{if("undefined"==typeof sigma)throw"sigma is not declared";sigma.prototype.getForceAtlas2Worker=getWorkerFn}}.call(this);\ No newline at end of filediff --git a/spiderfoot/static/js/sigma.parsers.json.min.js b/spiderfoot/static/node_modules/sigma/build/plugins/sigma.parsers.json.min.jsold mode 100644new mode 100755similarity index 87%rename from spiderfoot/static/js/sigma.parsers.json.min.jsrename to spiderfoot/static/node_modules/sigma/build/plugins/sigma.parsers.json.min.jsindex 368c9338..4060a774--- a/spiderfoot/static/js/sigma.parsers.json.min.js+++ b/spiderfoot/static/node_modules/sigma/build/plugins/sigma.parsers.json.min.js@@ -1 +1 @@-(function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.parsers"),sigma.utils.pkg("sigma.utils"),sigma.utils.xhr=function(){if(window.XMLHttpRequest)return new XMLHttpRequest;var a,b;if(window.ActiveXObject){a=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"];for(b in a)try{return new ActiveXObject(a[b])}catch(c){}}return null},sigma.parsers.json=function(a,b,c){var d,e=sigma.utils.xhr();if(!e)throw"XMLHttpRequest not supported, cannot load the file.";e.open("GET",a,!0),e.onreadystatechange=function(){4===e.readyState&&(d=JSON.parse(e.responseText),b instanceof sigma?(b.graph.clear(),b.graph.read(d)):"object"==typeof b?(b.graph=d,b=new sigma(b)):"function"==typeof b&&(c=b,b=null),c&&c(b||d))},e.send()}}).call(this);\ No newline at end of file+(function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.parsers"),sigma.utils.pkg("sigma.utils"),sigma.utils.xhr=function(){if(window.XMLHttpRequest)return new XMLHttpRequest;var a,b;if(window.ActiveXObject){a=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"];for(b in a)try{return new ActiveXObject(a[b])}catch(a){}}return null},sigma.parsers.json=function(a,b,c){var d,e=sigma.utils.xhr();if(!e)throw"XMLHttpRequest not supported, cannot load the file.";e.open("GET",a,!0),e.onreadystatechange=function(){4===e.readyState&&(d=JSON.parse(e.responseText),b instanceof sigma?(b.graph.clear(),b.graph.read(d)):"object"==typeof b?(b.graph=d,b=new sigma(b)):"function"==typeof b&&(c=b,b=null),c&&c(b||d))},e.send()}}).call(this);\ No newline at end of filediff --git a/spiderfoot/static/js/sigma.plugins.dragNodes.min.js b/spiderfoot/static/node_modules/sigma/build/plugins/sigma.plugins.dragNodes.min.jsold mode 100644new mode 100755similarity index 52%rename from spiderfoot/static/js/sigma.plugins.dragNodes.min.jsrename to spiderfoot/static/node_modules/sigma/build/plugins/sigma.plugins.dragNodes.min.jsindex c6b1200e..e2b34f18--- a/spiderfoot/static/js/sigma.plugins.dragNodes.min.js+++ b/spiderfoot/static/node_modules/sigma/build/plugins/sigma.plugins.dragNodes.min.js@@ -1 +1 @@-(function(){"use strict";function a(a,b){function c(a){var b=window.getComputedStyle(a),c=function(a){return parseInt(b.getPropertyValue(a).replace("px",""))||0};return{left:a.getBoundingClientRect().left+c("padding-left"),top:a.getBoundingClientRect().top+c("padding-top")}}function d(a){t=!1,l.removeEventListener("mousemove",i),l.removeEventListener("mouseup",h),r.length||(p=null)}function e(a){s[a.data.node.id]||(r.push(a.data.node),s[a.data.node.id]=!0,r.length&&!t&&(p=r[r.length-1],n.addEventListener("mousedown",g)))}function f(a){var b=r.map(function(a){return a}).indexOf(a.data.node);r.splice(b,1),delete s[a.data.node.id],r.length&&!t?p=r[r.length-1]:n.removeEventListener("mousedown",g)}function g(a){t=!0;var b=k.graph.nodes().length;if(p&&b>1){n.removeEventListener("mousedown",g),l.addEventListener("mousemove",i),l.addEventListener("mouseup",h);var c,d;for(c in k.cameras)d=k.cameras[c],void 0!==d.edgequadtree&&(d.edgequadtree._enabled=!1);m.settings({mouseEnabled:!1,enableHovering:!1}),k.refresh(),j.dispatchEvent("startdrag",{node:p,captor:a,renderer:m})}}function h(a){t=!1,n.addEventListener("mousedown",g),l.removeEventListener("mousemove",i),l.removeEventListener("mouseup",h);var b,c;for(b in k.cameras)c=k.cameras[b],void 0!==c.edgequadtree&&(c.edgequadtree._enabled=!0);m.settings({mouseEnabled:!0,enableHovering:!0}),k.refresh(),u&&j.dispatchEvent("drop",{node:p,captor:a,renderer:m}),j.dispatchEvent("dragend",{node:p,captor:a,renderer:m}),u=!1,p=null}function i(a){function b(){for(var b=c(m.container),d=a.clientX-b.left,e=a.clientY-b.top,f=Math.cos(o.angle),g=Math.sin(o.angle),h=k.graph.nodes(),i=[],l=0;2>l;l++){var n=h[l],r={x:n.x*f+n.y*g,y:n.y*f-n.x*g,renX:n[q+"x"],renY:n[q+"y"]};i.push(r)}d=(d-i[0].renX)/(i[1].renX-i[0].renX)*(i[1].x-i[0].x)+i[0].x,e=(e-i[0].renY)/(i[1].renY-i[0].renY)*(i[1].y-i[0].y)+i[0].y,p.x=d*f-e*g,p.y=e*f+d*g,k.refresh(),u=!0,j.dispatchEvent("drag",{node:p,captor:a,renderer:m})}if(navigator.userAgent.toLowerCase().indexOf("firefox")>-1){clearTimeout(d);var d=setTimeout(b,0)}else b()}if(sigma.classes.dispatcher.extend(this),sigma.renderers.webgl&&b instanceof sigma.renderers.webgl)throw new Error("The sigma.plugins.dragNodes is not compatible with the WebGL renderer");var j=this,k=a,l=document.body,m=b,n=b.container.lastChild,o=b.camera,p=null,q="",r=[],s={},t=!1,u=!1;b instanceof sigma.renderers.svg&&(n=b.container.firstChild),q=b instanceof sigma.renderers.webgl?b.options.prefix.substr(5):b.options.prefix,b.bind("overNode",e),b.bind("outNode",f),b.bind("click",d),k.bind("kill",function(){j.unbindAll()}),this.unbindAll=function(){n.removeEventListener("mousedown",g),l.removeEventListener("mousemove",i),l.removeEventListener("mouseup",h),m.unbind("overNode",e),m.unbind("outNode",f)}}if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.plugins");var b={};sigma.plugins.dragNodes=function(c,d){return b[c.id]||(b[c.id]=new a(c,d)),c.bind("kill",function(){sigma.plugins.killDragNodes(c)}),b[c.id]},sigma.plugins.killDragNodes=function(c){b[c.id]instanceof a&&(b[c.id].unbindAll(),delete b[c.id])}}).call(window);\ No newline at end of file+(function(){"use strict";function a(a,b){function c(a){var b=window.getComputedStyle(a),c=function(a){return parseInt(b.getPropertyValue(a).replace("px",""))||0};return{left:a.getBoundingClientRect().left+c("padding-left"),top:a.getBoundingClientRect().top+c("padding-top")}}function d(a){t=!1,l.removeEventListener("mousemove",i),l.removeEventListener("mouseup",h),r.length||(p=null)}function e(a){s[a.data.node.id]||(r.push(a.data.node),s[a.data.node.id]=!0,r.length&&!t&&(p=r[r.length-1],n.addEventListener("mousedown",g)))}function f(a){var b=r.map(function(a){return a}).indexOf(a.data.node);r.splice(b,1),delete s[a.data.node.id],r.length&&!t?p=r[r.length-1]:n.removeEventListener("mousedown",g)}function g(a){t=!0;var b=k.graph.nodes().length;if(p&&b>1){n.removeEventListener("mousedown",g),l.addEventListener("mousemove",i),l.addEventListener("mouseup",h);var c,d;for(c in k.cameras)d=k.cameras[c],void 0!==d.edgequadtree&&(d.edgequadtree._enabled=!1);m.settings({mouseEnabled:!1,enableHovering:!1}),k.refresh(),j.dispatchEvent("startdrag",{node:p,captor:a,renderer:m})}}function h(a){t=!1,n.addEventListener("mousedown",g),l.removeEventListener("mousemove",i),l.removeEventListener("mouseup",h);var b,c;for(b in k.cameras)c=k.cameras[b],void 0!==c.edgequadtree&&(c.edgequadtree._enabled=!0);m.settings({mouseEnabled:!0,enableHovering:!0}),k.refresh(),u&&j.dispatchEvent("drop",{node:p,captor:a,renderer:m}),j.dispatchEvent("dragend",{node:p,captor:a,renderer:m}),u=!1,p=null}function i(a){function b(){for(var b=c(m.container),d=a.clientX-b.left,e=a.clientY-b.top,f=Math.cos(o.angle),g=Math.sin(o.angle),h=k.graph.nodes(),i=[],l=0;l<2;l++){var n=h[l],r={x:n.x*f+n.y*g,y:n.y*f-n.x*g,renX:n[q+"x"],renY:n[q+"y"]};i.push(r)}if(i[0].x===i[1].x&&i[0].y===i[1].y){var s=0===i[0].renX?1:i[0].renX,t=0===i[0].renY?1:i[0].renY;d=i[0].x/s*(d-i[0].renX)+i[0].x,e=i[0].y/t*(e-i[0].renY)+i[0].y}else{var s=(i[1].renX-i[0].renX)/(i[1].x-i[0].x),t=(i[1].renY-i[0].renY)/(i[1].y-i[0].y);i[1].x===i[0].x&&(s=t),i[1].y===i[0].y&&(t=s),d=(d-i[0].renX)/s+i[0].x,e=(e-i[0].renY)/t+i[0].y}p.x=d*f-e*g,p.y=e*f+d*g,k.refresh(),u=!0,j.dispatchEvent("drag",{node:p,captor:a,renderer:m})}if(navigator.userAgent.toLowerCase().indexOf("firefox")>-1){clearTimeout(d);var d=setTimeout(b,0)}else b()}sigma.classes.dispatcher.extend(this);var j=this,k=a,l=document.body,m=b,n=b.container.lastChild,o=b.camera,p=null,q="",r=[],s={},t=!1,u=!1;b instanceof sigma.renderers.svg&&(n=b.container.firstChild),q=b instanceof sigma.renderers.webgl?b.options.prefix.substr(5):b.options.prefix,b.bind("overNode",e),b.bind("outNode",f),b.bind("click",d),k.bind("kill",function(){j.unbindAll()}),this.unbindAll=function(){n.removeEventListener("mousedown",g),l.removeEventListener("mousemove",i),l.removeEventListener("mouseup",h),m.unbind("overNode",e),m.unbind("outNode",f)}}if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.plugins");var b={};sigma.plugins.dragNodes=function(c,d){return b[c.id]||(b[c.id]=new a(c,d)),c.bind("kill",function(){sigma.plugins.killDragNodes(c)}),b[c.id]},sigma.plugins.killDragNodes=function(c){b[c.id]instanceof a&&(b[c.id].unbindAll(),delete b[c.id])}}).call(window);\ No newline at end of filediff --git a/spiderfoot/static/js/sigma.renderers.snapshot.min.js b/spiderfoot/static/node_modules/sigma/build/plugins/sigma.renderers.snapshot.min.jsold mode 100644new mode 100755similarity index 91%rename from spiderfoot/static/js/sigma.renderers.snapshot.min.jsrename to spiderfoot/static/node_modules/sigma/build/plugins/sigma.renderers.snapshot.min.jsindex 9eb9571b..1e4e05e9--- a/spiderfoot/static/js/sigma.renderers.snapshot.min.js+++ b/spiderfoot/static/node_modules/sigma/build/plugins/sigma.renderers.snapshot.min.js@@ -1 +1 @@-(function(a){function b(a,b,c){var d=document.createElement("a");d.setAttribute("href",a),d.setAttribute("download",c||"graph."+b);var e=document.createEvent("MouseEvent");e.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),d.dispatchEvent(e),delete d}function c(a){if(a=a||{},a.format&&!(a.format in e))throw Error('sigma.renderers.snaphot: unsupported format "'+a.format+'".');var c=this,f=this instanceof sigma.renderers.webgl,g=[],h=document.createElement("canvas"),i=h.getContext("2d"),j=!1;d.forEach(function(b){if(c.contexts[b]&&(a.labels!==!1||"labels"!==b)){var d=c.domElements[b]||c.domElements.scene,e=c.contexts[b];~g.indexOf(e)||(j||(h.width=f&&e instanceof WebGLRenderingContext?d.width/2:d.width,h.height=f&&e instanceof WebGLRenderingContext?d.height/2:d.height,j=!0,a.background&&(i.rect(0,0,h.width,h.height),i.fillStyle=a.background,i.fill())),e instanceof WebGLRenderingContext?i.drawImage(d,0,0,d.width/2,d.height/2):i.drawImage(d,0,0),g.push(e))}});var k=h.toDataURL(e[a.format||"png"]);return a.download&&b(k,a.format||"png",a.filename),delete i,delete h,delete g,k}if("undefined"==typeof sigma)throw"sigma.renderers.snapshot: sigma not in scope.";var d=["scene","edges","nodes","labels"],e={png:"image/png",jpg:"image/jpeg",gif:"image/gif",tiff:"image/tiff"};sigma.renderers.canvas.prototype.snapshot=c,sigma.renderers.webgl.prototype.snapshot=c}).call(this);\ No newline at end of file+(function(a){function b(a,b,c){var d=document.createElement("a");d.setAttribute("href",a),d.setAttribute("download",c||"graph."+b);var e=document.createEvent("MouseEvent");e.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),d.dispatchEvent(e),delete d}function c(a){if(a=a||{},a.format&&!(a.format in e))throw Error('sigma.renderers.snaphot: unsupported format "'+a.format+'".');var c=this,f=this instanceof sigma.renderers.webgl,g=[],h=document.createElement("canvas"),i=h.getContext("2d"),j=!1;d.forEach(function(b){if(c.contexts[b]&&(!1!==a.labels||"labels"!==b)){var d=c.domElements[b]||c.domElements.scene,e=c.contexts[b];~g.indexOf(e)||(j||(h.width=f&&e instanceof WebGLRenderingContext?d.width/2:d.width,h.height=f&&e instanceof WebGLRenderingContext?d.height/2:d.height,j=!0,a.background&&(i.rect(0,0,h.width,h.height),i.fillStyle=a.background,i.fill())),e instanceof WebGLRenderingContext?i.drawImage(d,0,0,d.width/2,d.height/2):i.drawImage(d,0,0),g.push(e))}});var k=h.toDataURL(e[a.format||"png"]);return a.download&&b(k,a.format||"png",a.filename),delete i,delete h,delete g,k}if("undefined"==typeof sigma)throw"sigma.renderers.snapshot: sigma not in scope.";var d=["scene","edges","nodes","labels"],e={png:"image/png",jpg:"image/jpeg",gif:"image/gif",tiff:"image/tiff"};sigma.renderers.canvas.prototype.snapshot=c,sigma.renderers.webgl.prototype.snapshot=c}).call(this);\ No newline at end of filediff --git a/spiderfoot/static/node_modules/sigma/build/sigma.min.js b/spiderfoot/static/node_modules/sigma/build/sigma.min.jsnew file mode 100755index 00000000..e0e6786d--- /dev/null+++ b/spiderfoot/static/node_modules/sigma/build/sigma.min.js@@ -0,0 +1,2 @@+/* sigma.js - A JavaScript library dedicated to graph drawing. - Version: 1.2.1 - Author: Alexis Jacomy, Sciences-Po Médialab - License: MIT */+(function(a){"use strict";var b={},c=function(a){var d,e,f,g,h;c.classes.dispatcher.extend(this);var i=this,j=a||{};if("string"==typeof j||j instanceof HTMLElement?j={renderers:[j]}:"[object Array]"===Object.prototype.toString.call(j)&&(j={renderers:j}),g=j.renderers||j.renderer||j.container,j.renderers&&0!==j.renderers.length||("string"==typeof g||g instanceof HTMLElement||"object"==typeof g&&"container"in g)&&(j.renderers=[g]),j.id){if(b[j.id])throw'sigma: Instance "'+j.id+'" already exists.';Object.defineProperty(this,"id",{value:j.id})}else{for(h=0;b[h];)h++;Object.defineProperty(this,"id",{value:""+h})}for(b[this.id]=this,this.settings=new c.classes.configurable(c.settings,j.settings||{}),Object.defineProperty(this,"graph",{value:new c.classes.graph(this.settings),configurable:!0}),Object.defineProperty(this,"middlewares",{value:[],configurable:!0}),Object.defineProperty(this,"cameras",{value:{},configurable:!0}),Object.defineProperty(this,"renderers",{value:{},configurable:!0}),Object.defineProperty(this,"renderersPerCamera",{value:{},configurable:!0}),Object.defineProperty(this,"cameraFrames",{value:{},configurable:!0}),Object.defineProperty(this,"camera",{get:function(){return this.cameras[0]}}),Object.defineProperty(this,"events",{value:["click","rightClick","clickStage","doubleClickStage","rightClickStage","clickNode","clickNodes","doubleClickNode","doubleClickNodes","rightClickNode","rightClickNodes","overNode","overNodes","outNode","outNodes","downNode","downNodes","upNode","upNodes"],configurable:!0}),this._handler=function(a){var b,c={};for(b in a.data)c[b]=a.data[b];c.renderer=a.target,this.dispatchEvent(a.type,c)}.bind(this),f=j.renderers||[],d=0,e=f.length;d<e;d++)this.addRenderer(f[d]);for(f=j.middlewares||[],d=0,e=f.length;d<e;d++)this.middlewares.push("string"==typeof f[d]?c.middlewares[f[d]]:f[d]);"object"==typeof j.graph&&j.graph&&(this.graph.read(j.graph),this.refresh()),window.addEventListener("resize",function(){i.settings&&i.refresh()})};if(c.prototype.addCamera=function(b){var d,e=this;if(!arguments.length){for(b=0;this.cameras[""+b];)b++;b=""+b}if(this.cameras[b])throw'sigma.addCamera: The camera "'+b+'" already exists.';return d=new c.classes.camera(b,this.graph,this.settings),this.cameras[b]=d,d.quadtree=new c.classes.quad,c.classes.edgequad!==a&&(d.edgequadtree=new c.classes.edgequad),d.bind("coordinatesUpdated",function(a){e.renderCamera(d,d.isAnimated)}),this.renderersPerCamera[b]=[],d},c.prototype.killCamera=function(a){if(!(a="string"==typeof a?this.cameras[a]:a))throw"sigma.killCamera: The camera is undefined.";var b,c,d=this.renderersPerCamera[a.id];for(c=d.length,b=c-1;b>=0;b--)this.killRenderer(d[b]);return delete this.renderersPerCamera[a.id],delete this.cameraFrames[a.id],delete this.cameras[a.id],a.kill&&a.kill(),this},c.prototype.addRenderer=function(a){var b,d,e,f,g=a||{};if("string"==typeof g?g={container:document.getElementById(g)}:g instanceof HTMLElement&&(g={container:g}),"string"==typeof g.container&&(g.container=document.getElementById(g.container)),"id"in g)b=g.id;else{for(b=0;this.renderers[""+b];)b++;b=""+b}if(this.renderers[b])throw'sigma.addRenderer: The renderer "'+b+'" already exists.';if(d="function"==typeof g.type?g.type:c.renderers[g.type],d=d||c.renderers.def,e="camera"in g?g.camera instanceof c.classes.camera?g.camera:this.cameras[g.camera]||this.addCamera(g.camera):this.addCamera(),this.cameras[e.id]!==e)throw"sigma.addRenderer: The camera is not properly referenced.";return f=new d(this.graph,e,this.settings,g),this.renderers[b]=f,Object.defineProperty(f,"id",{value:b}),f.bind&&f.bind(["click","rightClick","clickStage","doubleClickStage","rightClickStage","clickNode","clickNodes","clickEdge","clickEdges","doubleClickNode","doubleClickNodes","doubleClickEdge","doubleClickEdges","rightClickNode","rightClickNodes","rightClickEdge","rightClickEdges","overNode","overNodes","overEdge","overEdges","outNode","outNodes","outEdge","outEdges","downNode","downNodes","downEdge","downEdges","upNode","upNodes","upEdge","upEdges"],this._handler),this.renderersPerCamera[e.id].push(f),f},c.prototype.killRenderer=function(a){if(!(a="string"==typeof a?this.renderers[a]:a))throw"sigma.killRenderer: The renderer is undefined.";var b=this.renderersPerCamera[a.camera.id],c=b.indexOf(a);return c>=0&&b.splice(c,1),a.kill&&a.kill(),delete this.renderers[a.id],this},c.prototype.refresh=function(b){var d,e,f,g,h,i,j=0;for(b=b||{},g=this.middlewares||[],d=0,e=g.length;d<e;d++)g[d].call(this,0===d?"":"tmp"+j+":",d===e-1?"ready:":"tmp"+ ++j+":");for(f in this.cameras)h=this.cameras[f],h.settings("autoRescale")&&this.renderersPerCamera[h.id]&&this.renderersPerCamera[h.id].length?c.middlewares.rescale.call(this,g.length?"ready:":"",h.readPrefix,{width:this.renderersPerCamera[h.id][0].width,height:this.renderersPerCamera[h.id][0].height}):c.middlewares.copy.call(this,g.length?"ready:":"",h.readPrefix),b.skipIndexation||(i=c.utils.getBoundaries(this.graph,h.readPrefix),h.quadtree.index(this.graph.nodes(),{prefix:h.readPrefix,bounds:{x:i.minX,y:i.minY,width:i.maxX-i.minX,height:i.maxY-i.minY}}),h.edgequadtree!==a&&h.settings("drawEdges")&&h.settings("enableEdgeHovering")&&h.edgequadtree.index(this.graph,{prefix:h.readPrefix,bounds:{x:i.minX,y:i.minY,width:i.maxX-i.minX,height:i.maxY-i.minY}}));for(g=Object.keys(this.renderers),d=0,e=g.length;d<e;d++)if(this.renderers[g[d]].process)if(this.settings("skipErrors"))try{this.renderers[g[d]].process()}catch(a){console.log('Warning: The renderer "'+g[d]+'" crashed on ".process()"')}else this.renderers[g[d]].process();return this.render(),this},c.prototype.render=function(){var a,b,c;for(c=Object.keys(this.renderers),a=0,b=c.length;a<b;a++)if(this.settings("skipErrors"))try{this.renderers[c[a]].render()}catch(b){this.settings("verbose")&&console.log('Warning: The renderer "'+c[a]+'" crashed on ".render()"')}else this.renderers[c[a]].render();return this},c.prototype.renderCamera=function(a,b){var c,d,e,f=this;if(b)for(e=this.renderersPerCamera[a.id],c=0,d=e.length;c<d;c++)if(this.settings("skipErrors"))try{e[c].render()}catch(a){this.settings("verbose")&&console.log('Warning: The renderer "'+e[c].id+'" crashed on ".render()"')}else e[c].render();else if(!this.cameraFrames[a.id]){for(e=this.renderersPerCamera[a.id],c=0,d=e.length;c<d;c++)if(this.settings("skipErrors"))try{e[c].render()}catch(a){this.settings("verbose")&&console.log('Warning: The renderer "'+e[c].id+'" crashed on ".render()"')}else e[c].render();this.cameraFrames[a.id]=requestAnimationFrame(function(){delete f.cameraFrames[a.id]})}return this},c.prototype.kill=function(){var a;this.dispatchEvent("kill"),this.graph.kill(),delete this.middlewares;for(a in this.renderers)this.killRenderer(this.renderers[a]);for(a in this.cameras)this.killCamera(this.cameras[a]);delete this.renderers,delete this.cameras;for(a in this)this.hasOwnProperty(a)&&delete this[a];delete b[this.id]},c.instances=function(a){return arguments.length?b[a]:c.utils.extend({},b)},c.version="1.2.1",void 0!==this.sigma)throw"An object called sigma is already in the global scope.";this.sigma=c}).call(this),function(a){"use strict";function b(a,c){var d,e,f,g;if(arguments.length)if(1===arguments.length&&Object(arguments[0])===arguments[0])for(a in arguments[0])b(a,arguments[0][a]);else if(arguments.length>1)for(g=Array.isArray(a)?a:a.split(/ /),d=0,e=g.length;d!==e;d+=1)f=g[d],C[f]||(C[f]=[]),C[f].push({handler:c})}function c(a,b){var c,d,e,f,g,h,i=Array.isArray(a)?a:a.split(/ /);if(arguments.length)if(b)for(c=0,d=i.length;c!==d;c+=1){if(h=i[c],C[h]){for(g=[],e=0,f=C[h].length;e!==f;e+=1)C[h][e].handler!==b&&g.push(C[h][e]);C[h]=g}C[h]&&0===C[h].length&&delete C[h]}else for(c=0,d=i.length;c!==d;c+=1)delete C[i[c]];else C=Object.create(null)}function d(a,b){var c,d,e,f,g,h,i=Array.isArray(a)?a:a.split(/ /);for(b=void 0===b?{}:b,c=0,e=i.length;c!==e;c+=1)if(h=i[c],C[h])for(g={type:h,data:b||{}},d=0,f=C[h].length;d!==f;d+=1)try{C[h][d].handler(g)}catch(a){}}function e(){var a,b,c,d,e=!1,f=s(),g=x.shift();if(c=g.job(),f=s()-f,g.done++,g.time+=f,g.currentTime+=f,g.weightTime=g.currentTime/(g.weight||1),g.averageTime=g.time/g.done,!(d=g.count?g.count<=g.done:!c)){for(a=0,b=x.length;a<b;a++)if(x[a].weightTime>g.weightTime){x.splice(a,0,g),e=!0;break}e||x.push(g)}return d?g:null}function f(a){var b=x.length;w[a.id]=a,a.status="running",b&&(a.weightTime=x[b-1].weightTime,a.currentTime=a.weightTime*(a.weight||1)),a.startTime=s(),d("jobStarted",q(a)),x.push(a)}function g(){var a,b,c;for(a in v)b=v[a],b.after?y[a]=b:f(b),delete v[a];for(u=!!x.length;x.length&&s()-t<B.frameDuration;)if(c=e()){i(c.id);for(a in y)y[a].after===c.id&&(f(y[a]),delete y[a])}u?(t=s(),d("enterFrame"),setTimeout(g,0)):d("stop")}function h(a,b){var c,e,f;if(Array.isArray(a)){for(A=!0,c=0,e=a.length;c<e;c++)h(a[c].id,p(a[c],b));A=!1,u||(t=s(),d("start"),g())}else if("object"==typeof a)if("string"==typeof a.id)h(a.id,a);else{A=!0;for(c in a)"function"==typeof a[c]?h(c,p({job:a[c]},b)):h(c,p(a[c],b));A=!1,u||(t=s(),d("start"),g())}else{if("string"!=typeof a)throw new Error("[conrad.addJob] Wrong arguments.");if(k(a))throw new Error('[conrad.addJob] Job with id "'+a+'" already exists.');if("function"==typeof b)f={id:a,done:0,time:0,status:"waiting",currentTime:0,averageTime:0,weightTime:0,job:b};else{if("object"!=typeof b)throw new Error("[conrad.addJob] Wrong arguments.");f=p({id:a,done:0,time:0,status:"waiting",currentTime:0,averageTime:0,weightTime:0},b)}v[a]=f,d("jobAdded",q(f)),u||A||(t=s(),d("start"),g())}return this}function i(a){var b,c,e,f,g=!1;if(Array.isArray(a))for(b=0,c=a.length;b<c;b++)i(a[b]);else{if("string"!=typeof a)throw new Error("[conrad.killJob] Wrong arguments.");for(e=[w,y,v],b=0,c=e.length;b<c;b++)a in e[b]&&(f=e[b][a],B.history&&(f.status="done",z.push(f)),d("jobEnded",q(f)),delete e[b][a],"function"==typeof f.end&&f.end(),g=!0);for(e=x,b=0,c=e.length;b<c;b++)if(e[b].id===a){e.splice(b,1);break}if(!g)throw new Error('[conrad.killJob] Job "'+a+'" not found.')}return this}function j(){var a,b=p(v,w,y);if(B.history)for(a in b)b[a].status="done",z.push(b[a]),"function"==typeof b[a].end&&b[a].end();return v={},y={},w={},x=[],u=!1,this}function k(a){var b=v[a]||w[a]||y[a];return b?p(b):null}function l(a,b){var c;if("string"==typeof a1&&1===arguments.length)return B[a1];c="object"==typeof a1&&1===arguments.length?a1||{}:{},"string"==typeof a1&&(c[a1]=a2);for(var d in c)void 0!==c[d]?B[d]=c[d]:delete B[d];return this}function m(){return u}function n(){return z=[],this}function o(a,b){var c,d,e,f,g,h,i;if(!arguments.length){g=[];for(d in v)g.push(v[d]);for(d in y)g.push(y[d]);for(d in w)g.push(w[d]);g=g.concat(z)}if("string"==typeof a)switch(a){case"waiting":g=r(y);break;case"running":g=r(w);break;case"done":g=z;break;default:h=a}if(a instanceof RegExp&&(h=a),!h&&("string"==typeof b||b instanceof RegExp)&&(h=b),h){if(i="string"==typeof h,g instanceof Array)c=g;else if("object"==typeof g){c=[];for(d in g)c=c.concat(g[d])}else{c=[];for(d in v)c.push(v[d]);for(d in y)c.push(y[d]);for(d in w)c.push(w[d]);c=c.concat(z)}for(g=[],e=0,f=c.length;e<f;e++)(i?c[e].id===h:c[e].id.match(h))&&g.push(c[e])}return q(g)}function p(){var a,b,c={},d=arguments.length;for(a=d-1;a>=0;a--)for(b in arguments[a])c[b]=arguments[a][b];return c}function q(a){var b,c,d;if(!a)return a;if(Array.isArray(a))for(b=[],c=0,d=a.length;c<d;c++)b.push(q(a[c]));else if("object"==typeof a){b={};for(c in a)b[c]=q(a[c])}else b=a;return b}function r(a){var b,c=[];for(b in a)c.push(a[b]);return c}function s(){return Date.now?Date.now():(new Date).getTime()}if(a.conrad)throw new Error("conrad already exists");var t,u=!1,v={},w={},x=[],y={},z=[],A=!1,B={frameDuration:20,history:!0},C=Object.create(null);Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});var D={hasJob:k,addJob:h,killJob:i,killAll:j,settings:l,getStats:o,isRunning:m,clearHistory:n,bind:b,unbind:c,version:"0.1.0"};"undefined"!=typeof exports&&("undefined"!=typeof module&&module.exports&&(exports=module.exports=D),exports.conrad=D),a.conrad=D}(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";var b=this;sigma.utils=sigma.utils||{},sigma.utils.extend=function(){var a,b,c={},d=arguments.length;for(a=d-1;a>=0;a--)for(b in arguments[a])c[b]=arguments[a][b];return c},sigma.utils.dateNow=function(){return Date.now?Date.now():(new Date).getTime()},sigma.utils.pkg=function(a){return(a||"").split(".").reduce(function(a,b){return b in a?a[b]:a[b]={}},b)},sigma.utils.id=function(){var a=0;return function(){return++a}}();var c={};sigma.utils.floatColor=function(a){if(c[a])return c[a];var b=a,d=0,e=0,f=0;"#"===a[0]?(a=a.slice(1),3===a.length?(d=parseInt(a.charAt(0)+a.charAt(0),16),e=parseInt(a.charAt(1)+a.charAt(1),16),f=parseInt(a.charAt(2)+a.charAt(2),16)):(d=parseInt(a.charAt(0)+a.charAt(1),16),e=parseInt(a.charAt(2)+a.charAt(3),16),f=parseInt(a.charAt(4)+a.charAt(5),16))):a.match(/^ *rgba? *\(/)&&(a=a.match(/^ *rgba? *\( *([0-9]*) *, *([0-9]*) *, *([0-9]*) *(,.*)?\) *$/),d=+a[1],e=+a[2],f=+a[3]);var g=256*d*256+256*e+f;return c[b]=g,g},sigma.utils.zoomTo=function(a,b,c,d,e){var f,g,h,i=a.settings;(g=Math.max(i("zoomMin"),Math.min(i("zoomMax"),a.ratio*d)))!==a.ratio&&(d=g/a.ratio,h={x:b*(1-d)+a.x,y:c*(1-d)+a.y,ratio:g},e&&e.duration?(f=sigma.misc.animation.killAll(a),e=sigma.utils.extend(e,{easing:f?"quadraticOut":"quadraticInOut"}),sigma.misc.animation.camera(a,h,e)):(a.goTo(h),e&&e.onComplete&&e.onComplete()))},sigma.utils.getQuadraticControlPoint=function(a,b,c,d){return{x:(a+c)/2+(d-b)/4,y:(b+d)/2+(a-c)/4}},sigma.utils.getPointOnQuadraticCurve=function(a,b,c,d,e,f,g){return{x:Math.pow(1-a,2)*b+2*(1-a)*a*f+Math.pow(a,2)*d,y:Math.pow(1-a,2)*c+2*(1-a)*a*g+Math.pow(a,2)*e}},sigma.utils.getPointOnBezierCurve=function(a,b,c,d,e,f,g,h,i){var j=Math.pow(1-a,3),k=3*a*Math.pow(1-a,2),l=3*Math.pow(a,2)*(1-a),m=Math.pow(a,3);return{x:j*b+k*f+l*h+m*d,y:j*c+k*g+l*i+m*e}},sigma.utils.getSelfLoopControlPoints=function(a,b,c){return{x1:a-7*c,y1:b,x2:a,y2:b+7*c}},sigma.utils.getDistance=function(a,b,c,d){return Math.sqrt(Math.pow(c-a,2)+Math.pow(d-b,2))},sigma.utils.getCircleIntersection=function(a,b,c,d,e,f){var g,h,i,j,k,l,m,n,o;return h=d-a,i=e-b,!((j=Math.sqrt(i*i+h*h))>c+f)&&(!(j<Math.abs(c-f))&&(g=(c*c-f*f+j*j)/(2*j),n=a+h*g/j,o=b+i*g/j,k=Math.sqrt(c*c-g*g),l=k/j*-i,m=h*(k/j),{xi:n+l,xi_prime:n-l,yi:o+m,yi_prime:o-m}))},sigma.utils.isPointOnSegment=function(a,b,c,d,e,f,g){return Math.abs((b-d)*(e-c)-(a-c)*(f-d))/sigma.utils.getDistance(c,d,e,f)<g&&Math.min(c,e)<=a&&a<=Math.max(c,e)&&Math.min(d,f)<=b&&b<=Math.max(d,f)},sigma.utils.isPointOnQuadraticCurve=function(a,b,c,d,e,f,g,h,i){var j=sigma.utils.getDistance(c,d,e,f);if(Math.abs(a-c)>j||Math.abs(b-d)>j)return!1;for(var k,l=sigma.utils.getDistance(a,b,c,d),m=sigma.utils.getDistance(a,b,e,f),n=.5,o=l<m?-.01:.01,p=.001,q=100,r=sigma.utils.getPointOnQuadraticCurve(n,c,d,e,f,g,h),s=sigma.utils.getDistance(a,b,r.x,r.y);q-- >0&&n>=0&&n<=1&&s>i&&(o>p||o<-p);)k=s,r=sigma.utils.getPointOnQuadraticCurve(n,c,d,e,f,g,h),s=sigma.utils.getDistance(a,b,r.x,r.y),s>k?(o=-o/2,n+=o):n+o<0||n+o>1?(o/=2,s=k):n+=o;return s<i},sigma.utils.isPointOnBezierCurve=function(a,b,c,d,e,f,g,h,i,j,k){var l=sigma.utils.getDistance(c,d,g,h);if(Math.abs(a-c)>l||Math.abs(b-d)>l)return!1;for(var m,n=sigma.utils.getDistance(a,b,c,d),o=sigma.utils.getDistance(a,b,e,f),p=.5,q=n<o?-.01:.01,r=.001,s=100,t=sigma.utils.getPointOnBezierCurve(p,c,d,e,f,g,h,i,j),u=sigma.utils.getDistance(a,b,t.x,t.y);s-- >0&&p>=0&&p<=1&&u>k&&(q>r||q<-r);)m=u,t=sigma.utils.getPointOnBezierCurve(p,c,d,e,f,g,h,i,j),u=sigma.utils.getDistance(a,b,t.x,t.y),u>m?(q=-q/2,p+=q):p+q<0||p+q>1?(q/=2,u=m):p+=q;return u<k},sigma.utils.getX=function(b){return b.offsetX!==a&&b.offsetX||b.layerX!==a&&b.layerX||b.clientX!==a&&b.clientX},sigma.utils.getY=function(b){return b.offsetY!==a&&b.offsetY||b.layerY!==a&&b.layerY||b.clientY!==a&&b.clientY},sigma.utils.getPixelRatio=function(){var b=1;return window.screen.deviceXDPI!==a&&window.screen.logicalXDPI!==a&&window.screen.deviceXDPI>window.screen.logicalXDPI?b=window.screen.systemXDPI/window.screen.logicalXDPI:window.devicePixelRatio!==a&&(b=window.devicePixelRatio),b},sigma.utils.getWidth=function(b){var c=b.target.ownerSVGElement?b.target.ownerSVGElement.width:b.target.width;return"number"==typeof c&&c||c!==a&&c.baseVal!==a&&c.baseVal.value},sigma.utils.getCenter=function(a){var b=-1!==a.target.namespaceURI.indexOf("svg")?1:sigma.utils.getPixelRatio();return{x:sigma.utils.getWidth(a)/(2*b),y:sigma.utils.getHeight(a)/(2*b)}},sigma.utils.mouseCoords=function(a,b,c){return b=b||sigma.utils.getX(a),c=c||sigma.utils.getY(a),{x:b-sigma.utils.getCenter(a).x,y:c-sigma.utils.getCenter(a).y,clientX:a.clientX,clientY:a.clientY,ctrlKey:a.ctrlKey,metaKey:a.metaKey,altKey:a.altKey,shiftKey:a.shiftKey}},sigma.utils.getHeight=function(b){var c=b.target.ownerSVGElement?b.target.ownerSVGElement.height:b.target.height;return"number"==typeof c&&c||c!==a&&c.baseVal!==a&&c.baseVal.value},sigma.utils.getDelta=function(b){return b.wheelDelta!==a&&b.wheelDelta||b.detail!==a&&-b.detail},sigma.utils.getOffset=function(a){for(var b=0,c=0;a;)c+=parseInt(a.offsetTop),b+=parseInt(a.offsetLeft),a=a.offsetParent;return{top:c,left:b}},sigma.utils.doubleClick=function(a,b,c){var d,e=0;a._doubleClickHandler=a._doubleClickHandler||{},a._doubleClickHandler[b]=a._doubleClickHandler[b]||[],d=a._doubleClickHandler[b],d.push(function(a){if(2===++e)return e=0,c(a);1===e&&setTimeout(function(){e=0},sigma.settings.doubleClickTimeout)}),a.addEventListener(b,d[d.length-1],!1)},sigma.utils.unbindDoubleClick=function(a,b){for(var c,d=(a._doubleClickHandler||{})[b]||[];c=d.pop();)a.removeEventListener(b,c);delete(a._doubleClickHandler||{})[b]},sigma.utils.easings=sigma.utils.easings||{},sigma.utils.easings.linearNone=function(a){return a},sigma.utils.easings.quadraticIn=function(a){return a*a},sigma.utils.easings.quadraticOut=function(a){return a*(2-a)},sigma.utils.easings.quadraticInOut=function(a){return(a*=2)<1?.5*a*a:-.5*(--a*(a-2)-1)},sigma.utils.easings.cubicIn=function(a){return a*a*a},sigma.utils.easings.cubicOut=function(a){return--a*a*a+1},sigma.utils.easings.cubicInOut=function(a){return(a*=2)<1?.5*a*a*a:.5*((a-=2)*a*a+2)},sigma.utils.loadShader=function(a,b,c,d){var e,f=a.createShader(c);return a.shaderSource(f,b),a.compileShader(f),e=a.getShaderParameter(f,a.COMPILE_STATUS),e?f:(d&&d('Error compiling shader "'+f+'":'+a.getShaderInfoLog(f)),a.deleteShader(f),null)},sigma.utils.loadProgram=function(a,b,c,d,e){var f,g,h=a.createProgram();for(f=0;f<b.length;++f)a.attachShader(h,b[f]);if(c)for(f=0;f<c.length;++f)a.bindAttribLocation(h,locations?locations[f]:f,opt_attribs[f]);return a.linkProgram(h),g=a.getProgramParameter(h,a.LINK_STATUS),g?h:(e&&e("Error in program linking: "+a.getProgramInfoLog(h)),a.deleteProgram(h),null)},sigma.utils.pkg("sigma.utils.matrices"),sigma.utils.matrices.translation=function(a,b){return[1,0,0,0,1,0,a,b,1]},sigma.utils.matrices.rotation=function(a,b){var c=Math.cos(a),d=Math.sin(a);return b?[c,-d,d,c]:[c,-d,0,d,c,0,0,0,1]},sigma.utils.matrices.scale=function(a,b){return b?[a,0,0,a]:[a,0,0,0,a,0,0,0,1]},sigma.utils.matrices.multiply=function(a,b,c){var d=c?2:3,e=a[0*d+0],f=a[0*d+1],g=a[0*d+2],h=a[1*d+0],i=a[1*d+1],j=a[1*d+2],k=a[2*d+0],l=a[2*d+1],m=a[2*d+2],n=b[0*d+0],o=b[0*d+1],p=b[0*d+2],q=b[1*d+0],r=b[1*d+1],s=b[1*d+2],t=b[2*d+0],u=b[2*d+1],v=b[2*d+2];return c?[e*n+f*q,e*o+f*r,h*n+i*q,h*o+i*r]:[e*n+f*q+g*t,e*o+f*r+g*u,e*p+f*s+g*v,h*n+i*q+j*t,h*o+i*r+j*u,h*p+i*s+j*v,k*n+l*q+m*t,k*o+l*r+m*u,k*p+l*s+m*v]}}.call(this),function(a){"use strict";var b,c=0,d=["ms","moz","webkit","o"];for(b=0;b<d.length&&!a.requestAnimationFrame;b++)a.requestAnimationFrame=a[d[b]+"RequestAnimationFrame"],a.cancelAnimationFrame=a[d[b]+"CancelAnimationFrame"]||a[d[b]+"CancelRequestAnimationFrame"];a.requestAnimationFrame||(a.requestAnimationFrame=function(b,d){var e=(new Date).getTime(),f=Math.max(0,16-(e-c)),g=a.setTimeout(function(){b(e+f)},f);return c=e+f,g}),a.cancelAnimationFrame||(a.cancelAnimationFrame=function(a){clearTimeout(a)}),Function.prototype.bind||(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b,c,d=Array.prototype.slice.call(arguments,1),e=this;return b=function(){},c=function(){return e.apply(this instanceof b&&a?this:a,d.concat(Array.prototype.slice.call(arguments)))},b.prototype=this.prototype,c.prototype=new b,c})}(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.settings");var b={clone:!0,immutable:!0,verbose:!1,classPrefix:"sigma",defaultNodeType:"def",defaultEdgeType:"def",defaultLabelColor:"#000",defaultEdgeColor:"#000",defaultNodeColor:"#000",defaultLabelSize:14,edgeColor:"source",minArrowSize:0,font:"arial",fontStyle:"",labelColor:"default",labelSize:"fixed",labelSizeRatio:1,labelThreshold:8,webglOversamplingRatio:2,borderSize:0,defaultNodeBorderColor:"#000",hoverFont:"",singleHover:!0,hoverFontStyle:"",labelHoverShadow:"default",labelHoverShadowColor:"#000",nodeHoverColor:"node",defaultNodeHoverColor:"#000",labelHoverBGColor:"default",defaultHoverLabelBGColor:"#fff",labelHoverColor:"default",defaultLabelHoverColor:"#000",edgeHoverColor:"edge",edgeHoverSizeRatio:1,defaultEdgeHoverColor:"#000",edgeHoverExtremities:!1,drawEdges:!0,drawNodes:!0,drawLabels:!0,drawEdgeLabels:!1,batchEdgesDrawing:!1,hideEdgesOnMove:!1,canvasEdgesBatchSize:500,webglEdgesBatchSize:1e3,scalingMode:"inside",sideMargin:0,minEdgeSize:.5,maxEdgeSize:1,minNodeSize:1,maxNodeSize:8,touchEnabled:!0,mouseEnabled:!0,mouseWheelEnabled:!0,doubleClickEnabled:!0,eventsEnabled:!0,zoomingRatio:1.7,doubleClickZoomingRatio:2.2,zoomMin:.0625,zoomMax:2,mouseZoomDuration:200,doubleClickZoomDuration:200,mouseInertiaDuration:200,mouseInertiaRatio:3,touchInertiaDuration:200,touchInertiaRatio:3,doubleClickTimeout:300,doubleTapTimeout:300,dragTimeout:200,autoResize:!0,autoRescale:!0,enableCamera:!0,enableHovering:!0,enableEdgeHovering:!1,edgeHoverPrecision:5,rescaleIgnoreSize:!1,skipErrors:!1,nodesPowRatio:.5,edgesPowRatio:.5,animationsTime:200};sigma.settings=sigma.utils.extend(sigma.settings||{},b)}.call(this),function(){"use strict";var a=function(){Object.defineProperty(this,"_handlers",{value:{}})};a.prototype.bind=function(a,b){var c,d,e,f;if(1===arguments.length&&"object"==typeof arguments[0])for(a in arguments[0])this.bind(a,arguments[0][a]);else{if(2!==arguments.length||"function"!=typeof arguments[1])throw"bind: Wrong arguments.";for(f="string"==typeof a?a.split(" "):a,c=0,d=f.length;c!==d;c+=1)(e=f[c])&&(this._handlers[e]||(this._handlers[e]=[]),this._handlers[e].push({handler:b}))}return this},a.prototype.unbind=function(a,b){var c,d,e,f,g,h,i,j="string"==typeof a?a.split(" "):a;if(!arguments.length){for(g in this._handlers)delete this._handlers[g];return this}if(b)for(c=0,d=j.length;c!==d;c+=1){if(i=j[c],this._handlers[i]){for(h=[],e=0,f=this._handlers[i].length;e!==f;e+=1)this._handlers[i][e].handler!==b&&h.push(this._handlers[i][e]);this._handlers[i]=h}this._handlers[i]&&0===this._handlers[i].length&&delete this._handlers[i]}else for(c=0,d=j.length;c!==d;c+=1)delete this._handlers[j[c]];return this},a.prototype.dispatchEvent=function(a,b){var c,d,e,f,g,h,i,j=this,k="string"==typeof a?a.split(" "):a;for(b=void 0===b?{}:b,c=0,d=k.length;c!==d;c+=1)if(i=k[c],this._handlers[i]){for(h=j.getEvent(i,b),g=[],e=0,f=this._handlers[i].length;e!==f;e+=1)this._handlers[i][e].handler(h),this._handlers[i][e].one||g.push(this._handlers[i][e]);this._handlers[i]=g}return this},a.prototype.getEvent=function(a,b){return{type:a,data:b||{},target:this}},a.extend=function(b,c){var d;for(d in a.prototype)a.prototype.hasOwnProperty(d)&&(b[d]=a.prototype[d]);a.apply(b,c)},void 0!==this.sigma?(this.sigma.classes=this.sigma.classes||{},this.sigma.classes.dispatcher=a):"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=a),exports.dispatcher=a):this.dispatcher=a}.call(this),function(){"use strict";var a=function(){var b,c,d={},e=Array.prototype.slice.call(arguments,0),f=function(a,b){var c,g,h,i;{if(1!==arguments.length||"string"!=typeof a){if("object"==typeof a&&"string"==typeof b)return void 0!==(a||{})[b]?a[b]:f(b);for(c="object"==typeof a&&void 0===b?a:{},"string"==typeof a&&(c[a]=b),g=0,i=Object.keys(c),h=i.length;g<h;g++)d[i[g]]=c[i[g]];return this}if(void 0!==d[a])return d[a];for(g=0,h=e.length;g<h;g++)if(void 0!==e[g][a])return e[g][a]}};for(f.embedObjects=function(){var b=e.concat(d).concat(Array.prototype.splice.call(arguments,0));return a.apply({},b)},b=0,c=arguments.length;b<c;b++)f(arguments[b]);return f};void 0!==this.sigma?(this.sigma.classes=this.sigma.classes||{},this.sigma.classes.configurable=a):"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=a),exports.configurable=a):this.configurable=a}.call(this),function(a){"use strict";function b(a,b,c){return function(){var d,e;for(d in h[a])h[a][d].apply(b,arguments);e=c.apply(b,arguments);for(d in g[a])g[a][d].apply(b,arguments);return e}}function c(a){var b;for(b in a)"hasOwnProperty"in a&&!a.hasOwnProperty(b)||delete a[b];return a}var d=Object.create(null),e=Object.create(null),f=Object.create(null),g=Object.create(null),h=Object.create(null),i={immutable:!0,clone:!0},j=function(a){return i[a]},k=function(a){var c,e,g;g={settings:a||j,nodesArray:[],edgesArray:[],nodesIndex:Object.create(null),edgesIndex:Object.create(null),inNeighborsIndex:Object.create(null),outNeighborsIndex:Object.create(null),allNeighborsIndex:Object.create(null),inNeighborsCount:Object.create(null),outNeighborsCount:Object.create(null),allNeighborsCount:Object.create(null)};for(c in f)f[c].call(g);for(c in d)e=b(c,g,d[c]),this[c]=e,g[c]=e};k.addMethod=function(a,b){if("string"!=typeof a||"function"!=typeof b||2!==arguments.length)throw"addMethod: Wrong arguments.";if(d[a]||k[a])throw'The method "'+a+'" already exists.';return d[a]=b,g[a]=Object.create(null),h[a]=Object.create(null),this},k.hasMethod=function(a){return!(!d[a]&&!k[a])},k.attach=function(a,b,c,d){if("string"!=typeof a||"string"!=typeof b||"function"!=typeof c||arguments.length<3||arguments.length>4)throw"attach: Wrong arguments.";var e;if("constructor"===a)e=f;else if(d){if(!h[a])throw'The method "'+a+'" does not exist.';e=h[a]}else{if(!g[a])throw'The method "'+a+'" does not exist.';e=g[a]}if(e[b])throw'A function "'+b+'" is already attached to the method "'+a+'".';return e[b]=c,this},k.attachBefore=function(a,b,c){return this.attach(a,b,c,!0)},k.addIndex=function(a,b){if("string"!=typeof a||Object(b)!==b||2!==arguments.length)throw"addIndex: Wrong arguments.";if(e[a])throw'The index "'+a+'" already exists.';var c;e[a]=b;for(c in b){if("function"!=typeof b[c])throw"The bindings must be functions.";k.attach(c,a,b[c])}return this},k.addMethod("addNode",function(a){if(Object(a)!==a||1!==arguments.length)throw"addNode: Wrong arguments.";if("string"!=typeof a.id&&"number"!=typeof a.id)throw"The node must have a string or number id.";if(this.nodesIndex[a.id])throw'The node "'+a.id+'" already exists.';var b,c=a.id,d=Object.create(null);if(this.settings("clone"))for(b in a)"id"!==b&&(d[b]=a[b]);else d=a;return this.settings("immutable")?Object.defineProperty(d,"id",{value:c,enumerable:!0}):d.id=c,this.inNeighborsIndex[c]=Object.create(null),this.outNeighborsIndex[c]=Object.create(null),this.allNeighborsIndex[c]=Object.create(null),this.inNeighborsCount[c]=0,this.outNeighborsCount[c]=0,this.allNeighborsCount[c]=0,this.nodesArray.push(d),this.nodesIndex[d.id]=d,this}),k.addMethod("addEdge",function(a){if(Object(a)!==a||1!==arguments.length)throw"addEdge: Wrong arguments.";if("string"!=typeof a.id&&"number"!=typeof a.id)throw"The edge must have a string or number id.";if("string"!=typeof a.source&&"number"!=typeof a.source||!this.nodesIndex[a.source])throw"The edge source must have an existing node id.";if("string"!=typeof a.target&&"number"!=typeof a.target||!this.nodesIndex[a.target])throw"The edge target must have an existing node id.";if(this.edgesIndex[a.id])throw'The edge "'+a.id+'" already exists.';var b,c=Object.create(null);if(this.settings("clone"))for(b in a)"id"!==b&&"source"!==b&&"target"!==b&&(c[b]=a[b]);else c=a;return this.settings("immutable")?(Object.defineProperty(c,"id",{value:a.id,enumerable:!0}),Object.defineProperty(c,"source",{value:a.source,enumerable:!0}),Object.defineProperty(c,"target",{value:a.target,enumerable:!0})):(c.id=a.id,c.source=a.source,c.target=a.target),this.edgesArray.push(c),this.edgesIndex[c.id]=c,this.inNeighborsIndex[c.target][c.source]||(this.inNeighborsIndex[c.target][c.source]=Object.create(null)),this.inNeighborsIndex[c.target][c.source][c.id]=c,this.outNeighborsIndex[c.source][c.target]||(this.outNeighborsIndex[c.source][c.target]=Object.create(null)),this.outNeighborsIndex[c.source][c.target][c.id]=c,this.allNeighborsIndex[c.source][c.target]||(this.allNeighborsIndex[c.source][c.target]=Object.create(null)),this.allNeighborsIndex[c.source][c.target][c.id]=c,c.target!==c.source&&(this.allNeighborsIndex[c.target][c.source]||(this.allNeighborsIndex[c.target][c.source]=Object.create(null)),this.allNeighborsIndex[c.target][c.source][c.id]=c),this.inNeighborsCount[c.target]++,this.outNeighborsCount[c.source]++,this.allNeighborsCount[c.target]++,this.allNeighborsCount[c.source]++,this}),k.addMethod("dropNode",function(a){if("string"!=typeof a&&"number"!=typeof a||1!==arguments.length)throw"dropNode: Wrong arguments.";if(!this.nodesIndex[a])throw'The node "'+a+'" does not exist.';var b,c,d;for(delete this.nodesIndex[a],b=0,d=this.nodesArray.length;b<d;b++)if(this.nodesArray[b].id===a){this.nodesArray.splice(b,1);break}for(b=this.edgesArray.length-1;b>=0;b--)this.edgesArray[b].source!==a&&this.edgesArray[b].target!==a||this.dropEdge(this.edgesArray[b].id);delete this.inNeighborsIndex[a],delete this.outNeighborsIndex[a],delete this.allNeighborsIndex[a],delete this.inNeighborsCount[a],delete this.outNeighborsCount[a],delete this.allNeighborsCount[a];for(c in this.nodesIndex)delete this.inNeighborsIndex[c][a],delete this.outNeighborsIndex[c][a],delete this.allNeighborsIndex[c][a];return this}),k.addMethod("dropEdge",function(a){if("string"!=typeof a&&"number"!=typeof a||1!==arguments.length)throw"dropEdge: Wrong arguments.";if(!this.edgesIndex[a])throw'The edge "'+a+'" does not exist.';var b,c,d;for(d=this.edgesIndex[a],delete this.edgesIndex[a],b=0,c=this.edgesArray.length;b<c;b++)if(this.edgesArray[b].id===a){this.edgesArray.splice(b,1);break}return delete this.inNeighborsIndex[d.target][d.source][d.id],Object.keys(this.inNeighborsIndex[d.target][d.source]).length||delete this.inNeighborsIndex[d.target][d.source],delete this.outNeighborsIndex[d.source][d.target][d.id],Object.keys(this.outNeighborsIndex[d.source][d.target]).length||delete this.outNeighborsIndex[d.source][d.target],delete this.allNeighborsIndex[d.source][d.target][d.id],Object.keys(this.allNeighborsIndex[d.source][d.target]).length||delete this.allNeighborsIndex[d.source][d.target],d.target!==d.source&&(delete this.allNeighborsIndex[d.target][d.source][d.id],Object.keys(this.allNeighborsIndex[d.target][d.source]).length||delete this.allNeighborsIndex[d.target][d.source]),this.inNeighborsCount[d.target]--,this.outNeighborsCount[d.source]--,this.allNeighborsCount[d.source]--,this.allNeighborsCount[d.target]--,this}),k.addMethod("kill",function(){this.nodesArray.length=0,this.edgesArray.length=0,delete this.nodesArray,delete this.edgesArray,delete this.nodesIndex,delete this.edgesIndex,delete this.inNeighborsIndex,delete this.outNeighborsIndex,delete this.allNeighborsIndex,delete this.inNeighborsCount,delete this.outNeighborsCount,delete this.allNeighborsCount}),k.addMethod("clear",function(){return this.nodesArray.length=0,this.edgesArray.length=0,c(this.nodesIndex),c(this.edgesIndex),c(this.nodesIndex),c(this.inNeighborsIndex),c(this.outNeighborsIndex),c(this.allNeighborsIndex),c(this.inNeighborsCount),c(this.outNeighborsCount),c(this.allNeighborsCount),this}),k.addMethod("read",function(a){var b,c,d;for(c=a.nodes||[],b=0,d=c.length;b<d;b++)this.addNode(c[b]);for(c=a.edges||[],b=0,d=c.length;b<d;b++)this.addEdge(c[b]);return this}),k.addMethod("nodes",function(a){if(!arguments.length)return this.nodesArray.slice(0);if(1===arguments.length&&("string"==typeof a||"number"==typeof a))return this.nodesIndex[a];if(1===arguments.length&&"[object Array]"===Object.prototype.toString.call(a)){var b,c,d=[];for(b=0,c=a.length;b<c;b++){if("string"!=typeof a[b]&&"number"!=typeof a[b])throw"nodes: Wrong arguments.";d.push(this.nodesIndex[a[b]])}return d}throw"nodes: Wrong arguments."}),k.addMethod("degree",function(a,b){if(b={in:this.inNeighborsCount,out:this.outNeighborsCount}[b||""]||this.allNeighborsCount,"string"==typeof a||"number"==typeof a)return b[a];if("[object Array]"===Object.prototype.toString.call(a)){var c,d,e=[];for(c=0,d=a.length;c<d;c++){if("string"!=typeof a[c]&&"number"!=typeof a[c])throw"degree: Wrong arguments.";e.push(b[a[c]])}return e}throw"degree: Wrong arguments."}),k.addMethod("edges",function(a){if(!arguments.length)return this.edgesArray.slice(0);if(1===arguments.length&&("string"==typeof a||"number"==typeof a))return this.edgesIndex[a];if(1===arguments.length&&"[object Array]"===Object.prototype.toString.call(a)){var b,c,d=[];for(b=0,c=a.length;b<c;b++){if("string"!=typeof a[b]&&"number"!=typeof a[b])throw"edges: Wrong arguments.";d.push(this.edgesIndex[a[b]])}return d}throw"edges: Wrong arguments."}),"undefined"!=typeof sigma?(sigma.classes=sigma.classes||Object.create(null),sigma.classes.graph=k):"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=k),exports.graph=k):this.graph=k}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.classes"),sigma.classes.camera=function(a,b,c,d){sigma.classes.dispatcher.extend(this),Object.defineProperty(this,"graph",{value:b}),Object.defineProperty(this,"id",{value:a}),Object.defineProperty(this,"readPrefix",{value:"read_cam"+a+":"}),Object.defineProperty(this,"prefix",{value:"cam"+a+":"}),this.x=0,this.y=0,this.ratio=1,this.angle=0,this.isAnimated=!1,this.settings="object"==typeof d&&d?c.embedObject(d):c},sigma.classes.camera.prototype.goTo=function(b){if(!this.settings("enableCamera"))return this;var c,d,e=b||{},f=["x","y","ratio","angle"];for(c=0,d=f.length;c<d;c++)if(e[f[c]]!==a){if("number"!=typeof e[f[c]]||isNaN(e[f[c]]))throw'Value for "'+f[c]+'" is not a number.';this[f[c]]=e[f[c]]}return this.dispatchEvent("coordinatesUpdated"),this},sigma.classes.camera.prototype.applyView=function(b,c,d){d=d||{},c=c!==a?c:this.prefix,b=b!==a?b:this.readPrefix;var e,f,g,h=d.nodes||this.graph.nodes(),i=d.edges||this.graph.edges(),j=Math.cos(this.angle)/this.ratio,k=Math.sin(this.angle)/this.ratio,l=Math.pow(this.ratio,this.settings("nodesPowRatio")),m=Math.pow(this.ratio,this.settings("edgesPowRatio")),n=(d.width||0)/2-this.x*j-this.y*k,o=(d.height||0)/2-this.y*j+this.x*k;for(e=0,f=h.length;e<f;e++)g=h[e],g[c+"x"]=(g[b+"x"]||0)*j+(g[b+"y"]||0)*k+n,g[c+"y"]=(g[b+"y"]||0)*j-(g[b+"x"]||0)*k+o,g[c+"size"]=(g[b+"size"]||0)/l;for(e=0,f=i.length;e<f;e++)i[e][c+"size"]=(i[e][b+"size"]||0)/m;return this},sigma.classes.camera.prototype.graphPosition=function(a,b,c){var d=0,e=0,f=Math.cos(this.angle),g=Math.sin(this.angle);return c||(d=-(this.x*f+this.y*g)/this.ratio,e=-(this.y*f-this.x*g)/this.ratio),{x:(a*f+b*g)/this.ratio+d,y:(b*f-a*g)/this.ratio+e}},sigma.classes.camera.prototype.cameraPosition=function(a,b,c){var d=0,e=0,f=Math.cos(this.angle),g=Math.sin(this.angle);return c||(d=-(this.x*f+this.y*g)/this.ratio,e=-(this.y*f-this.x*g)/this.ratio),{x:((a-d)*f-(b-e)*g)*this.ratio,y:((b-e)*f+(a-d)*g)*this.ratio}},sigma.classes.camera.prototype.getMatrix=function(){var a=sigma.utils.matrices.scale(1/this.ratio),b=sigma.utils.matrices.rotation(this.angle),c=sigma.utils.matrices.translation(-this.x,-this.y);return sigma.utils.matrices.multiply(c,sigma.utils.matrices.multiply(b,a))},sigma.classes.camera.prototype.getRectangle=function(a,b){var c=this.cameraPosition(a,0,!0),d=this.cameraPosition(0,b,!0),e=this.cameraPosition(a/2,b/2,!0),f=this.cameraPosition(a/4,0,!0).x,g=this.cameraPosition(0,b/4,!0).y;return{x1:this.x-e.x-f,y1:this.y-e.y-g,x2:this.x-e.x+f+c.x,y2:this.y-e.y-g+c.y,height:Math.sqrt(Math.pow(d.x,2)+Math.pow(d.y+2*g,2))}}}.call(this),function(a){"use strict";function b(a,b){var c=b.x+b.width/2,d=b.y+b.height/2,e=a.y<d,f=a.x<c;return e?f?0:1:f?2:3}function c(a,b){for(var c=[],d=0;d<4;d++)a.x2>=b[d][0].x&&a.x1<=b[d][1].x&&a.y1+a.height>=b[d][0].y&&a.y1<=b[d][2].y&&c.push(d);return c}function d(a,b){for(var c=[],d=0;d<4;d++)j.collision(a,b[d])&&c.push(d);return c}function e(a,b){var c,d,e=b.level+1,f=Math.round(b.bounds.width/2),g=Math.round(b.bounds.height/2),h=Math.round(b.bounds.x),j=Math.round(b.bounds.y);switch(a){case 0:c=h,d=j;break;case 1:c=h+f,d=j;break;case 2:c=h,d=j+g;break;case 3:c=h+f,d=j+g}return i({x:c,y:d,width:f,height:g},e,b.maxElements,b.maxLevel)}function f(b,d,g){if(g.level<g.maxLevel)for(var h=c(d,g.corners),i=0,j=h.length;i<j;i++)g.nodes[h[i]]===a&&(g.nodes[h[i]]=e(h[i],g)),f(b,d,g.nodes[h[i]]);else g.elements.push(b)}function g(c,d){if(d.level<d.maxLevel){var e=b(c,d.bounds);return d.nodes[e]!==a?g(c,d.nodes[e]):[]}return d.elements}function h(b,c,d,e){if(e=e||{},c.level<c.maxLevel)for(var f=d(b,c.corners),g=0,i=f.length;g<i;g++)c.nodes[f[g]]!==a&&h(b,c.nodes[f[g]],d,e);else for(var j=0,k=c.elements.length;j<k;j++)e[c.elements[j].id]===a&&(e[c.elements[j].id]=c.elements[j]);return e}function i(a,b,c,d){return{level:b||0,bounds:a,corners:j.splitSquare(a),maxElements:c||20,maxLevel:d||4,elements:[],nodes:[]}}var j={pointToSquare:function(a){return{x1:a.x-a.size,y1:a.y-a.size,x2:a.x+a.size,y2:a.y-a.size,height:2*a.size}},isAxisAligned:function(a){return a.x1===a.x2||a.y1===a.y2},axisAlignedTopPoints:function(a){return a.y1===a.y2&&a.x1<a.x2?a:a.x1===a.x2&&a.y2>a.y1?{x1:a.x1-a.height,y1:a.y1,x2:a.x1,y2:a.y1,height:a.height}:a.x1===a.x2&&a.y2<a.y1?{x1:a.x1,y1:a.y2,x2:a.x2+a.height,y2:a.y2,height:a.height}:{x1:a.x2,y1:a.y1-a.height,x2:a.x1,y2:a.y1-a.height,height:a.height}},lowerLeftCoor:function(a){var b=Math.sqrt(Math.pow(a.x2-a.x1,2)+Math.pow(a.y2-a.y1,2));return{x:a.x1-(a.y2-a.y1)*a.height/b,y:a.y1+(a.x2-a.x1)*a.height/b}},lowerRightCoor:function(a,b){return{x:b.x-a.x1+a.x2,y:b.y-a.y1+a.y2}},rectangleCorners:function(a){var b=this.lowerLeftCoor(a),c=this.lowerRightCoor(a,b);return[{x:a.x1,y:a.y1},{x:a.x2,y:a.y2},{x:b.x,y:b.y},{x:c.x,y:c.y}]},splitSquare:function(a){return[[{x:a.x,y:a.y},{x:a.x+a.width/2,y:a.y},{x:a.x,y:a.y+a.height/2},{x:a.x+a.width/2,y:a.y+a.height/2}],[{x:a.x+a.width/2,y:a.y},{x:a.x+a.width,y:a.y},{x:a.x+a.width/2,y:a.y+a.height/2},{x:a.x+a.width,y:a.y+a.height/2}],[{x:a.x,y:a.y+a.height/2},{x:a.x+a.width/2,y:a.y+a.height/2},{x:a.x,y:a.y+a.height},{x:a.x+a.width/2,y:a.y+a.height}],[{x:a.x+a.width/2,y:a.y+a.height/2},{x:a.x+a.width,y:a.y+a.height/2},{x:a.x+a.width/2,y:a.y+a.height},{x:a.x+a.width,y:a.y+a.height}]]},axis:function(a,b){return[{x:a[1].x-a[0].x,y:a[1].y-a[0].y},{x:a[1].x-a[3].x,y:a[1].y-a[3].y},{x:b[0].x-b[2].x,y:b[0].y-b[2].y},{x:b[0].x-b[1].x,y:b[0].y-b[1].y}]},projection:function(a,b){var c=(a.x*b.x+a.y*b.y)/(Math.pow(b.x,2)+Math.pow(b.y,2));return{x:c*b.x,y:c*b.y}},axisCollision:function(a,b,c){for(var d=[],e=[],f=0;f<4;f++){var g=this.projection(b[f],a),h=this.projection(c[f],a);d.push(g.x*a.x+g.y*a.y),e.push(h.x*a.x+h.y*a.y)}var i=Math.max.apply(Math,d),j=Math.max.apply(Math,e),k=Math.min.apply(Math,d);return Math.min.apply(Math,e)<=i&&j>=k},collision:function(a,b){for(var c=this.axis(a,b),d=!0,e=0;e<4;e++)d=d&&this.axisCollision(c[e],a,b);return d}},k=function(){this._geom=j,this._tree=null,this._cache={query:!1,result:!1}};k.prototype.index=function(a,b){if(!b.bounds)throw"sigma.classes.quad.index: bounds information not given.";var c=b.prefix||"";this._tree=i(b.bounds,0,b.maxElements,b.maxLevel);for(var d=0,e=a.length;d<e;d++)f(a[d],j.pointToSquare({x:a[d][c+"x"],y:a[d][c+"y"],size:a[d][c+"size"]}),this._tree);return this._cache={query:!1,result:!1},this._tree},k.prototype.point=function(a,b){return this._tree?g({x:a,y:b},this._tree)||[]:[]},k.prototype.area=function(a){var b,e,f=JSON.stringify(a);if(this._cache.query===f)return this._cache.result;j.isAxisAligned(a)?(b=c,e=j.axisAlignedTopPoints(a)):(b=d,e=j.rectangleCorners(a));var g=this._tree?h(e,this._tree,b):[],i=[];for(var k in g)i.push(g[k]);return this._cache.query=f,this._cache.result=i,i},void 0!==this.sigma?(this.sigma.classes=this.sigma.classes||{},this.sigma.classes.quad=k):"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=k),exports.quad=k):this.quad=k}.call(this),function(a){"use strict";function b(a,b){var c=b.x+b.width/2,d=b.y+b.height/2,e=a.y<d,f=a.x<c;return e?f?0:1:f?2:3}function c(a,b){for(var c=[],d=0;d<4;d++)a.x2>=b[d][0].x&&a.x1<=b[d][1].x&&a.y1+a.height>=b[d][0].y&&a.y1<=b[d][2].y&&c.push(d);return c}function d(a,b){for(var c=[],d=0;d<4;d++)j.collision(a,b[d])&&c.push(d);return c}function e(a,b){var c,d,e=b.level+1,f=Math.round(b.bounds.width/2),g=Math.round(b.bounds.height/2),h=Math.round(b.bounds.x),j=Math.round(b.bounds.y);switch(a){case 0:c=h,d=j;break;case 1:c=h+f,d=j;break;case 2:c=h,d=j+g;break;case 3:c=h+f,d=j+g}return i({x:c,y:d,width:f,height:g},e,b.maxElements,b.maxLevel)}function f(b,d,g){if(g.level<g.maxLevel)for(var h=c(d,g.corners),i=0,j=h.length;i<j;i++)g.nodes[h[i]]===a&&(g.nodes[h[i]]=e(h[i],g)),f(b,d,g.nodes[h[i]]);else g.elements.push(b)}function g(c,d){if(d.level<d.maxLevel){var e=b(c,d.bounds);return d.nodes[e]!==a?g(c,d.nodes[e]):[]}return d.elements}function h(b,c,d,e){if(e=e||{},c.level<c.maxLevel)for(var f=d(b,c.corners),g=0,i=f.length;g<i;g++)c.nodes[f[g]]!==a&&h(b,c.nodes[f[g]],d,e);else for(var j=0,k=c.elements.length;j<k;j++)e[c.elements[j].id]===a&&(e[c.elements[j].id]=c.elements[j]);return e}function i(a,b,c,d){return{level:b||0,bounds:a,corners:j.splitSquare(a),maxElements:c||40,maxLevel:d||8,elements:[],nodes:[]}}var j={pointToSquare:function(a){return{x1:a.x-a.size,y1:a.y-a.size,x2:a.x+a.size,y2:a.y-a.size,height:2*a.size}},lineToSquare:function(a){return a.y1<a.y2?a.x1<a.x2?{x1:a.x1-a.size,y1:a.y1-a.size,x2:a.x2+a.size,y2:a.y1-a.size,height:a.y2-a.y1+2*a.size}:{x1:a.x2-a.size,y1:a.y1-a.size,x2:a.x1+a.size,y2:a.y1-a.size,height:a.y2-a.y1+2*a.size}:a.x1<a.x2?{x1:a.x1-a.size,y1:a.y2-a.size,x2:a.x2+a.size,y2:a.y2-a.size,height:a.y1-a.y2+2*a.size}:{x1:a.x2-a.size,y1:a.y2-a.size,x2:a.x1+a.size,y2:a.y2-a.size,height:a.y1-a.y2+2*a.size}},quadraticCurveToSquare:function(a,b){var c=sigma.utils.getPointOnQuadraticCurve(.5,a.x1,a.y1,a.x2,a.y2,b.x,b.y),d=Math.min(a.x1,a.x2,c.x),e=Math.max(a.x1,a.x2,c.x),f=Math.min(a.y1,a.y2,c.y),g=Math.max(a.y1,a.y2,c.y);return{x1:d-a.size,y1:f-a.size,x2:e+a.size,y2:f-a.size,height:g-f+2*a.size}},selfLoopToSquare:function(a){var b=sigma.utils.getSelfLoopControlPoints(a.x,a.y,a.size),c=Math.min(a.x,b.x1,b.x2),d=Math.max(a.x,b.x1,b.x2),e=Math.min(a.y,b.y1,b.y2),f=Math.max(a.y,b.y1,b.y2);return{x1:c-a.size,y1:e-a.size,x2:d+a.size,y2:e-a.size,height:f-e+2*a.size}},isAxisAligned:function(a){return a.x1===a.x2||a.y1===a.y2},axisAlignedTopPoints:function(a){return a.y1===a.y2&&a.x1<a.x2?a:a.x1===a.x2&&a.y2>a.y1?{x1:a.x1-a.height,y1:a.y1,x2:a.x1,y2:a.y1,height:a.height}:a.x1===a.x2&&a.y2<a.y1?{x1:a.x1,y1:a.y2,x2:a.x2+a.height,y2:a.y2,height:a.height}:{x1:a.x2,y1:a.y1-a.height,x2:a.x1,y2:a.y1-a.height,height:a.height}},lowerLeftCoor:function(a){var b=Math.sqrt(Math.pow(a.x2-a.x1,2)+Math.pow(a.y2-a.y1,2));return{x:a.x1-(a.y2-a.y1)*a.height/b,y:a.y1+(a.x2-a.x1)*a.height/b}},lowerRightCoor:function(a,b){return{x:b.x-a.x1+a.x2,y:b.y-a.y1+a.y2}},rectangleCorners:function(a){var b=this.lowerLeftCoor(a),c=this.lowerRightCoor(a,b);return[{x:a.x1,y:a.y1},{x:a.x2,y:a.y2},{x:b.x,y:b.y},{x:c.x,y:c.y}]},splitSquare:function(a){return[[{x:a.x,y:a.y},{x:a.x+a.width/2,y:a.y},{x:a.x,y:a.y+a.height/2},{x:a.x+a.width/2,y:a.y+a.height/2}],[{x:a.x+a.width/2,y:a.y},{x:a.x+a.width,y:a.y},{x:a.x+a.width/2,y:a.y+a.height/2},{x:a.x+a.width,y:a.y+a.height/2}],[{x:a.x,y:a.y+a.height/2},{x:a.x+a.width/2,y:a.y+a.height/2},{x:a.x,y:a.y+a.height},{x:a.x+a.width/2,y:a.y+a.height}],[{x:a.x+a.width/2,y:a.y+a.height/2},{x:a.x+a.width,y:a.y+a.height/2},{x:a.x+a.width/2,y:a.y+a.height},{x:a.x+a.width,y:a.y+a.height}]]},axis:function(a,b){return[{x:a[1].x-a[0].x,y:a[1].y-a[0].y},{x:a[1].x-a[3].x,y:a[1].y-a[3].y},{x:b[0].x-b[2].x,y:b[0].y-b[2].y},{x:b[0].x-b[1].x,y:b[0].y-b[1].y}]},projection:function(a,b){var c=(a.x*b.x+a.y*b.y)/(Math.pow(b.x,2)+Math.pow(b.y,2));return{x:c*b.x,y:c*b.y}},axisCollision:function(a,b,c){for(var d=[],e=[],f=0;f<4;f++){var g=this.projection(b[f],a),h=this.projection(c[f],a);d.push(g.x*a.x+g.y*a.y),e.push(h.x*a.x+h.y*a.y)}var i=Math.max.apply(Math,d),j=Math.max.apply(Math,e),k=Math.min.apply(Math,d);return Math.min.apply(Math,e)<=i&&j>=k},collision:function(a,b){for(var c=this.axis(a,b),d=!0,e=0;e<4;e++)d=d&&this.axisCollision(c[e],a,b);return d}},k=function(){this._geom=j,this._tree=null,this._cache={query:!1,result:!1},this._enabled=!0};k.prototype.index=function(a,b){if(!this._enabled)return this._tree;if(!b.bounds)throw"sigma.classes.edgequad.index: bounds information not given.";var c,d,e,g,h,k=b.prefix||"";this._tree=i(b.bounds,0,b.maxElements,b.maxLevel);for(var l=a.edges(),m=0,n=l.length;m<n;m++)d=a.nodes(l[m].source),e=a.nodes(l[m].target),h={x1:d[k+"x"],y1:d[k+"y"],x2:e[k+"x"],y2:e[k+"y"],size:l[m][k+"size"]||0},"curve"===l[m].type||"curvedArrow"===l[m].type?d.id===e.id?(g={x:d[k+"x"],y:d[k+"y"],size:d[k+"size"]||0},f(l[m],j.selfLoopToSquare(g),this._tree)):(c=sigma.utils.getQuadraticControlPoint(h.x1,h.y1,h.x2,h.y2),f(l[m],j.quadraticCurveToSquare(h,c),this._tree)):f(l[m],j.lineToSquare(h),this._tree);return this._cache={query:!1,result:!1},this._tree},k.prototype.point=function(a,b){return this._enabled&&this._tree?g({x:a,y:b},this._tree)||[]:[]},k.prototype.area=function(a){if(!this._enabled)return[];var b,e,f=JSON.stringify(a);if(this._cache.query===f)return this._cache.result;j.isAxisAligned(a)?(b=c,e=j.axisAlignedTopPoints(a)):(b=d,e=j.rectangleCorners(a));var g=this._tree?h(e,this._tree,b):[],i=[];for(var k in g)i.push(g[k]);return this._cache.query=f,this._cache.result=i,i},void 0!==this.sigma?(this.sigma.classes=this.sigma.classes||{},this.sigma.classes.edgequad=k):"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=k),exports.edgequad=k):this.edgequad=k}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.captors"),sigma.captors.mouse=function(a,b,c){function d(a){var b,c,d;if(y("mouseEnabled")&&(v.dispatchEvent("mousemove",sigma.utils.mouseCoords(a)),q))return r=!0,s=!0,u&&clearTimeout(u),u=setTimeout(function(){r=!1},y("dragTimeout")),sigma.misc.animation.killAll(x),x.isMoving=!0,d=x.cameraPosition(sigma.utils.getX(a)-o,sigma.utils.getY(a)-p,!0),b=k-d.x,c=l-d.y,b===x.x&&c===x.y||(m=x.x,n=x.y,x.goTo({x:b,y:c})),a.preventDefault?a.preventDefault():a.returnValue=!1,a.stopPropagation(),!1}function e(a){if(y("mouseEnabled")&&q){q=!1,u&&clearTimeout(u),x.isMoving=!1;var b=sigma.utils.getX(a),c=sigma.utils.getY(a);r?(sigma.misc.animation.killAll(x),sigma.misc.animation.camera(x,{x:x.x+y("mouseInertiaRatio")*(x.x-m),y:x.y+y("mouseInertiaRatio")*(x.y-n)},{easing:"quadraticOut",duration:y("mouseInertiaDuration")})):o===b&&p===c||x.goTo({x:x.x,y:x.y}),v.dispatchEvent("mouseup",sigma.utils.mouseCoords(a)),r=!1}}function f(a){if(y("mouseEnabled"))switch(k=x.x,l=x.y,m=x.x,n=x.y,o=sigma.utils.getX(a),p=sigma.utils.getY(a),s=!1,t=(new Date).getTime(),a.which){case 2:break;case 3:v.dispatchEvent("rightclick",sigma.utils.mouseCoords(a,o,p));break;default:q=!0,v.dispatchEvent("mousedown",sigma.utils.mouseCoords(a,o,p))}}function g(a){y("mouseEnabled")&&v.dispatchEvent("mouseout")}function h(a){if(y("mouseEnabled")){var b=sigma.utils.mouseCoords(a);b.isDragging=(new Date).getTime()-t>100&&s,v.dispatchEvent("click",b)}return a.preventDefault?a.preventDefault():a.returnValue=!1,a.stopPropagation(),!1}function i(a){var b,c,d;if(y("mouseEnabled"))return c=1/y("doubleClickZoomingRatio"),v.dispatchEvent("doubleclick",sigma.utils.mouseCoords(a,o,p)),y("doubleClickEnabled")&&(b=x.cameraPosition(sigma.utils.getX(a)-sigma.utils.getCenter(a).x,sigma.utils.getY(a)-sigma.utils.getCenter(a).y,!0),d={duration:y("doubleClickZoomDuration")},sigma.utils.zoomTo(x,b.x,b.y,c,d)),a.preventDefault?a.preventDefault():a.returnValue=!1,a.stopPropagation(),!1}function j(a){var b,c,d,e=sigma.utils.getDelta(a);if(y("mouseEnabled")&&y("mouseWheelEnabled")&&0!==e)return c=e>0?1/y("zoomingRatio"):y("zoomingRatio"),b=x.cameraPosition(sigma.utils.getX(a)-sigma.utils.getCenter(a).x,sigma.utils.getY(a)-sigma.utils.getCenter(a).y,!0),d={duration:y("mouseZoomDuration")},sigma.utils.zoomTo(x,b.x,b.y,c,d),a.preventDefault?a.preventDefault():a.returnValue=!1,a.stopPropagation(),!1}var k,l,m,n,o,p,q,r,s,t,u,v=this,w=a,x=b,y=c;sigma.classes.dispatcher.extend(this),sigma.utils.doubleClick(w,"click",i),w.addEventListener("DOMMouseScroll",j,!1),w.addEventListener("mousewheel",j,!1),w.addEventListener("mousemove",d,!1),w.addEventListener("mousedown",f,!1),w.addEventListener("click",h,!1),w.addEventListener("mouseout",g,!1),document.addEventListener("mouseup",e,!1),this.kill=function(){sigma.utils.unbindDoubleClick(w,"click"),w.removeEventListener("DOMMouseScroll",j),w.removeEventListener("mousewheel",j),w.removeEventListener("mousemove",d),w.removeEventListener("mousedown",f),w.removeEventListener("click",h),w.removeEventListener("mouseout",g),document.removeEventListener("mouseup",e)}}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.captors"),sigma.captors.touch=function(a,b,c){function d(a){var b=sigma.utils.getOffset(B);return{x:a.pageX-b.left,y:a.pageY-b.top}}function e(a){if(D("touchEnabled")){var b,c,e,f,g,h;switch(E=a.touches,E.length){case 1:C.isMoving=!0,w=1,i=C.x,j=C.y,m=C.x,n=C.y,g=d(E[0]),q=g.x,r=g.y;break;case 2:return C.isMoving=!0,w=2,g=d(E[0]),h=d(E[1]),b=g.x,e=g.y,c=h.x,f=h.y,m=C.x,n=C.y,k=C.angle,l=C.ratio,i=C.x,j=C.y,q=b,r=e,s=c,t=f,u=Math.atan2(t-r,s-q),v=Math.sqrt((t-r)*(t-r)+(s-q)*(s-q)),a.preventDefault(),!1}}}function f(a){if(D("touchEnabled")){E=a.touches;var b=D("touchInertiaRatio");switch(z&&(x=!1,clearTimeout(z)),w){case 2:if(1===a.touches.length){e(a),a.preventDefault();break}case 1:C.isMoving=!1,A.dispatchEvent("stopDrag"),x&&(y=!1,sigma.misc.animation.camera(C,{x:C.x+b*(C.x-m),y:C.y+b*(C.y-n)},{easing:"quadraticOut",duration:D("touchInertiaDuration")})),x=!1,w=0}}}function g(a){if(!y&&D("touchEnabled")){var b,c,e,f,g,h,B,F,G,H,I,J,K,L,M,N,O;switch(E=a.touches,x=!0,z&&clearTimeout(z),z=setTimeout(function(){x=!1},D("dragTimeout")),w){case 1:F=d(E[0]),b=F.x,e=F.y,H=C.cameraPosition(b-q,e-r,!0),L=i-H.x,M=j-H.y,L===C.x&&M===C.y||(m=C.x,n=C.y,C.goTo({x:L,y:M}),A.dispatchEvent("mousemove",sigma.utils.mouseCoords(a,F.x,F.y)),A.dispatchEvent("drag"));break;case 2:F=d(E[0]),G=d(E[1]),b=F.x,e=F.y,c=G.x,f=G.y,I=C.cameraPosition((q+s)/2-sigma.utils.getCenter(a).x,(r+t)/2-sigma.utils.getCenter(a).y,!0),B=C.cameraPosition((b+c)/2-sigma.utils.getCenter(a).x,(e+f)/2-sigma.utils.getCenter(a).y,!0),J=Math.atan2(f-e,c-b)-u,K=Math.sqrt((f-e)*(f-e)+(c-b)*(c-b))/v,b=I.x,e=I.y,N=l/K,b*=K,e*=K,O=k-J,g=Math.cos(-J),h=Math.sin(-J),c=b*g+e*h,f=e*g-b*h,b=c,e=f,L=b-B.x+i,M=e-B.y+j,N===C.ratio&&O===C.angle&&L===C.x&&M===C.y||(m=C.x,n=C.y,o=C.angle,p=C.ratio,C.goTo({x:L,y:M,angle:O,ratio:N}),A.dispatchEvent("drag"))}return a.preventDefault(),!1}}function h(a){var b,c,e;if(a.touches&&1===a.touches.length&&D("touchEnabled"))return y=!0,c=1/D("doubleClickZoomingRatio"),b=d(a.touches[0]),A.dispatchEvent("doubleclick",sigma.utils.mouseCoords(a,b.x,b.y)),D("doubleClickEnabled")&&(b=C.cameraPosition(b.x-sigma.utils.getCenter(a).x,b.y-sigma.utils.getCenter(a).y,!0),e={duration:D("doubleClickZoomDuration"),onComplete:function(){y=!1}},sigma.utils.zoomTo(C,b.x,b.y,c,e)),a.preventDefault?a.preventDefault():a.returnValue=!1,a.stopPropagation(),!1}var i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A=this,B=a,C=b,D=c,E=[];sigma.classes.dispatcher.extend(this),sigma.utils.doubleClick(B,"touchstart",h),B.addEventListener("touchstart",e,!1),B.addEventListener("touchend",f,!1),B.addEventListener("touchcancel",f,!1),B.addEventListener("touchleave",f,!1),B.addEventListener("touchmove",g,!1),this.kill=function(){sigma.utils.unbindDoubleClick(B,"touchstart"),B.addEventListener("touchstart",e),B.addEventListener("touchend",f),B.addEventListener("touchcancel",f),B.addEventListener("touchleave",f),B.addEventListener("touchmove",g)}}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";if("undefined"==typeof conrad)throw"conrad is not declared";sigma.utils.pkg("sigma.renderers"),sigma.renderers.canvas=function(a,b,c,d){if("object"!=typeof d)throw"sigma.renderers.canvas: Wrong arguments.";if(!(d.container instanceof HTMLElement))throw"Container not found.";var e,f,g,h;for(sigma.classes.dispatcher.extend(this),Object.defineProperty(this,"conradId",{value:sigma.utils.id()}),this.graph=a,this.camera=b,this.contexts={},this.domElements={},this.options=d,this.container=this.options.container,this.settings="object"==typeof d.settings&&d.settings?c.embedObjects(d.settings):c,this.nodesOnScreen=[],this.edgesOnScreen=[],this.jobs={},this.options.prefix="renderer"+this.conradId+":",this.settings("batchEdgesDrawing")?(this.initDOM("canvas","edges"),this.initDOM("canvas","scene"),this.contexts.nodes=this.contexts.scene,this.contexts.labels=this.contexts.scene):(this.initDOM("canvas","scene"),this.contexts.edges=this.contexts.scene,this.contexts.nodes=this.contexts.scene,this.contexts.labels=this.contexts.scene),this.initDOM("canvas","mouse"),this.contexts.hover=this.contexts.mouse,this.captors=[],g=this.options.captors||[sigma.captors.mouse,sigma.captors.touch],e=0,f=g.length;e<f;e++)h="function"==typeof g[e]?g[e]:sigma.captors[g[e]],this.captors.push(new h(this.domElements.mouse,this.camera,this.settings));sigma.misc.bindEvents.call(this,this.options.prefix),sigma.misc.drawHovers.call(this,this.options.prefix),this.resize(!1)},sigma.renderers.canvas.prototype.render=function(b){b=b||{};var c,d,e,f,g,h,i,j,k,l,m,n,o,p={},q=this.graph,r=this.graph.nodes,s=(this.options.prefix,this.settings(b,"drawEdges")),t=this.settings(b,"drawNodes"),u=this.settings(b,"drawLabels"),v=this.settings(b,"drawEdgeLabels"),w=this.settings.embedObjects(b,{prefix:this.options.prefix});this.resize(!1),this.settings(b,"hideEdgesOnMove")&&(this.camera.isAnimated||this.camera.isMoving)&&(s=!1),this.camera.applyView(a,this.options.prefix,{width:this.width,height:this.height}),this.clear();for(e in this.jobs)conrad.hasJob(e)&&conrad.killJob(e);for(this.edgesOnScreen=[],this.nodesOnScreen=this.camera.quadtree.area(this.camera.getRectangle(this.width,this.height)),c=this.nodesOnScreen,d=0,f=c.length;d<f;d++)p[c[d].id]=c[d];if(s){for(c=q.edges(),d=0,f=c.length;d<f;d++)g=c[d],!p[g.source]&&!p[g.target]||g.hidden||r(g.source).hidden||r(g.target).hidden||this.edgesOnScreen.push(g);if(this.settings(b,"batchEdgesDrawing"))h="edges_"+this.conradId,n=w("canvasEdgesBatchSize"),l=this.edgesOnScreen,f=l.length,k=0,i=Math.min(l.length,k+n),j=function(){for(o=this.contexts.edges.globalCompositeOperation,this.contexts.edges.globalCompositeOperation="destination-over",m=sigma.canvas.edges,d=k;d<i;d++)g=l[d],(m[g.type||this.settings(b,"defaultEdgeType")]||m.def)(g,q.nodes(g.source),q.nodes(g.target),this.contexts.edges,w);if(v)for(m=sigma.canvas.edges.labels,d=k;d<i;d++)g=l[d],g.hidden||(m[g.type||this.settings(b,"defaultEdgeType")]||m.def)(g,q.nodes(g.source),q.nodes(g.target),this.contexts.labels,w);return this.contexts.edges.globalCompositeOperation=o,i===l.length?(delete this.jobs[h],!1):(k=i+1,i=Math.min(l.length,k+n),!0)},this.jobs[h]=j,conrad.addJob(h,j.bind(this));else{for(m=sigma.canvas.edges,c=this.edgesOnScreen,d=0,f=c.length;d<f;d++)g=c[d],(m[g.type||this.settings(b,"defaultEdgeType")]||m.def)(g,q.nodes(g.source),q.nodes(g.target),this.contexts.edges,w);if(v)for(m=sigma.canvas.edges.labels,c=this.edgesOnScreen,d=0,f=c.length;d<f;d++)c[d].hidden||(m[c[d].type||this.settings(b,"defaultEdgeType")]||m.def)(c[d],q.nodes(c[d].source),q.nodes(c[d].target),this.contexts.labels,w)}}if(t)for(m=sigma.canvas.nodes,c=this.nodesOnScreen,d=0,f=c.length;d<f;d++)c[d].hidden||(m[c[d].type||this.settings(b,"defaultNodeType")]||m.def)(c[d],this.contexts.nodes,w);if(u)for(m=sigma.canvas.labels,c=this.nodesOnScreen,d=0,f=c.length;d<f;d++)c[d].hidden||(m[c[d].type||this.settings(b,"defaultNodeType")]||m.def)(c[d],this.contexts.labels,w);return this.dispatchEvent("render"),this},sigma.renderers.canvas.prototype.initDOM=function(a,b){var c=document.createElement(a);c.style.position="absolute",c.setAttribute("class","sigma-"+b),this.domElements[b]=c,this.container.appendChild(c),"canvas"===a.toLowerCase()&&(this.contexts[b]=c.getContext("2d"))},sigma.renderers.canvas.prototype.resize=function(b,c){var d,e=this.width,f=this.height,g=sigma.utils.getPixelRatio();if(b!==a&&c!==a?(this.width=b,this.height=c):(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,b=this.width,c=this.height),e!==this.width||f!==this.height)for(d in this.domElements)this.domElements[d].style.width=b+"px",this.domElements[d].style.height=c+"px","canvas"===this.domElements[d].tagName.toLowerCase()&&(this.domElements[d].setAttribute("width",b*g+"px"),this.domElements[d].setAttribute("height",c*g+"px"),1!==g&&this.contexts[d].scale(g,g));return this},sigma.renderers.canvas.prototype.clear=function(){for(var a in this.contexts)this.contexts[a].clearRect(0,0,this.width,this.height);return this},sigma.renderers.canvas.prototype.kill=function(){for(var a,b;b=this.captors.pop();)b.kill();delete this.captors;for(a in this.domElements)this.domElements[a].parentNode.removeChild(this.domElements[a]),delete this.domElements[a],delete this.contexts[a];delete this.domElements,delete this.contexts},sigma.utils.pkg("sigma.canvas.nodes"),sigma.utils.pkg("sigma.canvas.edges"),sigma.utils.pkg("sigma.canvas.labels")}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.renderers"),sigma.renderers.webgl=function(a,b,c,d){if("object"!=typeof d)throw"sigma.renderers.webgl: Wrong arguments.";if(!(d.container instanceof HTMLElement))throw"Container not found.";var e,f,g,h;for(sigma.classes.dispatcher.extend(this),this.jobs={},Object.defineProperty(this,"conradId",{value:sigma.utils.id()}),this.graph=a,this.camera=b,this.contexts={},this.domElements={},this.options=d,this.container=this.options.container,this.settings="object"==typeof d.settings&&d.settings?c.embedObjects(d.settings):c,this.options.prefix=this.camera.readPrefix,Object.defineProperty(this,"nodePrograms",{value:{}}),Object.defineProperty(this,"edgePrograms",{value:{}}),Object.defineProperty(this,"nodeFloatArrays",{value:{}}),Object.defineProperty(this,"edgeFloatArrays",{value:{}}),Object.defineProperty(this,"edgeIndicesArrays",{value:{}}),this.settings(d,"batchEdgesDrawing")?(this.initDOM("canvas","edges",!0),this.initDOM("canvas","nodes",!0)):(this.initDOM("canvas","scene",!0),this.contexts.nodes=this.contexts.scene,this.contexts.edges=this.contexts.scene),this.initDOM("canvas","labels"),this.initDOM("canvas","mouse"),this.contexts.hover=this.contexts.mouse,this.captors=[],g=this.options.captors||[sigma.captors.mouse,sigma.captors.touch],e=0,f=g.length;e<f;e++)h="function"==typeof g[e]?g[e]:sigma.captors[g[e]],this.captors.push(new h(this.domElements.mouse,this.camera,this.settings));sigma.misc.bindEvents.call(this,this.camera.prefix),sigma.misc.drawHovers.call(this,this.camera.prefix),this.resize()},sigma.renderers.webgl.prototype.process=function(){var a,b,c,d,e,f,g=this.graph,h=sigma.utils.extend(h,this.options),i=this.settings(h,"defaultEdgeType"),j=this.settings(h,"defaultNodeType");for(d in this.nodeFloatArrays)delete this.nodeFloatArrays[d];for(d in this.edgeFloatArrays)delete this.edgeFloatArrays[d];for(d in this.edgeIndicesArrays)delete this.edgeIndicesArrays[d];for(a=g.edges(),b=0,c=a.length;b<c;b++)e=a[b].type||i,d=e&&sigma.webgl.edges[e]?e:"def",this.edgeFloatArrays[d]||(this.edgeFloatArrays[d]={edges:[]}),this.edgeFloatArrays[d].edges.push(a[b]);for(a=g.nodes(),b=0,c=a.length;b<c;b++)e=a[b].type||j,d=e&&sigma.webgl.nodes[e]?e:"def",this.nodeFloatArrays[d]||(this.nodeFloatArrays[d]={nodes:[]}),this.nodeFloatArrays[d].nodes.push(a[b]);for(d in this.edgeFloatArrays){for(f=sigma.webgl.edges[d],a=this.edgeFloatArrays[d].edges,this.edgeFloatArrays[d].array=new Float32Array(a.length*f.POINTS*f.ATTRIBUTES),b=0,c=a.length;b<c;b++)a[b].hidden||g.nodes(a[b].source).hidden||g.nodes(a[b].target).hidden||f.addEdge(a[b],g.nodes(a[b].source),g.nodes(a[b].target),this.edgeFloatArrays[d].array,b*f.POINTS*f.ATTRIBUTES,h.prefix,this.settings);"function"==typeof f.computeIndices&&(this.edgeIndicesArrays[d]=f.computeIndices(this.edgeFloatArrays[d].array))}for(d in this.nodeFloatArrays)for(f=sigma.webgl.nodes[d],a=this.nodeFloatArrays[d].nodes,this.nodeFloatArrays[d].array=new Float32Array(a.length*f.POINTS*f.ATTRIBUTES),b=0,c=a.length;b<c;b++)this.nodeFloatArrays[d].array||(this.nodeFloatArrays[d].array=new Float32Array(a.length*f.POINTS*f.ATTRIBUTES)),a[b].hidden||f.addNode(a[b],this.nodeFloatArrays[d].array,b*f.POINTS*f.ATTRIBUTES,h.prefix,this.settings);return this},sigma.renderers.webgl.prototype.render=function(b){var c,d,e,f,g,h,i=this,j=(this.graph,this.contexts.nodes),k=this.contexts.edges,l=this.camera.getMatrix(),m=sigma.utils.extend(b,this.options),n=this.settings(m,"drawLabels"),o=this.settings(m,"drawEdges"),p=this.settings(m,"drawNodes");this.resize(!1),this.settings(m,"hideEdgesOnMove")&&(this.camera.isAnimated||this.camera.isMoving)&&(o=!1),this.clear(),l=sigma.utils.matrices.multiply(l,sigma.utils.matrices.translation(this.width/2,this.height/2));for(f in this.jobs)conrad.hasJob(f)&&conrad.killJob(f);if(o)if(this.settings(m,"batchEdgesDrawing"))(function(){var a,b,c,d,e,f,g,h,i,j;c="edges_"+this.conradId,j=this.settings(m,"webglEdgesBatchSize"),a=Object.keys(this.edgeFloatArrays),a.length&&(b=0,i=sigma.webgl.edges[a[b]],e=this.edgeFloatArrays[a[b]].array,h=this.edgeIndicesArrays[a[b]],g=0,f=Math.min(g+j*i.POINTS,e.length/i.ATTRIBUTES),d=function(){return this.edgePrograms[a[b]]||(this.edgePrograms[a[b]]=i.initProgram(k)),g<f&&(k.useProgram(this.edgePrograms[a[b]]),i.render(k,this.edgePrograms[a[b]],e,{settings:this.settings,matrix:l,width:this.width,height:this.height,ratio:this.camera.ratio,scalingRatio:this.settings(m,"webglOversamplingRatio"),start:g,count:f-g,indicesData:h})),f>=e.length/i.ATTRIBUTES&&b===a.length-1?(delete this.jobs[c],!1):(f>=e.length/i.ATTRIBUTES?(b++,e=this.edgeFloatArrays[a[b]].array,i=sigma.webgl.edges[a[b]],g=0,f=Math.min(g+j*i.POINTS,e.length/i.ATTRIBUTES)):(g=f,f=Math.min(g+j*i.POINTS,e.length/i.ATTRIBUTES)),!0)},this.jobs[c]=d,conrad.addJob(c,d.bind(this)))}).call(this);else for(f in this.edgeFloatArrays)h=sigma.webgl.edges[f],this.edgePrograms[f]||(this.edgePrograms[f]=h.initProgram(k)),this.edgeFloatArrays[f]&&(k.useProgram(this.edgePrograms[f]),h.render(k,this.edgePrograms[f],this.edgeFloatArrays[f].array,{settings:this.settings,matrix:l,width:this.width,height:this.height,ratio:this.camera.ratio,scalingRatio:this.settings(m,"webglOversamplingRatio"),indicesData:this.edgeIndicesArrays[f]}));if(p){j.blendFunc(j.SRC_ALPHA,j.ONE_MINUS_SRC_ALPHA),j.enable(j.BLEND);for(f in this.nodeFloatArrays)h=sigma.webgl.nodes[f],this.nodePrograms[f]||(this.nodePrograms[f]=h.initProgram(j)),this.nodeFloatArrays[f]&&(j.useProgram(this.nodePrograms[f]),h.render(j,this.nodePrograms[f],this.nodeFloatArrays[f].array,{settings:this.settings,matrix:l,width:this.width,height:this.height,ratio:this.camera.ratio,scalingRatio:this.settings(m,"webglOversamplingRatio")}))}if(n)for(c=this.camera.quadtree.area(this.camera.getRectangle(this.width,this.height)),this.camera.applyView(a,a,{nodes:c,edges:[],width:this.width,height:this.height}),g=function(a){return i.settings({prefix:i.camera.prefix},a)},d=0,e=c.length;d<e;d++)c[d].hidden||(sigma.canvas.labels[c[d].type||this.settings(m,"defaultNodeType")]||sigma.canvas.labels.def)(c[d],this.contexts.labels,g);return this.dispatchEvent("render"),this},sigma.renderers.webgl.prototype.initDOM=function(a,b,c){var d=document.createElement(a),e=this;d.style.position="absolute",d.setAttribute("class","sigma-"+b),this.domElements[b]=d,this.container.appendChild(d),"canvas"===a.toLowerCase()&&(this.contexts[b]=d.getContext(c?"experimental-webgl":"2d",{preserveDrawingBuffer:!0}),c&&(d.addEventListener("webglcontextlost",function(a){a.preventDefault()},!1),d.addEventListener("webglcontextrestored",function(a){e.render()},!1)))},sigma.renderers.webgl.prototype.resize=function(b,c){var d,e=this.width,f=this.height,g=sigma.utils.getPixelRatio();if(b!==a&&c!==a?(this.width=b,this.height=c):(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,b=this.width,c=this.height),e!==this.width||f!==this.height)for(d in this.domElements)this.domElements[d].style.width=b+"px",this.domElements[d].style.height=c+"px","canvas"===this.domElements[d].tagName.toLowerCase()&&(this.contexts[d]&&this.contexts[d].scale?(this.domElements[d].setAttribute("width",b*g+"px"),this.domElements[d].setAttribute("height",c*g+"px"),1!==g&&this.contexts[d].scale(g,g)):(this.domElements[d].setAttribute("width",b*this.settings("webglOversamplingRatio")+"px"),this.domElements[d].setAttribute("height",c*this.settings("webglOversamplingRatio")+"px")));for(d in this.contexts)this.contexts[d]&&this.contexts[d].viewport&&this.contexts[d].viewport(0,0,this.width*this.settings("webglOversamplingRatio"),this.height*this.settings("webglOversamplingRatio"));return this},sigma.renderers.webgl.prototype.clear=function(){return this.contexts.labels.clearRect(0,0,this.width,this.height),this.contexts.nodes.clear(this.contexts.nodes.COLOR_BUFFER_BIT),this.contexts.edges.clear(this.contexts.edges.COLOR_BUFFER_BIT),this},sigma.renderers.webgl.prototype.kill=function(){for(var a,b;b=this.captors.pop();)b.kill();delete this.captors;for(a in this.domElements)this.domElements[a].parentNode.removeChild(this.domElements[a]),delete this.domElements[a],delete this.contexts[a];delete this.domElements,delete this.contexts},sigma.utils.pkg("sigma.webgl.nodes"),sigma.utils.pkg("sigma.webgl.edges"),sigma.utils.pkg("sigma.canvas.labels")}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";if("undefined"==typeof conrad)throw"conrad is not declared";sigma.utils.pkg("sigma.renderers"),sigma.renderers.svg=function(a,b,c,d){if("object"!=typeof d)throw"sigma.renderers.svg: Wrong arguments.";if(!(d.container instanceof HTMLElement))throw"Container not found.";var e,f,g,h,i=this;for(sigma.classes.dispatcher.extend(this),this.graph=a,this.camera=b,this.domElements={graph:null,groups:{},nodes:{},edges:{},labels:{},hovers:{}},this.measurementCanvas=null,this.options=d,this.container=this.options.container,this.settings="object"==typeof d.settings&&d.settings?c.embedObjects(d.settings):c,this.settings("freeStyle",!!this.options.freeStyle),this.settings("xmlns","http://www.w3.org/2000/svg"),this.nodesOnScreen=[],this.edgesOnScreen=[],this.options.prefix="renderer"+sigma.utils.id()+":",this.initDOM("svg"),this.captors=[],g=this.options.captors||[sigma.captors.mouse,sigma.captors.touch],e=0,f=g.length;e<f;e++)h="function"==typeof g[e]?g[e]:sigma.captors[g[e]],this.captors.push(new h(this.domElements.graph,this.camera,this.settings));window.addEventListener("resize",function(){i.resize()}),sigma.misc.bindDOMEvents.call(this,this.domElements.graph),this.bindHovers(this.options.prefix),this.resize(!1)},sigma.renderers.svg.prototype.render=function(b){b=b||{};var c,d,e,f,g,h,i,j,k,l={},m=this.graph,n=this.graph.nodes,o=(this.options.prefix,this.settings(b,"drawEdges")),p=this.settings(b,"drawNodes"),q=(this.settings(b,"drawLabels"),this.settings.embedObjects(b,{prefix:this.options.prefix,forceLabels:this.options.forceLabels}));for(this.settings(b,"hideEdgesOnMove")&&(this.camera.isAnimated||this.camera.isMoving)&&(o=!1),this.camera.applyView(a,this.options.prefix,{width:this.width,height:this.height}),this.hideDOMElements(this.domElements.nodes),this.hideDOMElements(this.domElements.edges),this.hideDOMElements(this.domElements.labels),this.edgesOnScreen=[],this.nodesOnScreen=this.camera.quadtree.area(this.camera.getRectangle(this.width,this.height)),c=this.nodesOnScreen,d=0,f=c.length;d<f;d++)l[c[d].id]=c[d];for(c=m.edges(),d=0,f=c.length;d<f;d++)g=c[d],!l[g.source]&&!l[g.target]||g.hidden||n(g.source).hidden||n(g.target).hidden||this.edgesOnScreen.push(g);if(j=sigma.svg.nodes,k=sigma.svg.labels,p)for(c=this.nodesOnScreen,d=0,f=c.length;d<f;d++)c[d].hidden||this.domElements.nodes[c[d].id]||(e=(j[c[d].type]||j.def).create(c[d],q),this.domElements.nodes[c[d].id]=e,this.domElements.groups.nodes.appendChild(e),e=(k[c[d].type]||k.def).create(c[d],q),this.domElements.labels[c[d].id]=e,this.domElements.groups.labels.appendChild(e));if(p)for(c=this.nodesOnScreen,d=0,f=c.length;d<f;d++)c[d].hidden||((j[c[d].type]||j.def).update(c[d],this.domElements.nodes[c[d].id],q),(k[c[d].type]||k.def).update(c[d],this.domElements.labels[c[d].id],q));if(j=sigma.svg.edges,o)for(c=this.edgesOnScreen,d=0,f=c.length;d<f;d++)this.domElements.edges[c[d].id]||(h=n(c[d].source),i=n(c[d].target),e=(j[c[d].type]||j.def).create(c[d],h,i,q),this.domElements.edges[c[d].id]=e,this.domElements.groups.edges.appendChild(e));if(o)for(c=this.edgesOnScreen,d=0,f=c.length;d<f;d++)h=n(c[d].source),i=n(c[d].target),(j[c[d].type]||j.def).update(c[d],this.domElements.edges[c[d].id],h,i,q);return this.dispatchEvent("render"),this},sigma.renderers.svg.prototype.initDOM=function(a){var b,c,d,e=document.createElementNS(this.settings("xmlns"),a),f=this.settings("classPrefix");e.style.position="absolute",e.setAttribute("class",f+"-svg"),e.setAttribute("xmlns",this.settings("xmlns")),e.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),e.setAttribute("version","1.1");var g=document.createElement("canvas");g.setAttribute("class",f+"-measurement-canvas"),this.domElements.graph=this.container.appendChild(e);var h=["edges","nodes","labels","hovers"];for(d=0,c=h.length;d<c;d++)b=document.createElementNS(this.settings("xmlns"),"g"),b.setAttributeNS(null,"id",f+"-group-"+h[d]),b.setAttributeNS(null,"class",f+"-group"),this.domElements.groups[h[d]]=this.domElements.graph.appendChild(b);this.container.appendChild(g),this.measurementCanvas=g.getContext("2d")},sigma.renderers.svg.prototype.hideDOMElements=function(a){var b,c;for(c in a)b=a[c],sigma.svg.utils.hide(b);return this},sigma.renderers.svg.prototype.bindHovers=function(a){function b(b){var c=b.data.node,d=g.settings.embedObjects({prefix:a});if(d("enableHovering")){var h=(f[c.type]||f.def).create(c,g.domElements.nodes[c.id],g.measurementCanvas,d);g.domElements.hovers[c.id]=h,g.domElements.groups.hovers.appendChild(h),e=c}}function c(b){var c=b.data.node;g.settings.embedObjects({prefix:a})("enableHovering")&&(g.domElements.groups.hovers.removeChild(g.domElements.hovers[c.id]),e=null,delete g.domElements.hovers[c.id],g.domElements.groups.nodes.appendChild(g.domElements.nodes[c.id]))}function d(){if(e){var b=g.settings.embedObjects({prefix:a});g.domElements.groups.hovers.removeChild(g.domElements.hovers[e.id]),delete g.domElements.hovers[e.id];var c=(f[e.type]||f.def).create(e,g.domElements.nodes[e.id],g.measurementCanvas,b);g.domElements.hovers[e.id]=c,g.domElements.groups.hovers.appendChild(c)}}var e,f=sigma.svg.hovers,g=this;this.bind("overNode",b),this.bind("outNode",c),this.bind("render",d)},sigma.renderers.svg.prototype.resize=function(b,c){var d=this.width,e=this.height,f=1;return b!==a&&c!==a?(this.width=b,this.height=c):(this.width=this.container.offsetWidth,this.height=this.container.offsetHeight,b=this.width,c=this.height),d===this.width&&e===this.height||(this.domElements.graph.style.width=b+"px",this.domElements.graph.style.height=c+"px","svg"===this.domElements.graph.tagName.toLowerCase()&&(this.domElements.graph.setAttribute("width",b*f),this.domElements.graph.setAttribute("height",c*f))),this},sigma.utils.pkg("sigma.svg.nodes"),sigma.utils.pkg("sigma.svg.edges"),sigma.utils.pkg("sigma.svg.labels")}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.renderers");var b,c=!!a.WebGLRenderingContext;if(c){b=document.createElement("canvas");try{c=!(!b.getContext("webgl")&&!b.getContext("experimental-webgl"))}catch(a){c=!1}}sigma.renderers.def=c?sigma.renderers.webgl:sigma.renderers.canvas}(this),function(){"use strict";sigma.utils.pkg("sigma.webgl.nodes"),sigma.webgl.nodes.def={POINTS:3,ATTRIBUTES:5,addNode:function(a,b,c,d,e){var f=sigma.utils.floatColor(a.color||e("defaultNodeColor"));b[c++]=a[d+"x"],b[c++]=a[d+"y"],b[c++]=a[d+"size"],b[c++]=f,b[c++]=0,b[c++]=a[d+"x"],b[c++]=a[d+"y"],b[c++]=a[d+"size"],b[c++]=f,b[c++]=2*Math.PI/3,b[c++]=a[d+"x"],b[c++]=a[d+"y"],b[c++]=a[d+"size"],b[c++]=f,b[c++]=4*Math.PI/3},render:function(a,b,c,d){var e,f=a.getAttribLocation(b,"a_position"),g=a.getAttribLocation(b,"a_size"),h=a.getAttribLocation(b,"a_color"),i=a.getAttribLocation(b,"a_angle"),j=a.getUniformLocation(b,"u_resolution"),k=a.getUniformLocation(b,"u_matrix"),l=a.getUniformLocation(b,"u_ratio"),m=a.getUniformLocation(b,"u_scale");e=a.createBuffer(),a.bindBuffer(a.ARRAY_BUFFER,e),a.bufferData(a.ARRAY_BUFFER,c,a.DYNAMIC_DRAW),a.uniform2f(j,d.width,d.height),a.uniform1f(l,1/Math.pow(d.ratio,d.settings("nodesPowRatio"))),a.uniform1f(m,d.scalingRatio),a.uniformMatrix3fv(k,!1,d.matrix),a.enableVertexAttribArray(f),a.enableVertexAttribArray(g),a.enableVertexAttribArray(h),a.enableVertexAttribArray(i),a.vertexAttribPointer(f,2,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,0),a.vertexAttribPointer(g,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,8),a.vertexAttribPointer(h,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,12),a.vertexAttribPointer(i,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,16),a.drawArrays(a.TRIANGLES,d.start||0,d.count||c.length/this.ATTRIBUTES)},initProgram:function(a){var b,c;return b=sigma.utils.loadShader(a,["attribute vec2 a_position;","attribute float a_size;","attribute float a_color;","attribute float a_angle;","uniform vec2 u_resolution;","uniform float u_ratio;","uniform float u_scale;","uniform mat3 u_matrix;","varying vec4 color;","varying vec2 center;","varying float radius;","void main() {","radius = a_size * u_ratio;","vec2 position = (u_matrix * vec3(a_position, 1)).xy;","center = position * u_scale;","center = vec2(center.x, u_scale * u_resolution.y - center.y);","position = position +","2.0 * radius * vec2(cos(a_angle), sin(a_angle));","position = (position / u_resolution * 2.0 - 1.0) * vec2(1, -1);","radius = radius * u_scale;","gl_Position = vec4(position, 0, 1);","float c = a_color;","color.b = mod(c, 256.0); c = floor(c / 256.0);","color.g = mod(c, 256.0); c = floor(c / 256.0);","color.r = mod(c, 256.0); c = floor(c / 256.0); color /= 255.0;","color.a = 1.0;","}"].join("\n"),a.VERTEX_SHADER),c=sigma.utils.loadShader(a,["precision mediump float;","varying vec4 color;","varying vec2 center;","varying float radius;","void main(void) {","vec4 color0 = vec4(0.0, 0.0, 0.0, 0.0);","vec2 m = gl_FragCoord.xy - center;","float diff = radius - sqrt(m.x * m.x + m.y * m.y);","if (diff > 0.0)","gl_FragColor = color;","else","gl_FragColor = color0;","}"].join("\n"),a.FRAGMENT_SHADER),sigma.utils.loadProgram(a,[b,c])}}}(),function(){"use strict";sigma.utils.pkg("sigma.webgl.nodes"),sigma.webgl.nodes.fast={POINTS:1,ATTRIBUTES:4,addNode:function(a,b,c,d,e){b[c++]=a[d+"x"],b[c++]=a[d+"y"],b[c++]=a[d+"size"],b[c++]=sigma.utils.floatColor(a.color||e("defaultNodeColor"))},render:function(a,b,c,d){var e,f=a.getAttribLocation(b,"a_position"),g=a.getAttribLocation(b,"a_size"),h=a.getAttribLocation(b,"a_color"),i=a.getUniformLocation(b,"u_resolution"),j=a.getUniformLocation(b,"u_matrix"),k=a.getUniformLocation(b,"u_ratio"),l=a.getUniformLocation(b,"u_scale");e=a.createBuffer(),a.bindBuffer(a.ARRAY_BUFFER,e),a.bufferData(a.ARRAY_BUFFER,c,a.DYNAMIC_DRAW),a.uniform2f(i,d.width,d.height),a.uniform1f(k,1/Math.pow(d.ratio,d.settings("nodesPowRatio"))),a.uniform1f(l,d.scalingRatio),a.uniformMatrix3fv(j,!1,d.matrix),a.enableVertexAttribArray(f),a.enableVertexAttribArray(g),a.enableVertexAttribArray(h),a.vertexAttribPointer(f,2,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,0),a.vertexAttribPointer(g,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,8),a.vertexAttribPointer(h,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,12),a.drawArrays(a.POINTS,d.start||0,d.count||c.length/this.ATTRIBUTES)},initProgram:function(a){var b,c;return b=sigma.utils.loadShader(a,["attribute vec2 a_position;","attribute float a_size;","attribute float a_color;","uniform vec2 u_resolution;","uniform float u_ratio;","uniform float u_scale;","uniform mat3 u_matrix;","varying vec4 color;","void main() {","gl_Position = vec4(","((u_matrix * vec3(a_position, 1)).xy /","u_resolution * 2.0 - 1.0) * vec2(1, -1),","0,","1",");","gl_PointSize = a_size * u_ratio * u_scale * 2.0;","float c = a_color;","color.b = mod(c, 256.0); c = floor(c / 256.0);","color.g = mod(c, 256.0); c = floor(c / 256.0);","color.r = mod(c, 256.0); c = floor(c / 256.0); color /= 255.0;","color.a = 1.0;","}"].join("\n"),a.VERTEX_SHADER),c=sigma.utils.loadShader(a,["precision mediump float;","varying vec4 color;","void main(void) {","float border = 0.01;","float radius = 0.5;","vec4 color0 = vec4(0.0, 0.0, 0.0, 0.0);","vec2 m = gl_PointCoord - vec2(0.5, 0.5);","float dist = radius - sqrt(m.x * m.x + m.y * m.y);","float t = 0.0;","if (dist > border)","t = 1.0;","else if (dist > 0.0)","t = dist / border;","gl_FragColor = mix(color0, color, t);","}"].join("\n"),a.FRAGMENT_SHADER),sigma.utils.loadProgram(a,[b,c])}}}(),function(){"use strict";sigma.utils.pkg("sigma.webgl.edges"),sigma.webgl.edges.def={POINTS:6,ATTRIBUTES:7,addEdge:function(a,b,c,d,e,f,g){var h=(a[f+"size"]||1)/2,i=b[f+"x"],j=b[f+"y"],k=c[f+"x"],l=c[f+"y"],m=a.color;if(!m)switch(g("edgeColor")){case"source":m=b.color||g("defaultNodeColor");break;case"target":m=c.color||g("defaultNodeColor");break;default:m=g("defaultEdgeColor")}m=sigma.utils.floatColor(m),d[e++]=i,d[e++]=j,d[e++]=k,d[e++]=l,d[e++]=h,d[e++]=0,d[e++]=m,d[e++]=k,d[e++]=l,d[e++]=i,d[e++]=j,d[e++]=h,d[e++]=1,d[e++]=m,d[e++]=k,d[e++]=l,d[e++]=i,d[e++]=j,d[e++]=h,d[e++]=0,d[e++]=m,d[e++]=k,d[e++]=l,d[e++]=i,d[e++]=j,d[e++]=h,d[e++]=0,d[e++]=m,d[e++]=i,d[e++]=j,d[e++]=k,d[e++]=l,d[e++]=h,d[e++]=1,d[e++]=m,d[e++]=i,d[e++]=j,d[e++]=k,d[e++]=l,d[e++]=h,d[e++]=0,d[e++]=m},render:function(a,b,c,d){var e,f=a.getAttribLocation(b,"a_color"),g=a.getAttribLocation(b,"a_position1"),h=a.getAttribLocation(b,"a_position2"),i=a.getAttribLocation(b,"a_thickness"),j=a.getAttribLocation(b,"a_minus"),k=a.getUniformLocation(b,"u_resolution"),l=a.getUniformLocation(b,"u_matrix"),m=a.getUniformLocation(b,"u_matrixHalfPi"),n=a.getUniformLocation(b,"u_matrixHalfPiMinus"),o=a.getUniformLocation(b,"u_ratio"),p=a.getUniformLocation(b,"u_scale");e=a.createBuffer(),a.bindBuffer(a.ARRAY_BUFFER,e),a.bufferData(a.ARRAY_BUFFER,c,a.STATIC_DRAW),a.uniform2f(k,d.width,d.height),a.uniform1f(o,d.ratio/Math.pow(d.ratio,d.settings("edgesPowRatio"))),a.uniform1f(p,d.scalingRatio),a.uniformMatrix3fv(l,!1,d.matrix),a.uniformMatrix2fv(m,!1,sigma.utils.matrices.rotation(Math.PI/2,!0)),a.uniformMatrix2fv(n,!1,sigma.utils.matrices.rotation(-Math.PI/2,!0)),a.enableVertexAttribArray(f),a.enableVertexAttribArray(g),a.enableVertexAttribArray(h),a.enableVertexAttribArray(i),a.enableVertexAttribArray(j),a.vertexAttribPointer(g,2,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,0),a.vertexAttribPointer(h,2,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,8),a.vertexAttribPointer(i,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,16),a.vertexAttribPointer(j,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,20),a.vertexAttribPointer(f,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,24),a.drawArrays(a.TRIANGLES,d.start||0,d.count||c.length/this.ATTRIBUTES)},initProgram:function(a){var b,c;return b=sigma.utils.loadShader(a,["attribute vec2 a_position1;","attribute vec2 a_position2;","attribute float a_thickness;","attribute float a_minus;","attribute float a_color;","uniform vec2 u_resolution;","uniform float u_ratio;","uniform float u_scale;","uniform mat3 u_matrix;","uniform mat2 u_matrixHalfPi;","uniform mat2 u_matrixHalfPiMinus;","varying vec4 color;","void main() {","vec2 position = a_thickness * u_ratio *","normalize(a_position2 - a_position1);","mat2 matrix = a_minus * u_matrixHalfPiMinus +","(1.0 - a_minus) * u_matrixHalfPi;","position = matrix * position + a_position1;","gl_Position = vec4(","((u_matrix * vec3(position, 1)).xy /","u_resolution * 2.0 - 1.0) * vec2(1, -1),","0,","1",");","float c = a_color;","color.b = mod(c, 256.0); c = floor(c / 256.0);","color.g = mod(c, 256.0); c = floor(c / 256.0);","color.r = mod(c, 256.0); c = floor(c / 256.0); color /= 255.0;","color.a = 1.0;","}"].join("\n"),a.VERTEX_SHADER),c=sigma.utils.loadShader(a,["precision mediump float;","varying vec4 color;","void main(void) {","gl_FragColor = color;","}"].join("\n"),a.FRAGMENT_SHADER),sigma.utils.loadProgram(a,[b,c])}}}(),function(){"use strict";sigma.utils.pkg("sigma.webgl.edges"),sigma.webgl.edges.fast={POINTS:2,ATTRIBUTES:3,addEdge:function(a,b,c,d,e,f,g){var h=(a[f+"size"],b[f+"x"]),i=b[f+"y"],j=c[f+"x"],k=c[f+"y"],l=a.color;if(!l)switch(g("edgeColor")){case"source":l=b.color||g("defaultNodeColor");break;case"target":l=c.color||g("defaultNodeColor");break;default:l=g("defaultEdgeColor")}l=sigma.utils.floatColor(l),d[e++]=h,d[e++]=i,d[e++]=l,d[e++]=j,d[e++]=k,d[e++]=l},render:function(a,b,c,d){var e,f=a.getAttribLocation(b,"a_color"),g=a.getAttribLocation(b,"a_position"),h=a.getUniformLocation(b,"u_resolution"),i=a.getUniformLocation(b,"u_matrix");e=a.createBuffer(),a.bindBuffer(a.ARRAY_BUFFER,e),a.bufferData(a.ARRAY_BUFFER,c,a.DYNAMIC_DRAW),a.uniform2f(h,d.width,d.height),a.uniformMatrix3fv(i,!1,d.matrix),a.enableVertexAttribArray(g),a.enableVertexAttribArray(f),a.vertexAttribPointer(g,2,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,0),a.vertexAttribPointer(f,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,8),a.lineWidth(3),a.drawArrays(a.LINES,d.start||0,d.count||c.length/this.ATTRIBUTES)},initProgram:function(a){var b,c;return b=sigma.utils.loadShader(a,["attribute vec2 a_position;","attribute float a_color;","uniform vec2 u_resolution;","uniform mat3 u_matrix;","varying vec4 color;","void main() {","gl_Position = vec4(","((u_matrix * vec3(a_position, 1)).xy /","u_resolution * 2.0 - 1.0) * vec2(1, -1),","0,","1",");","float c = a_color;","color.b = mod(c, 256.0); c = floor(c / 256.0);","color.g = mod(c, 256.0); c = floor(c / 256.0);","color.r = mod(c, 256.0); c = floor(c / 256.0); color /= 255.0;","color.a = 1.0;","}"].join("\n"),a.VERTEX_SHADER),c=sigma.utils.loadShader(a,["precision mediump float;","varying vec4 color;","void main(void) {","gl_FragColor = color;","}"].join("\n"),a.FRAGMENT_SHADER),sigma.utils.loadProgram(a,[b,c])}}}(),function(){"use strict";sigma.utils.pkg("sigma.webgl.edges"),sigma.webgl.edges.arrow={POINTS:9,ATTRIBUTES:11,addEdge:function(a,b,c,d,e,f,g){var h=(a[f+"size"]||1)/2,i=b[f+"x"],j=b[f+"y"],k=c[f+"x"],l=c[f+"y"],m=c[f+"size"],n=a.color;if(!n)switch(g("edgeColor")){case"source":n=b.color||g("defaultNodeColor");break;case"target":n=c.color||g("defaultNodeColor");break;default:n=g("defaultEdgeColor")}n=sigma.utils.floatColor(n),d[e++]=i,d[e++]=j,d[e++]=k,d[e++]=l,d[e++]=h,d[e++]=m,d[e++]=0,d[e++]=0,d[e++]=0,d[e++]=0,d[e++]=n,d[e++]=k,d[e++]=l,d[e++]=i,d[e++]=j,d[e++]=h,d[e++]=m,d[e++]=1,d[e++]=1,d[e++]=0,d[e++]=0,d[e++]=n,d[e++]=k,d[e++]=l,d[e++]=i,d[e++]=j,d[e++]=h,d[e++]=m,d[e++]=1,d[e++]=0,d[e++]=0,d[e++]=0,d[e++]=n,d[e++]=k,d[e++]=l,d[e++]=i,d[e++]=j,d[e++]=h,d[e++]=m,d[e++]=1,d[e++]=0,d[e++]=0,d[e++]=0,d[e++]=n,d[e++]=i,d[e++]=j,d[e++]=k,d[e++]=l,d[e++]=h,d[e++]=m,d[e++]=0,d[e++]=1,d[e++]=0,d[e++]=0,d[e++]=n,d[e++]=i,d[e++]=j,d[e++]=k,d[e++]=l,d[e++]=h,d[e++]=m,d[e++]=0,d[e++]=0,d[e++]=0,d[e++]=0,d[e++]=n,d[e++]=k,d[e++]=l,d[e++]=i,d[e++]=j,d[e++]=h,d[e++]=m,d[e++]=1,d[e++]=0,d[e++]=1,d[e++]=-1,d[e++]=n,d[e++]=k,d[e++]=l,d[e++]=i,d[e++]=j,d[e++]=h,d[e++]=m,d[e++]=1,d[e++]=0,d[e++]=1,d[e++]=0,d[e++]=n,d[e++]=k,d[e++]=l,d[e++]=i,d[e++]=j,d[e++]=h,d[e++]=m,d[e++]=1,d[e++]=0,d[e++]=1,d[e++]=1,d[e++]=n},render:function(a,b,c,d){var e,f=a.getAttribLocation(b,"a_pos1"),g=a.getAttribLocation(b,"a_pos2"),h=a.getAttribLocation(b,"a_thickness"),i=a.getAttribLocation(b,"a_tSize"),j=a.getAttribLocation(b,"a_delay"),k=a.getAttribLocation(b,"a_minus"),l=a.getAttribLocation(b,"a_head"),m=a.getAttribLocation(b,"a_headPosition"),n=a.getAttribLocation(b,"a_color"),o=a.getUniformLocation(b,"u_resolution"),p=a.getUniformLocation(b,"u_matrix"),q=a.getUniformLocation(b,"u_matrixHalfPi"),r=a.getUniformLocation(b,"u_matrixHalfPiMinus"),s=a.getUniformLocation(b,"u_ratio"),t=a.getUniformLocation(b,"u_nodeRatio"),u=a.getUniformLocation(b,"u_arrowHead"),v=a.getUniformLocation(b,"u_scale");e=a.createBuffer(),a.bindBuffer(a.ARRAY_BUFFER,e),a.bufferData(a.ARRAY_BUFFER,c,a.STATIC_DRAW),a.uniform2f(o,d.width,d.height),a.uniform1f(s,d.ratio/Math.pow(d.ratio,d.settings("edgesPowRatio"))),a.uniform1f(t,Math.pow(d.ratio,d.settings("nodesPowRatio"))/d.ratio),a.uniform1f(u,5),a.uniform1f(v,d.scalingRatio),a.uniformMatrix3fv(p,!1,d.matrix),a.uniformMatrix2fv(q,!1,sigma.utils.matrices.rotation(Math.PI/2,!0)),a.uniformMatrix2fv(r,!1,sigma.utils.matrices.rotation(-Math.PI/2,!0)),a.enableVertexAttribArray(f),a.enableVertexAttribArray(g),a.enableVertexAttribArray(h),a.enableVertexAttribArray(i),a.enableVertexAttribArray(j),a.enableVertexAttribArray(k),a.enableVertexAttribArray(l),a.enableVertexAttribArray(m),a.enableVertexAttribArray(n),a.vertexAttribPointer(f,2,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,0),a.vertexAttribPointer(g,2,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,8),a.vertexAttribPointer(h,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,16),a.vertexAttribPointer(i,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,20),a.vertexAttribPointer(j,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,24),a.vertexAttribPointer(k,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,28),a.vertexAttribPointer(l,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,32),a.vertexAttribPointer(m,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,36),a.vertexAttribPointer(n,1,a.FLOAT,!1,this.ATTRIBUTES*Float32Array.BYTES_PER_ELEMENT,40),a.drawArrays(a.TRIANGLES,d.start||0,d.count||c.length/this.ATTRIBUTES)},initProgram:function(a){var b,c;return b=sigma.utils.loadShader(a,["attribute vec2 a_pos1;","attribute vec2 a_pos2;","attribute float a_thickness;","attribute float a_tSize;","attribute float a_delay;","attribute float a_minus;","attribute float a_head;","attribute float a_headPosition;","attribute float a_color;","uniform vec2 u_resolution;","uniform float u_ratio;","uniform float u_nodeRatio;","uniform float u_arrowHead;","uniform float u_scale;","uniform mat3 u_matrix;","uniform mat2 u_matrixHalfPi;","uniform mat2 u_matrixHalfPiMinus;","varying vec4 color;","void main() {","vec2 pos = normalize(a_pos2 - a_pos1);","mat2 matrix = (1.0 - a_head) *","(","a_minus * u_matrixHalfPiMinus +","(1.0 - a_minus) * u_matrixHalfPi",") + a_head * (","a_headPosition * u_matrixHalfPiMinus * 0.6 +","(a_headPosition * a_headPosition - 1.0) * mat2(1.0)",");","pos = a_pos1 + (","(1.0 - a_head) * a_thickness * u_ratio * matrix * pos +","a_head * u_arrowHead * a_thickness * u_ratio * matrix * pos +","a_delay * pos * (","a_tSize / u_nodeRatio +","u_arrowHead * a_thickness * u_ratio",")",");","gl_Position = vec4(","((u_matrix * vec3(pos, 1)).xy /","u_resolution * 2.0 - 1.0) * vec2(1, -1),","0,","1",");","float c = a_color;","color.b = mod(c, 256.0); c = floor(c / 256.0);","color.g = mod(c, 256.0); c = floor(c / 256.0);","color.r = mod(c, 256.0); c = floor(c / 256.0); color /= 255.0;","color.a = 1.0;","}"].join("\n"),a.VERTEX_SHADER),c=sigma.utils.loadShader(a,["precision mediump float;","varying vec4 color;","void main(void) {","gl_FragColor = color;","}"].join("\n"),a.FRAGMENT_SHADER),sigma.utils.loadProgram(a,[b,c])}}}(),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.canvas.labels"),sigma.canvas.labels.def=function(a,b,c){var d,e=c("prefix")||"",f=a[e+"size"];f<c("labelThreshold")||a.label&&"string"==typeof a.label&&(d="fixed"===c("labelSize")?c("defaultLabelSize"):c("labelSizeRatio")*f,b.font=(c("fontStyle")?c("fontStyle")+" ":"")+d+"px "+c("font"),b.fillStyle="node"===c("labelColor")?a.color||c("defaultNodeColor"):c("defaultLabelColor"),b.fillText(a.label,Math.round(a[e+"x"]+f+3),Math.round(a[e+"y"]+d/3)))}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.canvas.hovers"),sigma.canvas.hovers.def=function(a,b,c){var d,e,f,g,h,i=c("hoverFontStyle")||c("fontStyle"),j=c("prefix")||"",k=a[j+"size"],l="fixed"===c("labelSize")?c("defaultLabelSize"):c("labelSizeRatio")*k;b.font=(i?i+" ":"")+l+"px "+(c("hoverFont")||c("font")),b.beginPath(),b.fillStyle="node"===c("labelHoverBGColor")?a.color||c("defaultNodeColor"):c("defaultHoverLabelBGColor"),a.label&&c("labelHoverShadow")&&(b.shadowOffsetX=0,b.shadowOffsetY=0,b.shadowBlur=8,b.shadowColor=c("labelHoverShadowColor")),a.label&&"string"==typeof a.label&&(d=Math.round(a[j+"x"]-l/2-2),e=Math.round(a[j+"y"]-l/2-2),f=Math.round(b.measureText(a.label).width+l/2+k+7),g=Math.round(l+4),h=Math.round(l/2+2),b.moveTo(d,e+h),b.arcTo(d,e,d+h,e,h),b.lineTo(d+f,e),b.lineTo(d+f,e+g),b.lineTo(d+h,e+g),b.arcTo(d,e+g,d,e+g-h,h),b.lineTo(d,e+h),b.closePath(),b.fill(),b.shadowOffsetX=0,b.shadowOffsetY=0,b.shadowBlur=0),c("borderSize")>0&&(b.beginPath(),b.fillStyle="node"===c("nodeBorderColor")?a.color||c("defaultNodeColor"):c("defaultNodeBorderColor"),b.arc(a[j+"x"],a[j+"y"],k+c("borderSize"),0,2*Math.PI,!0),b.closePath(),b.fill()),(sigma.canvas.nodes[a.type]||sigma.canvas.nodes.def)(a,b,c),a.label&&"string"==typeof a.label&&(b.fillStyle="node"===c("labelHoverColor")?a.color||c("defaultNodeColor"):c("defaultLabelHoverColor"),b.fillText(a.label,Math.round(a[j+"x"]+k+3),Math.round(a[j+"y"]+l/3)))}}.call(this),function(){"use strict";sigma.utils.pkg("sigma.canvas.nodes"),sigma.canvas.nodes.def=function(a,b,c){var d=c("prefix")||"";b.fillStyle=a.color||c("defaultNodeColor"),b.beginPath(),b.arc(a[d+"x"],a[d+"y"],a[d+"size"],0,2*Math.PI,!0),b.closePath(),b.fill()}}(),function(){"use strict";sigma.utils.pkg("sigma.canvas.edges"),sigma.canvas.edges.def=function(a,b,c,d,e){var f=a.color,g=e("prefix")||"",h=a[g+"size"]||1,i=e("edgeColor"),j=e("defaultNodeColor"),k=e("defaultEdgeColor");if(!f)switch(i){case"source":f=b.color||j;break;case"target":f=c.color||j;break;default:f=k}d.strokeStyle=f,d.lineWidth=h,d.beginPath(),d.moveTo(b[g+"x"],b[g+"y"]),d.lineTo(c[g+"x"],c[g+"y"]),d.stroke()}}(),function(){"use strict";sigma.utils.pkg("sigma.canvas.edges"),sigma.canvas.edges.arrow=function(a,b,c,d,e){var f=a.color,g=e("prefix")||"",h=e("edgeColor"),i=e("defaultNodeColor"),j=e("defaultEdgeColor"),k=a[g+"size"]||1,l=c[g+"size"],m=b[g+"x"],n=b[g+"y"],o=c[g+"x"],p=c[g+"y"],q=Math.max(2.5*k,e("minArrowSize")),r=Math.sqrt(Math.pow(o-m,2)+Math.pow(p-n,2)),s=m+(o-m)*(r-q-l)/r,t=n+(p-n)*(r-q-l)/r,u=(o-m)*q/r,v=(p-n)*q/r;if(!f)switch(h){case"source":f=b.color||i;break;case"target":f=c.color||i;break;default:f=j}d.strokeStyle=f,d.lineWidth=k,d.beginPath(),d.moveTo(m,n),d.lineTo(s,t),d.stroke(),d.fillStyle=f,d.beginPath(),d.moveTo(s+u,t+v),d.lineTo(s+.6*v,t-.6*u),d.lineTo(s-.6*v,t+.6*u),d.lineTo(s+u,t+v),d.closePath(),d.fill()}}(),function(){"use strict";sigma.utils.pkg("sigma.canvas.edgehovers"),sigma.canvas.edgehovers.def=function(a,b,c,d,e){var f=a.color,g=e("prefix")||"",h=a[g+"size"]||1,i=e("edgeColor"),j=e("defaultNodeColor"),k=e("defaultEdgeColor");if(!f)switch(i){case"source":f=b.color||j;break;case"target":f=c.color||j;break;default:f=k}f="edge"===e("edgeHoverColor")?a.hover_color||f:a.hover_color||e("defaultEdgeHoverColor")||f,h*=e("edgeHoverSizeRatio"),d.strokeStyle=f,d.lineWidth=h,d.beginPath(),d.moveTo(b[g+"x"],b[g+"y"]),d.lineTo(c[g+"x"],c[g+"y"]),d.stroke()}}(),function(){"use strict";sigma.utils.pkg("sigma.canvas.edgehovers"),sigma.canvas.edgehovers.curve=function(a,b,c,d,e){var f=a.color,g=e("prefix")||"",h=e("edgeHoverSizeRatio")*(a[g+"size"]||1),i=e("edgeColor"),j=e("defaultNodeColor"),k=e("defaultEdgeColor"),l={},m=b[g+"size"],n=b[g+"x"],o=b[g+"y"],p=c[g+"x"],q=c[g+"y"];if(l=b.id===c.id?sigma.utils.getSelfLoopControlPoints(n,o,m):sigma.utils.getQuadraticControlPoint(n,o,p,q),!f)switch(i){case"source":f=b.color||j;break;case"target":f=c.color||j;break;default:f=k}f="edge"===e("edgeHoverColor")?a.hover_color||f:a.hover_color||e("defaultEdgeHoverColor")||f,d.strokeStyle=f,d.lineWidth=h,d.beginPath(),d.moveTo(n,o),b.id===c.id?d.bezierCurveTo(l.x1,l.y1,l.x2,l.y2,p,q):d.quadraticCurveTo(l.x,l.y,p,q),d.stroke()}}(),function(){"use strict";sigma.utils.pkg("sigma.canvas.edgehovers"),sigma.canvas.edgehovers.arrow=function(a,b,c,d,e){var f=a.color,g=e("prefix")||"",h=e("edgeColor"),i=e("defaultNodeColor"),j=e("defaultEdgeColor"),k=a[g+"size"]||1,l=c[g+"size"],m=b[g+"x"],n=b[g+"y"],o=c[g+"x"],p=c[g+"y"];k=a.hover?e("edgeHoverSizeRatio")*k:k;var q=2.5*k,r=Math.sqrt(Math.pow(o-m,2)+Math.pow(p-n,2)),s=m+(o-m)*(r-q-l)/r,t=n+(p-n)*(r-q-l)/r,u=(o-m)*q/r,v=(p-n)*q/r;if(!f)switch(h){case"source":f=b.color||i;break;case"target":f=c.color||i;break;default:f=j}f="edge"===e("edgeHoverColor")?a.hover_color||f:a.hover_color||e("defaultEdgeHoverColor")||f,d.strokeStyle=f,d.lineWidth=k,d.beginPath(),d.moveTo(m,n),d.lineTo(s,t),d.stroke(),d.fillStyle=f,d.beginPath(),d.moveTo(s+u,t+v),d.lineTo(s+.6*v,t-.6*u),d.lineTo(s-.6*v,t+.6*u),d.lineTo(s+u,t+v),d.closePath(),d.fill()}}(),function(){"use strict";sigma.utils.pkg("sigma.canvas.edgehovers"),sigma.canvas.edgehovers.curvedArrow=function(a,b,c,d,e){var f,g,h,i,j,k,l=a.color,m=e("prefix")||"",n=e("edgeColor"),o=e("defaultNodeColor"),p=e("defaultEdgeColor"),q={},r=e("edgeHoverSizeRatio")*(a[m+"size"]||1),s=c[m+"size"],t=b[m+"x"],u=b[m+"y"],v=c[m+"x"],w=c[m+"y"];if(q=b.id===c.id?sigma.utils.getSelfLoopControlPoints(t,u,s):sigma.utils.getQuadraticControlPoint(t,u,v,w),b.id===c.id?(f=Math.sqrt(Math.pow(v-q.x1,2)+Math.pow(w-q.y1,2)),g=2.5*r,h=q.x1+(v-q.x1)*(f-g-s)/f,i=q.y1+(w-q.y1)*(f-g-s)/f,j=(v-q.x1)*g/f,k=(w-q.y1)*g/f):(f=Math.sqrt(Math.pow(v-q.x,2)+Math.pow(w-q.y,2)),g=2.5*r,h=q.x+(v-q.x)*(f-g-s)/f,i=q.y+(w-q.y)*(f-g-s)/f,j=(v-q.x)*g/f,k=(w-q.y)*g/f),!l)switch(n){case"source":l=b.color||o;break;case"target":l=c.color||o;break;default:l=p}l="edge"===e("edgeHoverColor")?a.hover_color||l:a.hover_color||e("defaultEdgeHoverColor")||l,d.strokeStyle=l,d.lineWidth=r,d.beginPath(),d.moveTo(t,u),b.id===c.id?d.bezierCurveTo(q.x2,q.y2,q.x1,q.y1,h,i):d.quadraticCurveTo(q.x,q.y,h,i),d.stroke(),d.fillStyle=l,d.beginPath(),d.moveTo(h+j,i+k),d.lineTo(h+.6*k,i-.6*j),d.lineTo(h-.6*k,i+.6*j),d.lineTo(h+j,i+k),d.closePath(),d.fill()}}(),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.canvas.extremities"),sigma.canvas.extremities.def=function(a,b,c,d,e){(sigma.canvas.hovers[b.type]||sigma.canvas.hovers.def)(b,d,e),(sigma.canvas.hovers[c.type]||sigma.canvas.hovers.def)(c,d,e)}}.call(this),function(){"use strict";sigma.utils.pkg("sigma.svg.utils"),sigma.svg.utils={show:function(a){return a.style.display="",this},hide:function(a){return a.style.display="none",this}}}(),function(){"use strict";sigma.utils.pkg("sigma.svg.nodes"),sigma.svg.nodes.def={create:function(a,b){var c=(b("prefix"),document.createElementNS(b("xmlns"),"circle"));return c.setAttributeNS(null,"data-node-id",a.id),c.setAttributeNS(null,"class",b("classPrefix")+"-node"),c.setAttributeNS(null,"fill",a.color||b("defaultNodeColor")),c},update:function(a,b,c){var d=c("prefix")||"";return b.setAttributeNS(null,"cx",a[d+"x"]),b.setAttributeNS(null,"cy",a[d+"y"]),b.setAttributeNS(null,"r",a[d+"size"]),c("freeStyle")||b.setAttributeNS(null,"fill",a.color||c("defaultNodeColor")),b.style.display="",this}}}(),function(){"use strict";sigma.utils.pkg("sigma.svg.edges"),sigma.svg.edges.def={create:function(a,b,c,d){var e=a.color,f=(d("prefix"),d("edgeColor")),g=d("defaultNodeColor"),h=d("defaultEdgeColor");if(!e)switch(f){case"source":e=b.color||g;break;case"target":e=c.color||g;break;default:e=h}var i=document.createElementNS(d("xmlns"),"line");return i.setAttributeNS(null,"data-edge-id",a.id),i.setAttributeNS(null,"class",d("classPrefix")+"-edge"),i.setAttributeNS(null,"stroke",e),i},update:function(a,b,c,d,e){var f=e("prefix")||"";return b.setAttributeNS(null,"stroke-width",a[f+"size"]||1),b.setAttributeNS(null,"x1",c[f+"x"]),b.setAttributeNS(null,"y1",c[f+"y"]),b.setAttributeNS(null,"x2",d[f+"x"]),b.setAttributeNS(null,"y2",d[f+"y"]),b.style.display="",this}}}(),function(){"use strict";sigma.utils.pkg("sigma.svg.edges"),sigma.svg.edges.curve={create:function(a,b,c,d){var e=a.color,f=(d("prefix"),d("edgeColor")),g=d("defaultNodeColor"),h=d("defaultEdgeColor");if(!e)switch(f){case"source":e=b.color||g;break;case"target":e=c.color||g;break;default:e=h}var i=document.createElementNS(d("xmlns"),"path");return i.setAttributeNS(null,"data-edge-id",a.id),i.setAttributeNS(null,"class",d("classPrefix")+"-edge"),i.setAttributeNS(null,"stroke",e),i},update:function(a,b,c,d,e){var f=e("prefix")||"";b.setAttributeNS(null,"stroke-width",a[f+"size"]||1);var g=(c[f+"x"]+d[f+"x"])/2+(d[f+"y"]-c[f+"y"])/4,h=(c[f+"y"]+d[f+"y"])/2+(c[f+"x"]-d[f+"x"])/4,i="M"+c[f+"x"]+","+c[f+"y"]+" Q"+g+","+h+" "+d[f+"x"]+","+d[f+"y"];return b.setAttributeNS(null,"d",i),b.setAttributeNS(null,"fill","none"),b.style.display="",this}}}(),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.svg.labels"),sigma.svg.labels.def={create:function(a,b){var c=b("prefix")||"",d=a[c+"size"],e=document.createElementNS(b("xmlns"),"text"),f="fixed"===b("labelSize")?b("defaultLabelSize"):b("labelSizeRatio")*d,g="node"===b("labelColor")?a.color||b("defaultNodeColor"):b("defaultLabelColor");return e.setAttributeNS(null,"data-label-target",a.id),e.setAttributeNS(null,"class",b("classPrefix")+"-label"),e.setAttributeNS(null,"font-size",f),e.setAttributeNS(null,"font-family",b("font")),e.setAttributeNS(null,"fill",g),e.innerHTML=a.label,e.textContent=a.label,e},update:function(a,b,c){var d=c("prefix")||"",e=a[d+"size"],f="fixed"===c("labelSize")?c("defaultLabelSize"):c("labelSizeRatio")*e;if((c("forceLabels")||!(e<c("labelThreshold")))&&"string"==typeof a.label)return b.setAttributeNS(null,"x",Math.round(a[d+"x"]+e+3)),b.setAttributeNS(null,"y",Math.round(a[d+"y"]+f/3)),b.style.display="",this}}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.svg.hovers"),sigma.svg.hovers.def={create:function(a,b,c,d){var e,f,g,h=(d("hoverFontStyle")||d("fontStyle"),d("prefix")||""),i=a[h+"size"],j="fixed"===d("labelSize")?d("defaultLabelSize"):d("labelSizeRatio")*i,k="node"===d("labelHoverColor")?a.color||d("defaultNodeColor"):d("defaultLabelHoverColor"),l=document.createElementNS(d("xmlns"),"g"),m=document.createElementNS(d("xmlns"),"rect"),n=document.createElementNS(d("xmlns"),"circle"),o=document.createElementNS(d("xmlns"),"text");return l.setAttributeNS(null,"class",d("classPrefix")+"-hover"),l.setAttributeNS(null,"data-node-id",a.id),"string"==typeof a.label&&(o.innerHTML=a.label,o.textContent=a.label,o.setAttributeNS(null,"class",d("classPrefix")+"-hover-label"),o.setAttributeNS(null,"font-size",j),o.setAttributeNS(null,"font-family",d("font")),o.setAttributeNS(null,"fill",k),o.setAttributeNS(null,"x",Math.round(a[h+"x"]+i+3)),o.setAttributeNS(null,"y",Math.round(a[h+"y"]+j/3)),Math.round(a[h+"x"]-j/2-2),Math.round(a[h+"y"]-j/2-2),e=Math.round(c.measureText(a.label).width+j/2+i+9),f=Math.round(j+4),g=Math.round(j/2+2),n.setAttributeNS(null,"class",d("classPrefix")+"-hover-area"),n.setAttributeNS(null,"fill","#fff"),n.setAttributeNS(null,"cx",a[h+"x"]),n.setAttributeNS(null,"cy",a[h+"y"]),n.setAttributeNS(null,"r",g),m.setAttributeNS(null,"class",d("classPrefix")+"-hover-area"),m.setAttributeNS(null,"fill","#fff"),m.setAttributeNS(null,"x",a[h+"x"]+g/4),m.setAttributeNS(null,"y",a[h+"y"]-g),m.setAttributeNS(null,"width",e),m.setAttributeNS(null,"height",f)),l.appendChild(n),l.appendChild(m),l.appendChild(o),l.appendChild(b),l}}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.middlewares"),sigma.utils.pkg("sigma.utils"),sigma.middlewares.rescale=function(a,b,c){var d,e,f,g,h,i,j,k,l=this.graph.nodes(),m=this.graph.edges(),n=this.settings.embedObjects(c||{}),o=n("bounds")||sigma.utils.getBoundaries(this.graph,a,!0),p=o.minX,q=o.minY,r=o.maxX,s=o.maxY,t=o.sizeMax,u=o.weightMax,v=n("width")||1,w=n("height")||1,x=n("autoRescale"),y={nodePosition:1,nodeSize:1,edgeSize:1};for(x instanceof Array||(x=["nodePosition","nodeSize","edgeSize"]),d=0,e=x.length;d<e;d++)if(!y[x[d]])throw new Error('The rescale setting "'+x[d]+'" is not recognized.');var z=~x.indexOf("nodePosition"),A=~x.indexOf("nodeSize"),B=~x.indexOf("edgeSize");for(j="outside"===n("scalingMode")?Math.max(v/Math.max(r-p,1),w/Math.max(s-q,1)):Math.min(v/Math.max(r-p,1),w/Math.max(s-q,1)),k=(n("rescaleIgnoreSize")?0:(n("maxNodeSize")||t)/j)+(n("sideMargin")||0),r+=k,p-=k,s+=k,q-=k,j="outside"===n("scalingMode")?Math.max(v/Math.max(r-p,1),w/Math.max(s-q,1)):Math.min(v/Math.max(r-p,1),w/Math.max(s-q,1)),n("maxNodeSize")||n("minNodeSize")?n("maxNodeSize")===n("minNodeSize")?(f=0,g=+n("maxNodeSize")):(f=(n("maxNodeSize")-n("minNodeSize"))/t,g=+n("minNodeSize")):(f=1,g=0),n("maxEdgeSize")||n("minEdgeSize")?n("maxEdgeSize")===n("minEdgeSize")?(h=0,i=+n("minEdgeSize")):(h=(n("maxEdgeSize")-n("minEdgeSize"))/u,i=+n("minEdgeSize")):(h=1,i=0),d=0,e=m.length;d<e;d++)m[d][b+"size"]=m[d][a+"size"]*(B?h:1)+(B?i:0);for(d=0,e=l.length;d<e;d++)l[d][b+"size"]=l[d][a+"size"]*(A?f:1)+(A?g:0),l[d][b+"x"]=(l[d][a+"x"]-(r+p)/2)*(z?j:1),l[d][b+"y"]=(l[d][a+"y"]-(s+q)/2)*(z?j:1)},sigma.utils.getBoundaries=function(a,b,c){var d,e,f=a.edges(),g=a.nodes(),h=-1/0,i=-1/0,j=1/0,k=1/0,l=-1/0,m=-1/0;if(c)for(d=0,e=f.length;d<e;d++)h=Math.max(f[d][b+"size"],h);for(d=0,e=g.length;d<e;d++)i=Math.max(g[d][b+"size"],i),l=Math.max(g[d][b+"x"],l),j=Math.min(g[d][b+"x"],j),m=Math.max(g[d][b+"y"],m),k=Math.min(g[d][b+"y"],k);return h=h||1,i=i||1,{weightMax:h,sizeMax:i,minX:j,minY:k,maxX:l,maxY:m}}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.middlewares"),sigma.middlewares.copy=function(a,b){var c,d,e;if(b+""!=a+""){for(e=this.graph.nodes(),c=0,d=e.length;c<d;c++)e[c][b+"x"]=e[c][a+"x"],e[c][b+"y"]=e[c][a+"y"],e[c][b+"size"]=e[c][a+"size"];for(e=this.graph.edges(),c=0,d=e.length;c<d;c++)e[c][b+"size"]=e[c][a+"size"]}}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.misc.animation.running");var b=function(){var a=0;return function(){return""+ ++a}}();sigma.misc.animation.camera=function(c,d,e){if(!(c instanceof sigma.classes.camera&&"object"==typeof d&&d))throw"animation.camera: Wrong arguments.";if("number"!=typeof d.x&&"number"!=typeof d.y&&"number"!=typeof d.ratio&&"number"!=typeof d.angle)throw"There must be at least one valid coordinate in the given val.";var f,g,h,i,j,k=e||{},l=sigma.utils.dateNow();return j={x:c.x,y:c.y,ratio:c.ratio,angle:c.angle},k.duration,i="function"!=typeof k.easing?sigma.utils.easings[k.easing||"quadraticInOut"]:k.easing,f=function(){var b,e=k.duration?(sigma.utils.dateNow()-l)/k.duration:1;e>=1?(c.isAnimated=!1,c.goTo({x:d.x!==a?d.x:j.x,y:d.y!==a?d.y:j.y,ratio:d.ratio!==a?d.ratio:j.ratio,angle:d.angle!==a?d.angle:j.angle}),cancelAnimationFrame(g),delete sigma.misc.animation.running[g],"function"==typeof k.onComplete&&k.onComplete()):(b=i(e),c.isAnimated=!0,c.goTo({x:d.x!==a?j.x+(d.x-j.x)*b:j.x,y:d.y!==a?j.y+(d.y-j.y)*b:j.y,ratio:d.ratio!==a?j.ratio+(d.ratio-j.ratio)*b:j.ratio,angle:d.angle!==a?j.angle+(d.angle-j.angle)*b:j.angle}),"function"==typeof k.onNewFrame&&k.onNewFrame(),h.frameId=requestAnimationFrame(f))},g=b(),h={frameId:requestAnimationFrame(f),target:c,type:"camera",options:k,fn:f},sigma.misc.animation.running[g]=h,g},sigma.misc.animation.kill=function(a){if(1!==arguments.length||"number"!=typeof a)throw"animation.kill: Wrong arguments.";var b=sigma.misc.animation.running[a];return b&&(cancelAnimationFrame(a),delete sigma.misc.animation.running[b.frameId],"camera"===b.type&&(b.target.isAnimated=!1),"function"==typeof(b.options||{}).onComplete&&b.options.onComplete()),this},sigma.misc.animation.killAll=function(a){var b,c,d=0,e="string"==typeof a?a:null,f="object"==typeof a?a:null,g=sigma.misc.animation.running;for(c in g)e&&g[c].type!==e||f&&g[c].target!==f||(b=sigma.misc.animation.running[c],cancelAnimationFrame(b.frameId),delete sigma.misc.animation.running[c],"camera"===b.type&&(b.target.isAnimated=!1),d++,"function"==typeof(b.options||{}).onComplete&&b.options.onComplete());return d},sigma.misc.animation.has=function(a){var b,c="string"==typeof a?a:null,d="object"==typeof a?a:null,e=sigma.misc.animation.running;for(b in e)if(!(c&&e[b].type!==c||d&&e[b].target!==d))return!0;return!1}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.misc"),sigma.misc.bindEvents=function(b){function c(a){a&&(h="x"in a.data?a.data.x:h,i="y"in a.data?a.data.y:i);var c,d,e,f,g,k,l,m,n=[],o=h+j.width/2,p=i+j.height/2,q=j.camera.cameraPosition(h,i),r=j.camera.quadtree.point(q.x,q.y);if(r.length)for(c=0,e=r.length;c<e;c++)if(f=r[c],g=f[b+"x"],k=f[b+"y"],l=f[b+"size"],!f.hidden&&o>g-l&&o<g+l&&p>k-l&&p<k+l&&Math.sqrt(Math.pow(o-g,2)+Math.pow(p-k,2))<l){for(m=!1,d=0;d<n.length;d++)if(f.size>n[d].size){n.splice(d,0,f),m=!0;break}m||n.push(f)}return n}function d(c){function d(a,b){for(r=!1,g=0;g<a.length;g++)if(b.size>a[g].size){a.splice(g,0,b),r=!0;break}r||a.push(b)}if(!j.settings("enableEdgeHovering"))return[];var e=sigma.renderers.canvas&&j instanceof sigma.renderers.canvas;if(!e)throw new Error("The edge events feature is not compatible with the WebGL renderer");c&&(h="x"in c.data?c.data.x:h,i="y"in c.data?c.data.y:i);var f,g,k,l,m,n,o,p,q,r,s=j.settings("edgeHoverPrecision"),t={},u=[],v=h+j.width/2,w=i+j.height/2,x=j.camera.cameraPosition(h,i),y=[];if(e){var z=j.camera.quadtree.area(j.camera.getRectangle(j.width,j.height));for(l=z,f=0,k=l.length;f<k;f++)t[l[f].id]=l[f]}if(j.camera.edgequadtree!==a&&(y=j.camera.edgequadtree.point(x.x,x.y)),y.length)for(f=0,k=y.length;f<k;f++)m=y[f],o=j.graph.nodes(m.source),p=j.graph.nodes(m.target),n=m[b+"size"]||m["read_"+b+"size"],!m.hidden&&!o.hidden&&!p.hidden&&(!e||t[m.source]||t[m.target])&&sigma.utils.getDistance(o[b+"x"],o[b+"y"],v,w)>o[b+"size"]&&sigma.utils.getDistance(p[b+"x"],p[b+"y"],v,w)>p[b+"size"]&&("curve"==m.type||"curvedArrow"==m.type?o.id===p.id?(q=sigma.utils.getSelfLoopControlPoints(o[b+"x"],o[b+"y"],o[b+"size"]),sigma.utils.isPointOnBezierCurve(v,w,o[b+"x"],o[b+"y"],p[b+"x"],p[b+"y"],q.x1,q.y1,q.x2,q.y2,Math.max(n,s))&&d(u,m)):(q=sigma.utils.getQuadraticControlPoint(o[b+"x"],o[b+"y"],p[b+"x"],p[b+"y"]),sigma.utils.isPointOnQuadraticCurve(v,w,o[b+"x"],o[b+"y"],p[b+"x"],p[b+"y"],q.x,q.y,Math.max(n,s))&&d(u,m)):sigma.utils.isPointOnSegment(v,w,o[b+"x"],o[b+"y"],p[b+"x"],p[b+"y"],Math.max(n,s))&&d(u,m));return u}function e(a){function b(a){j.settings("eventsEnabled")&&(j.dispatchEvent("click",a.data),i=c(a),k=d(a),i.length?(j.dispatchEvent("clickNode",{node:i[0],captor:a.data}),j.dispatchEvent("clickNodes",{node:i,captor:a.data})):k.length?(j.dispatchEvent("clickEdge",{edge:k[0],captor:a.data}),j.dispatchEvent("clickEdges",{edge:k,captor:a.data})):j.dispatchEvent("clickStage",{captor:a.data}))}function e(a){j.settings("eventsEnabled")&&(j.dispatchEvent("doubleClick",a.data),i=c(a),k=d(a),i.length?(j.dispatchEvent("doubleClickNode",{node:i[0],captor:a.data}),j.dispatchEvent("doubleClickNodes",{node:i,captor:a.data})):k.length?(j.dispatchEvent("doubleClickEdge",{edge:k[0],captor:a.data}),j.dispatchEvent("doubleClickEdges",{edge:k,captor:a.data})):j.dispatchEvent("doubleClickStage",{captor:a.data}))}function f(a){j.settings("eventsEnabled")&&(j.dispatchEvent("rightClick",a.data),i=c(a),k=d(a),i.length?(j.dispatchEvent("rightClickNode",{node:i[0],captor:a.data}),j.dispatchEvent("rightClickNodes",{node:i,captor:a.data})):k.length?(j.dispatchEvent("rightClickEdge",{edge:k[0],captor:a.data}),j.dispatchEvent("rightClickEdges",{edge:k,captor:a.data})):j.dispatchEvent("rightClickStage",{captor:a.data}))}function g(a){if(j.settings("eventsEnabled")){var b,c,d,e,f=[],g=[];for(b in l)f.push(l[b]);for(l={},c=0,d=f.length;c<d;c++)j.dispatchEvent("outNode",{node:f[c],captor:a.data});for(f.length&&j.dispatchEvent("outNodes",{nodes:f,captor:a.data}),m={},c=0,e=g.length;c<e;c++)j.dispatchEvent("outEdge",{edge:g[c],captor:a.data});g.length&&j.dispatchEvent("outEdges",{edges:g,captor:a.data})}}function h(a){if(j.settings("eventsEnabled")){i=c(a),k=d(a);var b,e,f,g,h=[],n=[],o={},p=i.length,q=[],r=[],s={},t=k.length;for(b=0;b<p;b++)f=i[b],o[f.id]=f,l[f.id]||(n.push(f),l[f.id]=f);for(e in l)o[e]||(h.push(l[e]),delete l[e]);for(b=0,p=n.length;b<p;b++)j.dispatchEvent("overNode",{node:n[b],captor:a.data});for(b=0,p=h.length;b<p;b++)j.dispatchEvent("outNode",{node:h[b],captor:a.data});for(n.length&&j.dispatchEvent("overNodes",{nodes:n,captor:a.data}),h.length&&j.dispatchEvent("outNodes",{nodes:h,captor:a.data}),b=0;b<t;b++)g=k[b],s[g.id]=g,m[g.id]||(r.push(g),m[g.id]=g);for(e in m)s[e]||(q.push(m[e]),delete m[e]);for(b=0,t=r.length;b<t;b++)j.dispatchEvent("overEdge",{edge:r[b],captor:a.data});for(b=0,t=q.length;b<t;b++)j.dispatchEvent("outEdge",{edge:q[b],captor:a.data});r.length&&j.dispatchEvent("overEdges",{edges:r,captor:a.data}),q.length&&j.dispatchEvent("outEdges",{edges:q,captor:a.data})}}var i,k,l={},m={};a.bind("click",b),a.bind("mousedown",h),a.bind("mouseup",h),a.bind("mousemove",h),a.bind("mouseout",g),a.bind("doubleclick",e),a.bind("rightclick",f),j.bind("render",h)}var f,g,h,i,j=this;for(f=0,g=this.captors.length;f<g;f++)e(this.captors[f])}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.misc"),sigma.misc.bindDOMEvents=function(a){function b(a){this.attr=function(b){return a.getAttributeNS(null,b)},this.tag=a.tagName,this.class=this.attr("class"),this.id=this.attr("id"),this.isNode=function(){return!!~this.class.indexOf(g.settings("classPrefix")+"-node")},this.isEdge=function(){return!!~this.class.indexOf(g.settings("classPrefix")+"-edge")},this.isHover=function(){return!!~this.class.indexOf(g.settings("classPrefix")+"-hover")}}function c(a){if(g.settings("eventsEnabled")){g.dispatchEvent("click",a);var c=new b(a.target);c.isNode()?g.dispatchEvent("clickNode",{node:h.nodes(c.attr("data-node-id"))}):g.dispatchEvent("clickStage"),a.preventDefault(),a.stopPropagation()}}function d(a){if(g.settings("eventsEnabled")){g.dispatchEvent("doubleClick",a);var c=new b(a.target);c.isNode()?g.dispatchEvent("doubleClickNode",{node:h.nodes(c.attr("data-node-id"))}):g.dispatchEvent("doubleClickStage"),a.preventDefault(),a.stopPropagation()}}function e(a){var c=a.toElement||a.target;if(g.settings("eventsEnabled")&&c){var d=new b(c);if(d.isNode())g.dispatchEvent("overNode",{node:h.nodes(d.attr("data-node-id"))});else if(d.isEdge()){var e=h.edges(d.attr("data-edge-id"));g.dispatchEvent("overEdge",{edge:e,source:h.nodes(e.source),target:h.nodes(e.target)})}}}function f(a){var c=a.fromElement||a.originalTarget;if(g.settings("eventsEnabled")){var d=new b(c);if(d.isNode())g.dispatchEvent("outNode",{node:h.nodes(d.attr("data-node-id"))});else if(d.isEdge()){var e=h.edges(d.attr("data-edge-id"));g.dispatchEvent("outEdge",{edge:e,source:h.nodes(e.source),target:h.nodes(e.target)})}}}var g=this,h=this.graph;a.addEventListener("click",c,!1),sigma.utils.doubleClick(a,"click",d),a.addEventListener("touchstart",c,!1),sigma.utils.doubleClick(a,"touchstart",d),a.addEventListener("mouseover",e,!0),a.addEventListener("mouseout",f,!0)}}.call(this),function(a){"use strict";if("undefined"==typeof sigma)throw"sigma is not declared";sigma.utils.pkg("sigma.misc"),sigma.misc.drawHovers=function(a){function b(){var b,f,g,h,i,j=c.contexts.hover.canvas,k=c.settings("defaultNodeType"),l=c.settings("defaultEdgeType"),m=sigma.canvas.hovers,n=sigma.canvas.edgehovers,o=sigma.canvas.extremities,p=c.settings.embedObjects({prefix:a});if(c.contexts.hover.clearRect(0,0,j.width,j.height),p("enableHovering")&&p("singleHover")&&Object.keys(d).length&&(h=d[Object.keys(d)[0]],(m[h.type]||m[k]||m.def)(h,c.contexts.hover,p)),p("enableHovering")&&!p("singleHover"))for(b in d)(m[d[b].type]||m[k]||m.def)(d[b],c.contexts.hover,p);if(p("enableEdgeHovering")&&p("singleHover")&&Object.keys(e).length&&(i=e[Object.keys(e)[0]],f=c.graph.nodes(i.source),g=c.graph.nodes(i.target),i.hidden||((n[i.type]||n[l]||n.def)(i,f,g,c.contexts.hover,p),p("edgeHoverExtremities")?(o[i.type]||o.def)(i,f,g,c.contexts.hover,p):((sigma.canvas.nodes[f.type]||sigma.canvas.nodes.def)(f,c.contexts.hover,p),(sigma.canvas.nodes[g.type]||sigma.canvas.nodes.def)(g,c.contexts.hover,p)))),p("enableEdgeHovering")&&!p("singleHover"))for(b in e)i=e[b],f=c.graph.nodes(i.source),g=c.graph.nodes(i.target),i.hidden||((n[i.type]||n[l]||n.def)(i,f,g,c.contexts.hover,p),p("edgeHoverExtremities")?(o[i.type]||o.def)(i,f,g,c.contexts.hover,p):((sigma.canvas.nodes[f.type]||sigma.canvas.nodes.def)(f,c.contexts.hover,p),(sigma.canvas.nodes[g.type]||sigma.canvas.nodes.def)(g,c.contexts.hover,p)))}var c=this,d={},e={};this.bind("overNode",function(a){var c=a.data.node;c.hidden||(d[c.id]=c,b())}),this.bind("outNode",function(a){delete d[a.data.node.id],b()}),this.bind("overEdge",function(a){var c=a.data.edge;c.hidden||(e[c.id]=c,b())}),this.bind("outEdge",function(a){delete e[a.data.edge.id],b()}),this.bind("render",function(a){b()})}}.call(this);\ No newline at end of filediff --git a/spiderfoot/static/package.json b/spiderfoot/static/package.jsonnew file mode 100644index 00000000..59ca0a8c--- /dev/null+++ b/spiderfoot/static/package.json@@ -0,0 +1,8 @@+{+ "dependencies": {+ "alertifyjs": "^1.13.1",+ "bootstrap": "^3.4.1",+ "jquery": "^3.6.0",+ "sigma": "^1.2.1"+ }+}diff --git a/spiderfoot/templates/HEADER.tmpl b/spiderfoot/templates/HEADER.tmplindex af0245e8..d111b450 100644--- a/spiderfoot/templates/HEADER.tmpl+++ b/spiderfoot/templates/HEADER.tmpl@@ -12,8 +12,8 @@<script type='text/javascript' src='${docroot}/static/js/viz.js'></script><link href="${docroot}/static/css/spiderfoot.css" rel="stylesheet">- <link href="${docroot}/static/css/bootstrap.min.css" rel="stylesheet">- <link href="${docroot}/static/css/alertify.min.css" rel="stylesheet">+ <link href="${docroot}/static/node_modules/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">+ <link href="${docroot}/static/node_modules/alertifyjs/build/css/alertify.min.css" rel="stylesheet"><script>@@ -118,9 +118,9 @@ class="nav-item"><a href="${docroot}/opts" class="nav-link"><i class="glyphicon<!-- Placed at the end of the document so the pages load faster --><script>var docroot = '${docroot}';</script>- <script src="${docroot}/static/js/jquery.min.js"></script>- <script src="${docroot}/static/js/bootstrap.min.js"></script>- <script src="${docroot}/static/js/alertify.min.js"></script>+ <script src="${docroot}/static/node_modules/jquery/dist/jquery.min.js"></script>+ <script src="${docroot}/static/node_modules/bootstrap/dist/js/bootstrap.min.js"></script>+ <script src="${docroot}/static/node_modules/alertifyjs/build/alertify.min.js"></script><script src="${docroot}/static/js/jquery.tablesorter.min.js"></script><script src='${docroot}/static/js/jquery.tablesorter.pager.min.js'></script><script src="${docroot}/static/js/d3.min.js"></script>diff --git a/spiderfoot/templates/scaninfo.tmpl b/spiderfoot/templates/scaninfo.tmplindex bfa958d8..e401c0d0 100644--- a/spiderfoot/templates/scaninfo.tmpl+++ b/spiderfoot/templates/scaninfo.tmpl@@ -59,11 +59,11 @@</ul></div></div>- <script src="${docroot}/static/js/sigma.min.js"></script>- <script src="${docroot}/static/js/sigma.parsers.json.min.js"></script>- <script src="${docroot}/static/js/sigma.plugins.dragNodes.min.js"></script>- <script src="${docroot}/static/js/sigma.layout.forceAtlas2.min.js"></script>- <script src="${docroot}/static/js/sigma.renderers.snapshot.min.js"></script>+ <script src="${docroot}/static/node_modules/sigma/build/sigma.min.js"></script>+ <script src="${docroot}/static/node_modules/sigma/build/plugins/sigma.parsers.json.min.js"></script>+ <script src="${docroot}/static/node_modules/sigma/build/plugins/sigma.plugins.dragNodes.min.js"></script>+ <script src="${docroot}/static/node_modules/sigma/build/plugins/sigma.layout.forceAtlas2.min.js"></script>+ <script src="${docroot}/static/node_modules/sigma/build/plugins/sigma.renderers.snapshot.min.js"></script><script type='text/javascript'>var currentType = "ALL";var currentTypeName = "All";