Added texture
authorveltr
Tue, 07 May 2013 18:19:28 +0200
changeset 67 cff3bbe9e539
parent 66 a77532772aa4
child 68 308c6ad11eab
Added texture
integ/iri-buzz.html
integ/iri/css/iri-buzz.css
integ/iri/js/iri-buzz.js
integ/iri/js/vs.0.1-min.js
--- a/integ/iri-buzz.html	Tue May 07 11:35:47 2013 +0200
+++ b/integ/iri-buzz.html	Tue May 07 18:19:28 2013 +0200
@@ -56,6 +56,12 @@
 
 				<div class="timeline-head clearfix">
 					<div class="timeline-head-wrap">
+						<a href="#" class="control-button restart" title="Rejouer">
+                            <i></i>
+                        </a>
+                        <a href="#" class="control-button play-pause pause" title="Pause">
+                            <i></i>
+                        </a>
 						<div class="timer-wrap clearfix">
 							<div class="timer-bar">
 								<div class="timer-bar-value"></div>
@@ -63,16 +69,12 @@
 								</ul>
 							</div>
 						</div>
-						<a href="#" class="control-button restart" title="Rejouer">
-                            <i></i>
-                        </a>
-                        <a href="#" class="control-button play-pause pause" title="Pause">
-                            <i></i>
-                        </a>
 					</div>
 				</div>
 
-				<div id="data-viz">Chargement de la liste de films</div>
+				<div id="data-viz">
+				    <h3>Chargement de la liste de films</h3>
+			    </div>
 				<ul class="posters clearfix"></ul>
 				
 			</div>
--- a/integ/iri/css/iri-buzz.css	Tue May 07 11:35:47 2013 +0200
+++ b/integ/iri/css/iri-buzz.css	Tue May 07 18:19:28 2013 +0200
@@ -13,7 +13,8 @@
 }
 .timer-wrap {
     float: left;
-    margin-right: 24px;
+    margin-left: 24px;
+    margin-top: 2px;
 }
 .timer-bar {
     width: 500px;
@@ -54,7 +55,7 @@
 
 .control-button {
     float: left;
-    margin-left: 12px;
+    margin-right: 12px;
     height: 17px;
     padding: 8px 9px;
     display: inline-block;
@@ -162,8 +163,11 @@
 
 #data-viz {
     padding-top: 50px;
+}
+
+#data-viz h3 {
+    padding-left: 50px;
     line-height: 50px;
-    text-align: center;
     color: #909090;
     font-weight: bold;
     font-size: 40px;
--- a/integ/iri/js/iri-buzz.js	Tue May 07 11:35:47 2013 +0200
+++ b/integ/iri/js/iri-buzz.js	Tue May 07 18:19:28 2013 +0200
@@ -16,7 +16,7 @@
     opinionsPerPage: 100,
     colors: [ "#f62a43", "#f3c000", "#2d9252"],
     borderColors: [ "#f7788e", "#fdde83", "#3bb767" ],
-    stripeColors: [ "#c92238", "#c79e03", "#237844" ],
+    imageUrlBase: 'iri/img/',
     refreshRate: .25 * SECONDS,
     columnSpacing: 40,
     columnWidth: 150,
@@ -40,22 +40,14 @@
     
     // Add Patterns
     var xml = '<svg style="position: absolute;" width="1" height="1"><defs>'
-        + config.colors.map(function(color, i) {
+        + _.range(3).map(function(i) {
             return '<pattern id="pattern_'
                 + i
-                + '" x="0" y="0" width="3" height="3" patternUnits="userSpaceOnUse"><rect x="0" y="0" width="3" height="3" fill="'
-                + color
-                + '" />'
-                + _.range(3).map(function(n) {
-                    return '<rect x="'
-                        + n
-                        + '" y="'
-                        + n
-                        + '" width="1" height="1" fill="'
-                        + config.stripeColors[i]
-                        + '" />'
-                }).join("")
-                + '</pattern>';
+                + '" x="0" y="0" width="3" height="3" patternUnits="userSpaceOnUse"><image x="0" y="0" width="3" height="3" xlink:href="'
+                + config.imageUrlBase
+                + 'pattern-'
+                + i
+                + '.png" /></pattern>';
         }).join("")
         + '</defs></svg>';
     $("body").append(xml);
@@ -167,21 +159,35 @@
         + '<div class="comment-arrow"></div>'
     );
     
+    var barChart = undefined;
+    
     function startViz() {
         
-        var barChart = undefined;
+        $("#comment").hide();
+        
+        console.log("Start Viz");
         
+        if (typeof barChart !== "undefined") {
+            console.log("Bar Chart exists");
+            barChart.selectAll("state",1).forEach(function(t) {
+                t.flocculate();
+            });
+        }
+        
+        
+        paused = true;
         timeAtPause = 0;
         
         opinions.sort(function(a,b) {
             return a._timestamp > b._timestamp;
         });
-        $("#data-viz").html("").css("text-align","left");
+        $("#data-viz").html("");
         
         var lastShownToken = null,
             maxData = Math.max.apply(Math, movies.map(function(m) { return m.opinions.length; })),
             aggrHeight = vsHeight - 80,
-            aggrScale = aggrHeight / maxData;
+            aggrScale = aggrHeight / maxData,
+            firstStrataCall = true;
         
         var barChartSettings = {
             width : vsWidth,
@@ -201,16 +207,18 @@
                     };
                 }),
                 strata : function() {
-                    if (typeof barChart === "undefined") {
-                        var flocculated = [];
-                        _.range(3).map(function(colorId) {
-                            $(".layer_"+colorId).css({
-                                fill: "url(#pattern_" +colorId + ")",
-                                stroke: config.borderColors[colorId]
+                    var flocculated = (typeof barChart === "undefined" ? [] : barChart.selectAll("state",2) );
+                    
+                    if (firstStrataCall) {
+                        _.defer(function() {
+                            _.range(3).map(function(colorId) {
+                                $(".layer_"+colorId).css({
+                                    fill: "url(#pattern_" +colorId + ")",
+                                    stroke: config.borderColors[colorId]
+                                });
                             });
                         });
-                    } else {
-                        var flocculated = barChart.selectAll("state",2);
+                        firstStrataCall = false;
                     }
                     
                     var res = movies.map(function(movie, i) {
@@ -284,7 +292,7 @@
         
         //console.log(barChartSettings);
         
-        var barChart = $("#data-viz").vs(barChartSettings).data('visualSedimentation');
+        barChart = $("#data-viz").vs(barChartSettings).data('visualSedimentation');
         
         barChart.world.SetGravity(new barChart.phy.b2Vec2(0,10 * config.fallSpeed));
         
@@ -318,7 +326,7 @@
                     viztime: opinion._viztime,
                     movie: opinion._movie,
                     colorId: opinion._colorId,
-                    fillStyle: config.colors[opinion._colorId],
+                    //fillStyle: config.colors[opinion._colorId],
                     avatar: opinion._avatar,
                     username: opinion.actor.user.userName,
                     actiontype: opinion.action.type,
@@ -326,6 +334,9 @@
                     content: opinion._content.replace(/(^.{320,340})[\s].+$/,'$1…'),
                     //size: 30,
                     strokeStyle: config.borderColors[opinion._colorId],
+                    texture: {
+                        src: config.imageUrlBase + 'pattern-' + opinion._colorId + '.png'
+                    },
                     shape:{
                       type:'box',
                       width: config.columnWidth / 2 - 1,
@@ -393,7 +404,7 @@
                 });
                 movie.opinions = movie.opinions.concat(tokens);
                 opinions = opinions.concat(tokens);
-                $("#data-viz").append(".");
+                $("#data-viz h3").append(".");
                 if (tokens.length === tokcount) {
                     console.log("Page " + movie.opinionPage + " of '" + movie.title + "' loaded");
                     movie.opinionPage ++;
@@ -439,7 +450,7 @@
             refresh: refreshtoken()
         },
         function(d) {
-            $("#data-viz").html("Chargement des flux d'opinions<br />");
+            $("#data-viz h3").html("Chargement des flux d'opinions<br />");
             console.log("Movie List Loaded");
             tzDelta = .5 * HOURS * Math.round((Date.parse(d.feed.updated) - loadTime) / (.5 * HOURS));
             tzSuffix = d.feed.updated.replace(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/,'');
@@ -538,7 +549,7 @@
                 left: e.pageX,
                 top: e.pageY + 2
             })
-            .attr("className", (e.pageX < $(window).width() / 2 ? "left" : "right"))
+            .removeClass("left right").addClass(e.pageX < $(window).width() / 2 ? "left" : "right");
     }, 50));
 
 });
\ No newline at end of file
--- a/integ/iri/js/vs.0.1-min.js	Tue May 07 11:35:47 2013 +0200
+++ b/integ/iri/js/vs.0.1-min.js	Tue May 07 18:19:28 2013 +0200
@@ -20,29 +20,29 @@
      * Copyright 2010, The Dojo Foundation
      * Released under the MIT, BSD, and GPL Licenses.
      */
-/*! jQuery v2.0.0 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
-//@ sourceMappingURL=jquery.min.map
-*/
-(function(e,undefined){var t,n,r=typeof undefined,i=e.location,o=e.document,s=o.documentElement,a=e.jQuery,u=e.$,l={},c=[],f="2.0.0",p=c.concat,h=c.push,d=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=f.trim,x=function(e,n){return new x.fn.init(e,n,t)},b=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^-ms-/,N=/-([\da-z])/gi,E=function(e,t){return t.toUpperCase()},S=function(){o.removeEventListener("DOMContentLoaded",S,!1),e.removeEventListener("load",S,!1),x.ready()};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,t,n){var r,i;if(!e)return this;if("string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:T.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof x?t[0]:t,x.merge(this,x.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:o,!0)),C.test(r[1])&&x.isPlainObject(t))for(r in t)x.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=o.getElementById(r[2]),i&&i.parentNode&&(this.length=1,this[0]=i),this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?n.ready(e):(e.selector!==undefined&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return d.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,t,n,r,i,o,s=arguments[0]||{},a=1,u=arguments.length,l=!1;for("boolean"==typeof s&&(l=s,s=arguments[1]||{},a=2),"object"==typeof s||x.isFunction(s)||(s={}),u===a&&(s=this,--a);u>a;a++)if(null!=(e=arguments[a]))for(t in e)n=s[t],r=e[t],s!==r&&(l&&r&&(x.isPlainObject(r)||(i=x.isArray(r)))?(i?(i=!1,o=n&&x.isArray(n)?n:[]):o=n&&x.isPlainObject(n)?n:{},s[t]=x.extend(l,o,r)):r!==undefined&&(s[t]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=a),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){(e===!0?--x.readyWait:x.isReady)||(x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(o,[x]),x.fn.trigger&&x(o).trigger("ready").off("ready")))},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if("object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:JSON.parse,parseXML:function(e){var t,n;if(!e||"string"!=typeof e)return null;try{n=new DOMParser,t=n.parseFromString(e,"text/xml")}catch(r){t=undefined}return(!t||t.getElementsByTagName("parsererror").length)&&x.error("Invalid XML: "+e),t},noop:function(){},globalEval:function(e){var t,n=eval;e=x.trim(e),e&&(1===e.indexOf("use strict")?(t=o.createElement("script"),t.text=e,o.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(k,"ms-").replace(N,E)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,s=j(e);if(n){if(s){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(s){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:function(e){return null==e?"":v.call(e)},makeArray:function(e,t){var n=t||[];return null!=e&&(j(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:g.call(t,e,n)},merge:function(e,t){var n=t.length,r=e.length,i=0;if("number"==typeof n)for(;n>i;i++)e[r++]=t[i];else while(t[i]!==undefined)e[r++]=t[i++];return e.length=r,e},grep:function(e,t,n){var r,i=[],o=0,s=e.length;for(n=!!n;s>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,s=j(e),a=[];if(s)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(a[a.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(a[a.length]=r);return p.apply([],a)},guid:1,proxy:function(e,t){var n,r,i;return"string"==typeof t&&(n=e[t],t=e,e=n),x.isFunction(e)?(r=d.call(arguments,2),i=function(){return e.apply(t||this,r.concat(d.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):undefined},access:function(e,t,n,r,i,o,s){var a=0,u=e.length,l=null==n;if("object"===x.type(n)){i=!0;for(a in n)x.access(e,t,a,n[a],!0,o,s)}else if(r!==undefined&&(i=!0,x.isFunction(r)||(s=!0),l&&(s?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(x(e),n)})),t))for(;u>a;a++)t(e[a],n,s?r:r.call(e[a],a,t(e[a],n)));return i?e:l?t.call(e):u?t(e[0],n):o},now:Date.now,swap:function(e,t,n,r){var i,o,s={};for(o in t)s[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=s[o];return i}}),x.ready.promise=function(t){return n||(n=x.Deferred(),"complete"===o.readyState?setTimeout(x.ready):(o.addEventListener("DOMContentLoaded",S,!1),e.addEventListener("load",S,!1))),n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function j(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}t=x(o),function(e,undefined){var t,n,r,i,o,s,a,u,l,c,f,p,h,d,g,m,y="sizzle"+-new Date,v=e.document,b={},w=0,T=0,C=ot(),k=ot(),N=ot(),E=!1,S=function(){return 0},j=typeof undefined,D=1<<31,A=[],L=A.pop,q=A.push,H=A.push,O=A.slice,F=A.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",R="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=M.replace("w","w#"),$="\\["+R+"*("+M+")"+R+"*(?:([*^$|!~]?=)"+R+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+R+"*\\]",B=":("+M+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",I=RegExp("^"+R+"+|((?:^|[^\\\\])(?:\\\\.)*)"+R+"+$","g"),z=RegExp("^"+R+"*,"+R+"*"),_=RegExp("^"+R+"*([>+~]|"+R+")"+R+"*"),X=RegExp(R+"*[+~]"),U=RegExp("="+R+"*([^\\]'\"]*)"+R+"*\\]","g"),Y=RegExp(B),V=RegExp("^"+W+"$"),G={ID:RegExp("^#("+M+")"),CLASS:RegExp("^\\.("+M+")"),TAG:RegExp("^("+M.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+B),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+R+"*(even|odd|(([+-]|)(\\d*)n|)"+R+"*(?:([+-]|)"+R+"*(\\d+)|))"+R+"*\\)|)","i"),"boolean":RegExp("^(?:"+P+")$","i"),needsContext:RegExp("^"+R+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+R+"*((?:-\\d)?\\d*)"+R+"*\\)|)(?=[^-]|$)","i")},J=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,et=/'|\\/g,tt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,nt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{H.apply(A=O.call(v.childNodes),v.childNodes),A[v.childNodes.length].nodeType}catch(rt){H={apply:A.length?function(e,t){q.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function it(e){return J.test(e+"")}function ot(){var e,t=[];return e=function(n,i){return t.push(n+=" ")>r.cacheLength&&delete e[t.shift()],e[n]=i}}function st(e){return e[y]=!0,e}function at(e){var t=c.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ut(e,t,n,r){var i,o,s,a,u,f,d,g,x,w;if((t?t.ownerDocument||t:v)!==c&&l(t),t=t||c,n=n||[],!e||"string"!=typeof e)return n;if(1!==(a=t.nodeType)&&9!==a)return[];if(p&&!r){if(i=Q.exec(e))if(s=i[1]){if(9===a){if(o=t.getElementById(s),!o||!o.parentNode)return n;if(o.id===s)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(s))&&m(t,o)&&o.id===s)return n.push(o),n}else{if(i[2])return H.apply(n,t.getElementsByTagName(e)),n;if((s=i[3])&&b.getElementsByClassName&&t.getElementsByClassName)return H.apply(n,t.getElementsByClassName(s)),n}if(b.qsa&&(!h||!h.test(e))){if(g=d=y,x=t,w=9===a&&e,1===a&&"object"!==t.nodeName.toLowerCase()){f=gt(e),(d=t.getAttribute("id"))?g=d.replace(et,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=f.length;while(u--)f[u]=g+mt(f[u]);x=X.test(e)&&t.parentNode||t,w=f.join(",")}if(w)try{return H.apply(n,x.querySelectorAll(w)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(I,"$1"),t,n,r)}o=ut.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},l=ut.setDocument=function(e){var t=e?e.ownerDocument||e:v;return t!==c&&9===t.nodeType&&t.documentElement?(c=t,f=t.documentElement,p=!o(t),b.getElementsByTagName=at(function(e){return e.appendChild(t.createComment("")),!e.getElementsByTagName("*").length}),b.attributes=at(function(e){return e.className="i",!e.getAttribute("className")}),b.getElementsByClassName=at(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),b.sortDetached=at(function(e){return 1&e.compareDocumentPosition(c.createElement("div"))}),b.getById=at(function(e){return f.appendChild(e).id=y,!t.getElementsByName||!t.getElementsByName(y).length}),b.getById?(r.find.ID=function(e,t){if(typeof t.getElementById!==j&&p){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},r.filter.ID=function(e){var t=e.replace(tt,nt);return function(e){return e.getAttribute("id")===t}}):(r.find.ID=function(e,t){if(typeof t.getElementById!==j&&p){var n=t.getElementById(e);return n?n.id===e||typeof n.getAttributeNode!==j&&n.getAttributeNode("id").value===e?[n]:undefined:[]}},r.filter.ID=function(e){var t=e.replace(tt,nt);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),r.find.TAG=b.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==j?t.getElementsByTagName(e):undefined}: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},r.find.CLASS=b.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==j&&p?t.getElementsByClassName(e):undefined},d=[],h=[],(b.qsa=it(t.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+R+"*(?:value|"+P+")"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){var t=c.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&h.push("[*^$]="+R+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(b.matchesSelector=it(g=f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){b.disconnectedMatch=g.call(e,"div"),g.call(e,"[s!='']:x"),d.push("!=",B)}),h=h.length&&RegExp(h.join("|")),d=d.length&&RegExp(d.join("|")),m=it(f.contains)||f.compareDocumentPosition?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},S=f.compareDocumentPosition?function(e,n){if(e===n)return E=!0,0;var r=n.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(n);return r?1&r||!b.sortDetached&&n.compareDocumentPosition(e)===r?e===t||m(v,e)?-1:n===t||m(v,n)?1:u?F.call(u,e)-F.call(u,n):0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,n){var r,i=0,o=e.parentNode,s=n.parentNode,a=[e],l=[n];if(e===n)return E=!0,0;if(!o||!s)return e===t?-1:n===t?1:o?-1:s?1:u?F.call(u,e)-F.call(u,n):0;if(o===s)return lt(e,n);r=e;while(r=r.parentNode)a.unshift(r);r=n;while(r=r.parentNode)l.unshift(r);while(a[i]===l[i])i++;return i?lt(a[i],l[i]):a[i]===v?-1:l[i]===v?1:0},c):c},ut.matches=function(e,t){return ut(e,null,null,t)},ut.matchesSelector=function(e,t){if((e.ownerDocument||e)!==c&&l(e),t=t.replace(U,"='$1']"),!(!b.matchesSelector||!p||d&&d.test(t)||h&&h.test(t)))try{var n=g.call(e,t);if(n||b.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return ut(t,c,null,[e]).length>0},ut.contains=function(e,t){return(e.ownerDocument||e)!==c&&l(e),m(e,t)},ut.attr=function(e,t){(e.ownerDocument||e)!==c&&l(e);var n=r.attrHandle[t.toLowerCase()],i=n&&n(e,t,!p);return i===undefined?b.attributes||!p?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null:i},ut.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},ut.uniqueSort=function(e){var t,n=[],r=0,i=0;if(E=!b.detectDuplicates,u=!b.sortStable&&e.slice(0),e.sort(S),E){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return e};function lt(e,t){var n=t&&e,r=n&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ct(e,t,n){var r;return n?undefined:(r=e.getAttributeNode(t))&&r.specified?r.value:e[t]===!0?t.toLowerCase():null}function ft(e,t,n){var r;return n?undefined:r=e.getAttribute(t,"type"===t.toLowerCase()?1:2)}function pt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ht(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function dt(e){return st(function(t){return t=+t,st(function(n,r){var i,o=e([],n.length,t),s=o.length;while(s--)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}i=ut.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r];r++)n+=i(t);return n},r=ut.selectors={cacheLength:50,createPseudo:st,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(tt,nt),e[3]=(e[4]||e[5]||"").replace(tt,nt),"~="===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]||ut.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]&&ut.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return G.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&Y.test(n)&&(t=gt(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(tt,nt).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=C[e+" "];return t||(t=RegExp("(^|"+R+")"+e+"("+R+"|$)"))&&C(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ut.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,h,d,g=o!==s?"nextSibling":"previousSibling",m=t.parentNode,v=a&&t.nodeName.toLowerCase(),x=!u&&!a;if(m){if(o){while(g){f=t;while(f=f[g])if(a?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;d=g="only"===e&&!d&&"nextSibling"}return!0}if(d=[s?m.firstChild:m.lastChild],s&&x){c=m[y]||(m[y]={}),l=c[e]||[],h=l[0]===w&&l[1],p=l[0]===w&&l[2],f=h&&m.childNodes[h];while(f=++h&&f&&f[g]||(p=h=0)||d.pop())if(1===f.nodeType&&++p&&f===t){c[e]=[w,h,p];break}}else if(x&&(l=(t[y]||(t[y]={}))[e])&&l[0]===w)p=l[1];else while(f=++h&&f&&f[g]||(p=h=0)||d.pop())if((a?f.nodeName.toLowerCase()===v:1===f.nodeType)&&++p&&(x&&((f[y]||(f[y]={}))[e]=[w,p]),f===t))break;return p-=i,p===r||0===p%r&&p/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||ut.error("unsupported pseudo: "+e);return i[y]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?st(function(e,n){var r,o=i(e,t),s=o.length;while(s--)r=F.call(e,o[s]),e[r]=!(n[r]=o[s])}):function(e){return i(e,0,n)}):i}},pseudos:{not:st(function(e){var t=[],n=[],r=s(e.replace(I,"$1"));return r[y]?st(function(e,t,n,i){var o,s=r(e,null,i,[]),a=e.length;while(a--)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:st(function(e){return function(t){return ut(e,t).length>0}}),contains:st(function(e){return function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:st(function(e){return V.test(e||"")||ut.error("unsupported lang: "+e),e=e.replace(tt,nt).toLowerCase(),function(t){var n;do if(n=p?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===c.activeElement&&(!c.hasFocus||c.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!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,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return K.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"))||t.toLowerCase()===e.type)},first:dt(function(){return[0]}),last:dt(function(e,t){return[t-1]}),eq:dt(function(e,t,n){return[0>n?n+t:n]}),even:dt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:dt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:dt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:dt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=pt(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=ht(t);function gt(e,t){var n,i,o,s,a,u,l,c=k[e+" "];if(c)return t?0:c.slice(0);a=e,u=[],l=r.preFilter;while(a){(!n||(i=z.exec(a)))&&(i&&(a=a.slice(i[0].length)||a),u.push(o=[])),n=!1,(i=_.exec(a))&&(n=i.shift(),o.push({value:n,type:i[0].replace(I," ")}),a=a.slice(n.length));for(s in r.filter)!(i=G[s].exec(a))||l[s]&&!(i=l[s](i))||(n=i.shift(),o.push({value:n,type:s,matches:i}),a=a.slice(n.length));if(!n)break}return t?a.length:a?ut.error(e):k(e,u).slice(0)}function mt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function yt(e,t,r){var i=t.dir,o=r&&"parentNode"===i,s=T++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,r,a){var u,l,c,f=w+" "+s;if(a){while(t=t[i])if((1===t.nodeType||o)&&e(t,r,a))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[y]||(t[y]={}),(l=c[i])&&l[0]===f){if((u=l[1])===!0||u===n)return u===!0}else if(l=c[i]=[f],l[1]=e(t,r,a)||n,l[1]===!0)return!0}}function vt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,s=[],a=0,u=e.length,l=null!=t;for(;u>a;a++)(o=e[a])&&(!n||n(o,r,i))&&(s.push(o),l&&t.push(a));return s}function bt(e,t,n,r,i,o){return r&&!r[y]&&(r=bt(r)),i&&!i[y]&&(i=bt(i,o)),st(function(o,s,a,u){var l,c,f,p=[],h=[],d=s.length,g=o||Ct(t||"*",a.nodeType?[a]:a,[]),m=!e||!o&&t?g:xt(g,p,e,a,u),y=n?i||(o?e:d||r)?[]:s:m;if(n&&n(m,y,a,u),r){l=xt(y,h),r(l,[],a,u),c=l.length;while(c--)(f=l[c])&&(y[h[c]]=!(m[h[c]]=f))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(f=y[c])&&l.push(m[c]=f);i(null,y=[],l,u)}c=y.length;while(c--)(f=y[c])&&(l=i?F.call(o,f):p[c])>-1&&(o[l]=!(s[l]=f))}}else y=xt(y===s?y.splice(d,y.length):y),i?i(null,s,y,u):H.apply(s,y)})}function wt(e){var t,n,i,o=e.length,s=r.relative[e[0].type],u=s||r.relative[" "],l=s?1:0,c=yt(function(e){return e===t},u,!0),f=yt(function(e){return F.call(t,e)>-1},u,!0),p=[function(e,n,r){return!s&&(r||n!==a)||((t=n).nodeType?c(e,n,r):f(e,n,r))}];for(;o>l;l++)if(n=r.relative[e[l].type])p=[yt(vt(p),n)];else{if(n=r.filter[e[l].type].apply(null,e[l].matches),n[y]){for(i=++l;o>i;i++)if(r.relative[e[i].type])break;return bt(l>1&&vt(p),l>1&&mt(e.slice(0,l-1)).replace(I,"$1"),n,i>l&&wt(e.slice(l,i)),o>i&&wt(e=e.slice(i)),o>i&&mt(e))}p.push(n)}return vt(p)}function Tt(e,t){var i=0,o=t.length>0,s=e.length>0,u=function(u,l,f,p,h){var d,g,m,y=[],v=0,x="0",b=u&&[],T=null!=h,C=a,k=u||s&&r.find.TAG("*",h&&l.parentNode||l),N=w+=null==C?1:Math.random()||.1;for(T&&(a=l!==c&&l,n=i);null!=(d=k[x]);x++){if(s&&d){g=0;while(m=e[g++])if(m(d,l,f)){p.push(d);break}T&&(w=N,n=++i)}o&&((d=!m&&d)&&v--,u&&b.push(d))}if(v+=x,o&&x!==v){g=0;while(m=t[g++])m(b,y,l,f);if(u){if(v>0)while(x--)b[x]||y[x]||(y[x]=L.call(p));y=xt(y)}H.apply(p,y),T&&!u&&y.length>0&&v+t.length>1&&ut.uniqueSort(p)}return T&&(w=N,a=C),b};return o?st(u):u}s=ut.compile=function(e,t){var n,r=[],i=[],o=N[e+" "];if(!o){t||(t=gt(e)),n=t.length;while(n--)o=wt(t[n]),o[y]?r.push(o):i.push(o);o=N(e,Tt(i,r))}return o};function Ct(e,t,n){var r=0,i=t.length;for(;i>r;r++)ut(e,t[r],n);return n}function kt(e,t,n,i){var o,a,u,l,c,f=gt(e);if(!i&&1===f.length){if(a=f[0]=f[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&p&&r.relative[a[1].type]){if(t=(r.find.ID(u.matches[0].replace(tt,nt),t)||[])[0],!t)return n;e=e.slice(a.shift().value.length)}o=G.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],r.relative[l=u.type])break;if((c=r.find[l])&&(i=c(u.matches[0].replace(tt,nt),X.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=i.length&&mt(a),!e)return H.apply(n,i),n;break}}}return s(e,f)(i,t,!p,n,X.test(e)),n}r.pseudos.nth=r.pseudos.eq;function Nt(){}Nt.prototype=r.filters=r.pseudos,r.setFilters=new Nt,b.sortStable=y.split("").sort(S).join("")===y,l(),[0,0].sort(S),b.detectDuplicates=E,at(function(e){if(e.innerHTML="<a href='#'></a>","#"!==e.firstChild.getAttribute("href")){var t="type|href|height|width".split("|"),n=t.length;while(n--)r.attrHandle[t[n]]=ft}}),at(function(e){if(null!=e.getAttribute("disabled")){var t=P.split("|"),n=t.length;while(n--)r.attrHandle[t[n]]=ct}}),x.find=ut,x.expr=ut.selectors,x.expr[":"]=x.expr.pseudos,x.unique=ut.uniqueSort,x.text=ut.getText,x.isXMLDoc=ut.isXML,x.contains=ut.contains}(e);var D={};function A(e){var t=D[e]={};return x.each(e.match(w)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?D[e]||A(e):x.extend({},e);var t,n,r,i,o,s,a=[],u=!e.once&&[],l=function(f){for(t=e.memory&&f,n=!0,s=i||0,i=0,o=a.length,r=!0;a&&o>s;s++)if(a[s].apply(f[0],f[1])===!1&&e.stopOnFalse){t=!1;break}r=!1,a&&(u?u.length&&l(u.shift()):t?a=[]:c.disable())},c={add:function(){if(a){var n=a.length;(function s(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&c.has(n)||a.push(n):n&&n.length&&"string"!==r&&s(n)})})(arguments),r?o=a.length:t&&(i=n,l(t))}return this},remove:function(){return a&&x.each(arguments,function(e,t){var n;while((n=x.inArray(t,a,n))>-1)a.splice(n,1),r&&(o>=n&&o--,s>=n&&s--)}),this},has:function(e){return e?x.inArray(e,a)>-1:!(!a||!a.length)},empty:function(){return a=[],o=0,this},disable:function(){return a=u=t=undefined,this},disabled:function(){return!a},lock:function(){return u=undefined,t||c.disable(),this},locked:function(){return!u},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!a||n&&!u||(r?u.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!n}};return c},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var s=o[0],a=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var s=o[2],a=o[3];r[o[1]]=s.add,a&&s.add(function(){n=a},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=s.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=d.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),s=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?d.call(arguments):r,n===a?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},a,u,l;if(r>1)for(a=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(s(t,l,n)).fail(o.reject).progress(s(t,u,a)):--i;return i||o.resolveWith(l,n),o.promise()}}),x.support=function(t){var n=o.createElement("input"),r=o.createDocumentFragment(),i=o.createElement("div"),s=o.createElement("select"),a=s.appendChild(o.createElement("option"));return n.type?(n.type="checkbox",t.checkOn=""!==n.value,t.optSelected=a.selected,t.reliableMarginRight=!0,t.boxSizingReliable=!0,t.pixelPosition=!1,n.checked=!0,t.noCloneChecked=n.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!a.disabled,n=o.createElement("input"),n.value="t",n.type="radio",t.radioValue="t"===n.value,n.setAttribute("checked","t"),n.setAttribute("name","t"),r.appendChild(n),t.checkClone=r.cloneNode(!0).cloneNode(!0).lastChild.checked,t.focusinBubbles="onfocusin"in e,i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===i.style.backgroundClip,x(function(){var n,r,s="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",a=o.getElementsByTagName("body")[0];a&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(n).appendChild(i),i.innerHTML="",i.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",x.swap(a,null!=a.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===i.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(i,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(i,null)||{width:"4px"}).width,r=i.appendChild(o.createElement("div")),r.style.cssText=i.style.cssText=s,r.style.marginRight=r.style.width="0",i.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),a.removeChild(n))}),t):t}({});var L,q,H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,O=/([A-Z])/g;function F(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=x.expando+Math.random()}F.uid=1,F.accepts=function(e){return e.nodeType?1===e.nodeType||9===e.nodeType:!0},F.prototype={key:function(e){if(!F.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=F.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(r){t[this.expando]=n,x.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var r,i=this.key(e),o=this.cache[i];if("string"==typeof t)o[t]=n;else if(x.isEmptyObject(o))this.cache[i]=t;else for(r in t)o[r]=t[r]},get:function(e,t){var n=this.cache[this.key(e)];return t===undefined?n:n[t]},access:function(e,t,n){return t===undefined||t&&"string"==typeof t&&n===undefined?this.get(e,t):(this.set(e,t,n),n!==undefined?n:t)},remove:function(e,t){var n,r,i=this.key(e),o=this.cache[i];if(t===undefined)this.cache[i]={};else{x.isArray(t)?r=t.concat(t.map(x.camelCase)):t in o?r=[t]:(r=x.camelCase(t),r=r in o?[r]:r.match(w)||[]),n=r.length;while(n--)delete o[r[n]]}},hasData:function(e){return!x.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){delete this.cache[this.key(e)]}},L=new F,q=new F,x.extend({acceptData:F.accepts,hasData:function(e){return L.hasData(e)||q.hasData(e)},data:function(e,t,n){return L.access(e,t,n)},removeData:function(e,t){L.remove(e,t)},_data:function(e,t,n){return q.access(e,t,n)},_removeData:function(e,t){q.remove(e,t)}}),x.fn.extend({data:function(e,t){var n,r,i=this[0],o=0,s=null;if(e===undefined){if(this.length&&(s=L.get(i),1===i.nodeType&&!q.get(i,"hasDataAttrs"))){for(n=i.attributes;n.length>o;o++)r=n[o].name,0===r.indexOf("data-")&&(r=x.camelCase(r.substring(5)),P(i,r,s[r]));q.set(i,"hasDataAttrs",!0)}return s}return"object"==typeof e?this.each(function(){L.set(this,e)}):x.access(this,function(t){var n,r=x.camelCase(e);if(i&&t===undefined){if(n=L.get(i,e),n!==undefined)return n;if(n=L.get(i,r),n!==undefined)return n;if(n=P(i,r,undefined),n!==undefined)return n}else this.each(function(){var n=L.get(this,r);L.set(this,r,t),-1!==e.indexOf("-")&&n!==undefined&&L.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){L.remove(this,e)})}});function P(e,t,n){var r;if(n===undefined&&1===e.nodeType)if(r="data-"+t.replace(O,"-$1").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:H.test(n)?JSON.parse(n):n}catch(i){}L.set(e,t,n)}else n=undefined;return n}x.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=q.get(e,t),n&&(!r||x.isArray(n)?r=q.access(e,t,x.makeArray(n)):r.push(n)),r||[]):undefined},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),s=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,s,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return q.get(e,n)||q.access(e,n,{empty:x.Callbacks("once memory").add(function(){q.remove(e,[t+"queue",n])})})}}),x.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),n>arguments.length?x.queue(this[0],e):t===undefined?this:this.each(function(){var n=x.queue(this,e,t);
-x._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=x.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=undefined),e=e||"fx";while(s--)n=q.get(o[s],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(t)}});var R,M,W=/[\t\r\n]/g,$=/\r/g,B=/^(?:input|select|textarea|button)$/i;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[x.propFix[e]||e]})},addClass:function(e){var t,n,r,i,o,s=0,a=this.length,u="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];a>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(W," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,s=0,a=this.length,u=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];a>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(W," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,i="boolean"==typeof t;return x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,s=0,a=x(this),u=t,l=e.match(w)||[];while(o=l[s++])u=i?u:!a.hasClass(o),a[u?"addClass":"removeClass"](o)}else(n===r||"boolean"===n)&&(this.className&&q.set(this,"__className__",this.className),this.className=this.className||e===!1?"":q.get(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(W," ").indexOf(t)>=0)return!0;return!1},val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=x.isFunction(e),this.each(function(n){var i,o=x(this);1===this.nodeType&&(i=r?e.call(this,n,o.val()):e,null==i?i="":"number"==typeof i?i+="":x.isArray(i)&&(i=x.map(i,function(e){return null==e?"":e+""})),t=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&t.set(this,i,"value")!==undefined||(this.value=i))});if(i)return t=x.valHooks[i.type]||x.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&(n=t.get(i,"value"))!==undefined?n:(n=i.value,"string"==typeof n?n.replace($,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,s=o?null:[],a=o?i+1:r.length,u=0>i?a:o?i:0;for(;a>u;u++)if(n=r[u],!(!n.selected&&u!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),s=i.length;while(s--)r=i[s],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,t,n){var i,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===r?x.prop(e,t,n):(1===s&&x.isXMLDoc(e)||(t=t.toLowerCase(),i=x.attrHooks[t]||(x.expr.match.boolean.test(t)?M:R)),n===undefined?i&&"get"in i&&null!==(o=i.get(e,t))?o:(o=x.find.attr(e,t),null==o?undefined:o):null!==n?i&&"set"in i&&(o=i.set(e,n,t))!==undefined?o:(e.setAttribute(t,n+""),n):(x.removeAttr(e,t),undefined))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.boolean.test(n)&&(e[r]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return o=1!==s||!x.isXMLDoc(e),o&&(t=x.propFix[t]||t,i=x.propHooks[t]),n!==undefined?i&&"set"in i&&(r=i.set(e,n,t))!==undefined?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||B.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),M={set:function(e,t,n){return t===!1?x.removeAttr(e,n):e.setAttribute(n,n),n}},x.each(x.expr.match.boolean.source.match(/\w+/g),function(e,t){var n=x.expr.attrHandle[t]||x.find.attr;x.expr.attrHandle[t]=function(e,t,r){var i=x.expr.attrHandle[t],o=r?undefined:(x.expr.attrHandle[t]=undefined)!=n(e,t,r)?t.toLowerCase():null;return x.expr.attrHandle[t]=i,o}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,t){return x.isArray(t)?e.checked=x.inArray(x(e).val(),t)>=0:undefined}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var I=/^key/,z=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,X=/^([^.]*)(?:\.(.+)|)$/;function U(){return!0}function Y(){return!1}function V(){try{return o.activeElement}catch(e){}}x.event={global:{},add:function(e,t,n,i,o){var s,a,u,l,c,f,p,h,d,g,m,y=q.get(e);if(y){n.handler&&(s=n,n=s.handler,o=s.selector),n.guid||(n.guid=x.guid++),(l=y.events)||(l=y.events={}),(a=y.handle)||(a=y.handle=function(e){return typeof x===r||e&&x.event.triggered===e.type?undefined:x.event.dispatch.apply(a.elem,arguments)},a.elem=e),t=(t||"").match(w)||[""],c=t.length;while(c--)u=X.exec(t[c])||[],d=m=u[1],g=(u[2]||"").split(".").sort(),d&&(p=x.event.special[d]||{},d=(o?p.delegateType:p.bindType)||d,p=x.event.special[d]||{},f=x.extend({type:d,origType:m,data:i,handler:n,guid:n.guid,selector:o,needsContext:o&&x.expr.match.needsContext.test(o),namespace:g.join(".")},s),(h=l[d])||(h=l[d]=[],h.delegateCount=0,p.setup&&p.setup.call(e,i,g,a)!==!1||e.addEventListener&&e.addEventListener(d,a,!1)),p.add&&(p.add.call(e,f),f.handler.guid||(f.handler.guid=n.guid)),o?h.splice(h.delegateCount++,0,f):h.push(f),x.event.global[d]=!0);e=null}},remove:function(e,t,n,r,i){var o,s,a,u,l,c,f,p,h,d,g,m=q.hasData(e)&&q.get(e);if(m&&(u=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(a=X.exec(t[l])||[],h=g=a[1],d=(a[2]||"").split(".").sort(),h){f=x.event.special[h]||{},h=(r?f.delegateType:f.bindType)||h,p=u[h]||[],a=a[2]&&RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.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));s&&!p.length&&(f.teardown&&f.teardown.call(e,d,m.handle)!==!1||x.removeEvent(e,h,m.handle),delete u[h])}else for(h in u)x.event.remove(e,h+t[l],n,r,!0);x.isEmptyObject(u)&&(delete m.handle,q.remove(e,"events"))}},trigger:function(t,n,r,i){var s,a,u,l,c,f,p,h=[r||o],d=y.call(t,"type")?t.type:t,g=y.call(t,"namespace")?t.namespace.split("."):[];if(a=u=r=r||o,3!==r.nodeType&&8!==r.nodeType&&!_.test(d+x.event.triggered)&&(d.indexOf(".")>=0&&(g=d.split("."),d=g.shift(),g.sort()),c=0>d.indexOf(":")&&"on"+d,t=t[x.expando]?t:new x.Event(d,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=g.join("."),t.namespace_re=t.namespace?RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=undefined,t.target||(t.target=r),n=null==n?[t]:x.makeArray(n,[t]),p=x.event.special[d]||{},i||!p.trigger||p.trigger.apply(r,n)!==!1)){if(!i&&!p.noBubble&&!x.isWindow(r)){for(l=p.delegateType||d,_.test(l+d)||(a=a.parentNode);a;a=a.parentNode)h.push(a),u=a;u===(r.ownerDocument||o)&&h.push(u.defaultView||u.parentWindow||e)}s=0;while((a=h[s++])&&!t.isPropagationStopped())t.type=s>1?l:p.bindType||d,f=(q.get(a,"events")||{})[t.type]&&q.get(a,"handle"),f&&f.apply(a,n),f=c&&a[c],f&&x.acceptData(a)&&f.apply&&f.apply(a,n)===!1&&t.preventDefault();return t.type=d,i||t.isDefaultPrevented()||p._default&&p._default.apply(h.pop(),n)!==!1||!x.acceptData(r)||c&&x.isFunction(r[d])&&!x.isWindow(r)&&(u=r[c],u&&(r[c]=null),x.event.triggered=d,r[d](),x.event.triggered=undefined,u&&(r[c]=u)),t.result}},dispatch:function(e){e=x.event.fix(e);var t,n,r,i,o,s=[],a=d.call(arguments),u=(q.get(this,"events")||{})[e.type]||[],l=x.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),t=0;while((i=s[t++])&&!e.isPropagationStopped()){e.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(o.namespace))&&(e.handleObj=o,e.data=o.data,r=((x.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a),r!==undefined&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,s=[],a=t.delegateCount,u=e.target;if(a&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!==this;u=u.parentNode||this)if(u.disabled!==!0||"click"!==e.type){for(r=[],n=0;a>n;n++)o=t[n],i=o.selector+" ",r[i]===undefined&&(r[i]=o.needsContext?x(i,this).index(u)>=0:x.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&s.push({elem:u,handlers:r})}return t.length>a&&s.push({elem:this,handlers:t.slice(a)}),s},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,s=t.button;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||o,r=n.documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||s===undefined||(e.which=1&s?1:2&s?3:4&s?2:0),e}},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=z.test(i)?this.mouseHooks:I.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return 3===e.target.nodeType&&(e.target=e.target.parentNode),s.filter?s.filter(e,o):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==V()&&this.focus?(this.focus(),!1):undefined},delegateType:"focusin"},blur:{trigger:function(){return this===V()&&this.blur?(this.blur(),!1):undefined},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&x.nodeName(this,"input")?(this.click(),!1):undefined},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==undefined&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},x.Event=function(e,t){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.getPreventDefault&&e.getPreventDefault()?U:Y):this.type=e,t&&x.extend(this,t),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,undefined):new x.Event(e,t)},x.Event.prototype={isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=U,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=U,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=U,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,t,n,r,i){var o,s;if("object"==typeof e){"string"!=typeof t&&(n=n||t,t=undefined);for(s in e)this.on(s,t,n,e[s],i);return this}if(null==n&&null==r?(r=t,n=t=undefined):null==r&&("string"==typeof t?(r=n,n=undefined):(r=n,n=t,t=undefined)),r===!1)r=Y;else if(!r)return this;return 1===i&&(o=r,r=function(e){return x().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=x.guid++)),this.each(function(){x.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,x(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(t===!1||"function"==typeof t)&&(n=t,t=undefined),n===!1&&(n=Y),this.each(function(){x.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?x.event.trigger(e,t,n,!0):undefined}});var G=/^.[^:#\[\.,]*$/,J=x.expr.match.needsContext,Q={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return t=this,this.pushStack(x(e).filter(function(){for(r=0;i>r;r++)if(x.contains(t[r],this))return!0}));for(n=[],r=0;i>r;r++)x.find(e,this[r],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t=x(e,this),n=t.length;return this.filter(function(){var e=0;for(;n>e;e++)if(x.contains(this,t[e]))return!0})},not:function(e){return this.pushStack(Z(this,e||[],!0))},filter:function(e){return this.pushStack(Z(this,e||[],!1))},is:function(e){return!!e&&("string"==typeof e?J.test(e)?x(e,this.context).index(this[0])>=0:x.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],s=J.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(s?s.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?g.call(x(e),this[0]):g.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function K(e,t){while((e=e[t])&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return K(e,"nextSibling")},prev:function(e){return K(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(Q[e]||x.unique(i),"p"===e[0]&&i.reverse()),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,t,n){var r=[],i=n!==undefined;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&x(e).is(n))break;r.push(e)}return r},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function Z(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(G.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return g.call(t,e)>=0!==n})}var et=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,tt=/<([\w:]+)/,nt=/<|&#?\w+;/,rt=/<(?:script|style|link)/i,it=/^(?:checkbox|radio)$/i,ot=/checked\s*(?:[^=]|=\s*.checked.)/i,st=/^$|\/(?:java|ecma)script/i,at=/^true\/(.*)/,ut=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,lt={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};lt.optgroup=lt.option,lt.tbody=lt.tfoot=lt.colgroup=lt.caption=lt.col=lt.thead,lt.th=lt.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===undefined?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ct(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ct(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(gt(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&ht(gt(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++)1===e.nodeType&&(x.cleanData(gt(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var t=this[0]||{},n=0,r=this.length;if(e===undefined&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!rt.test(e)&&!lt[(tt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(et,"<$1></$2>");try{for(;r>n;n++)t=this[n]||{},1===t.nodeType&&(x.cleanData(gt(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=p.apply([],e);var r,i,o,s,a,u,l=0,c=this.length,f=this,h=c-1,d=e[0],g=x.isFunction(d);if(g||!(1>=c||"string"!=typeof d||x.support.checkClone)&&ot.test(d))return this.each(function(r){var i=f.eq(r);g&&(e[0]=d.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(r=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),i=r.firstChild,1===r.childNodes.length&&(r=i),i)){for(o=x.map(gt(r,"script"),ft),s=o.length;c>l;l++)a=r,l!==h&&(a=x.clone(a,!0,!0),s&&x.merge(o,gt(a,"script"))),t.call(this[l],a,l);if(s)for(u=o[o.length-1].ownerDocument,x.map(o,pt),l=0;s>l;l++)a=o[l],st.test(a.type||"")&&!q.access(a,"globalEval")&&x.contains(u,a)&&(a.src?x._evalUrl(a.src):x.globalEval(a.textContent.replace(ut,"")))}return this}}),x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=[],i=x(e),o=i.length-1,s=0;for(;o>=s;s++)n=s===o?this:this.clone(!0),x(i[s])[t](n),h.apply(r,n.get());return this.pushStack(r)}}),x.extend({clone:function(e,t,n){var r,i,o,s,a=e.cloneNode(!0),u=x.contains(e.ownerDocument,e);if(!(x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(s=gt(a),o=gt(e),r=0,i=o.length;i>r;r++)mt(o[r],s[r]);if(t)if(n)for(o=o||gt(e),s=s||gt(a),r=0,i=o.length;i>r;r++)dt(o[r],s[r]);else dt(e,a);return s=gt(a,"script"),s.length>0&&ht(s,!u&&gt(e,"script")),a},buildFragment:function(e,t,n,r){var i,o,s,a,u,l,c=0,f=e.length,p=t.createDocumentFragment(),h=[];for(;f>c;c++)if(i=e[c],i||0===i)if("object"===x.type(i))x.merge(h,i.nodeType?[i]:i);else if(nt.test(i)){o=o||p.appendChild(t.createElement("div")),s=(tt.exec(i)||["",""])[1].toLowerCase(),a=lt[s]||lt._default,o.innerHTML=a[1]+i.replace(et,"<$1></$2>")+a[2],l=a[0];while(l--)o=o.firstChild;x.merge(h,o.childNodes),o=p.firstChild,o.textContent=""}else h.push(t.createTextNode(i));p.textContent="",c=0;while(i=h[c++])if((!r||-1===x.inArray(i,r))&&(u=x.contains(i.ownerDocument,i),o=gt(p.appendChild(i),"script"),u&&ht(o),n)){l=0;while(i=o[l++])st.test(i.type||"")&&n.push(i)}return p},cleanData:function(e){var t,n,r,i=e.length,o=0,s=x.event.special;for(;i>o;o++){if(n=e[o],x.acceptData(n)&&(t=q.access(n)))for(r in t.events)s[r]?x.event.remove(n,r):x.removeEvent(n,r,t.handle);L.discard(n),q.discard(n)}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"text",async:!1,global:!1,success:x.globalEval})}});function ct(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ft(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function pt(e){var t=at.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function ht(e,t){var n=e.length,r=0;for(;n>r;r++)q.set(e[r],"globalEval",!t||q.get(t[r],"globalEval"))}function dt(e,t){var n,r,i,o,s,a,u,l;if(1===t.nodeType){if(q.hasData(e)&&(o=q.access(e),s=x.extend({},o),l=o.events,q.set(t,s),l)){delete s.handle,s.events={};for(i in l)for(n=0,r=l[i].length;r>n;n++)x.event.add(t,i,l[i][n])}L.hasData(e)&&(a=L.access(e),u=x.extend({},a),L.set(t,u))}}function gt(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return t===undefined||t&&x.nodeName(e,t)?x.merge([e],n):n}function mt(e,t){var n=t.nodeName.toLowerCase();"input"===n&&it.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}x.fn.extend({wrapAll:function(e){var t;return x.isFunction(e)?this.each(function(t){x(this).wrapAll(e.call(this,t))}):(this[0]&&(t=x(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(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var yt,vt,xt=/^(none|table(?!-c[ea]).+)/,bt=/^margin/,wt=RegExp("^("+b+")(.*)$","i"),Tt=RegExp("^("+b+")(?!px)[a-z%]+$","i"),Ct=RegExp("^([+-])=("+b+")","i"),kt={BODY:"block"},Nt={position:"absolute",visibility:"hidden",display:"block"},Et={letterSpacing:0,fontWeight:400},St=["Top","Right","Bottom","Left"],jt=["Webkit","O","Moz","ms"];function Dt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=jt.length;while(i--)if(t=jt[i]+n,t in e)return t;return r}function At(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function Lt(t){return e.getComputedStyle(t,null)}function qt(e,t){var n,r,i,o=[],s=0,a=e.length;for(;a>s;s++)r=e[s],r.style&&(o[s]=q.get(r,"olddisplay"),n=r.style.display,t?(o[s]||"none"!==n||(r.style.display=""),""===r.style.display&&At(r)&&(o[s]=q.access(r,"olddisplay",Pt(r.nodeName)))):o[s]||(i=At(r),(n&&"none"!==n||!i)&&q.set(r,"olddisplay",i?n:x.css(r,"display"))));for(s=0;a>s;s++)r=e[s],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[s]||"":"none"));return e}x.fn.extend({css:function(e,t){return x.access(this,function(e,t,n){var r,i,o={},s=0;if(x.isArray(t)){for(r=Lt(e),i=t.length;i>s;s++)o[t[s]]=x.css(e,t[s],!1,r);return o}return n!==undefined?x.style(e,t,n):x.css(e,t)},e,t,arguments.length>1)},show:function(){return qt(this,!0)},hide:function(){return qt(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:At(this))?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=yt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,s,a=x.camelCase(t),u=e.style;return t=x.cssProps[a]||(x.cssProps[a]=Dt(u,a)),s=x.cssHooks[t]||x.cssHooks[a],n===undefined?s&&"get"in s&&(i=s.get(e,!1,r))!==undefined?i:u[t]:(o=typeof n,"string"===o&&(i=Ct.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(x.css(e,t)),o="number"),null==n||"number"===o&&isNaN(n)||("number"!==o||x.cssNumber[a]||(n+="px"),x.support.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),s&&"set"in s&&(n=s.set(e,n,r))===undefined||(u[t]=n)),undefined)}},css:function(e,t,n,r){var i,o,s,a=x.camelCase(t);return t=x.cssProps[a]||(x.cssProps[a]=Dt(e.style,a)),s=x.cssHooks[t]||x.cssHooks[a],s&&"get"in s&&(i=s.get(e,!0,n)),i===undefined&&(i=yt(e,t,r)),"normal"===i&&t in Et&&(i=Et[t]),""===n||n?(o=parseFloat(i),n===!0||x.isNumeric(o)?o||0:i):i}}),yt=function(e,t,n){var r,i,o,s=n||Lt(e),a=s?s.getPropertyValue(t)||s[t]:undefined,u=e.style;return s&&(""!==a||x.contains(e.ownerDocument,e)||(a=x.style(e,t)),Tt.test(a)&&bt.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=s.width,u.width=r,u.minWidth=i,u.maxWidth=o)),a};function Ht(e,t,n){var r=wt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function Ot(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,s=0;for(;4>o;o+=2)"margin"===n&&(s+=x.css(e,n+St[o],!0,i)),r?("content"===n&&(s-=x.css(e,"padding"+St[o],!0,i)),"margin"!==n&&(s-=x.css(e,"border"+St[o]+"Width",!0,i))):(s+=x.css(e,"padding"+St[o],!0,i),"padding"!==n&&(s+=x.css(e,"border"+St[o]+"Width",!0,i)));return s}function Ft(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Lt(e),s=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=yt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Tt.test(i))return i;r=s&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+Ot(e,t,n||(s?"border":"content"),r,o)+"px"}function Pt(e){var t=o,n=kt[e];return n||(n=Rt(e,t),"none"!==n&&n||(vt=(vt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(vt[0].contentWindow||vt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=Rt(e,t),vt.detach()),kt[e]=n),n}function Rt(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,t){x.cssHooks[t]={get:function(e,n,r){return n?0===e.offsetWidth&&xt.test(x.css(e,"display"))?x.swap(e,Nt,function(){return Ft(e,t,r)}):Ft(e,t,r):undefined},set:function(e,n,r){var i=r&&Lt(e);return Ht(e,n,r?Ot(e,t,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,t){return t?x.swap(e,{display:"inline-block"},yt,[e,"marginRight"]):undefined}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,t){x.cssHooks[t]={get:function(e,n){return n?(n=yt(e,t),Tt.test(n)?x(e).position()[t]+"px":n):undefined}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+St[r]+t]=o[r]||o[r-2]||o[0];return i}},bt.test(e)||(x.cssHooks[e+t].set=Ht)});var Mt=/%20/g,Wt=/\[\]$/,$t=/\r?\n/g,Bt=/^(?:submit|button|image|reset|file)$/i,It=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&It.test(this.nodeName)&&!Bt.test(e)&&(this.checked||!it.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace($t,"\r\n")}}):{name:t.name,value:n.replace($t,"\r\n")}}).get()}}),x.param=function(e,t){var n,r=[],i=function(e,t){t=x.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(t===undefined&&(t=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){i(this.name,this.value)});else for(n in e)zt(n,e[n],t,i);return r.join("&").replace(Mt,"+")};function zt(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||Wt.test(e)?r(e,i):zt(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)zt(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},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)}});var _t,Xt,Ut=x.now(),Yt=/\?/,Vt=/#.*$/,Gt=/([?&])_=[^&]*/,Jt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Qt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Kt=/^(?:GET|HEAD)$/,Zt=/^\/\//,en=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,tn=x.fn.load,nn={},rn={},on="*/".concat("*");try{Xt=i.href}catch(sn){Xt=o.createElement("a"),Xt.href="",Xt=Xt.href}_t=en.exec(Xt.toLowerCase())||[];function an(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];
-if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function un(e,t,n,r){var i={},o=e===rn;function s(a){var u;return i[a]=!0,x.each(e[a]||[],function(e,a){var l=a(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):undefined:(t.dataTypes.unshift(l),s(l),!1)}),u}return s(t.dataTypes[0])||!i["*"]&&s("*")}function ln(e,t){var n,r,i=x.ajaxSettings.flatOptions||{};for(n in t)t[n]!==undefined&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,t,n){if("string"!=typeof e&&tn)return tn.apply(this,arguments);var r,i,o,s=this,a=e.indexOf(" ");return a>=0&&(r=e.slice(a),e=e.slice(0,a)),x.isFunction(t)?(n=t,t=undefined):t&&"object"==typeof t&&(i="POST"),s.length>0&&x.ajax({url:e,type:i,dataType:"html",data:t}).done(function(e){o=arguments,s.html(r?x("<div>").append(x.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){s.each(n,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Xt,type:"GET",isLocal:Qt.test(_t[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":on,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?ln(ln(e,x.ajaxSettings),t):ln(x.ajaxSettings,e)},ajaxPrefilter:an(nn),ajaxTransport:an(rn),ajax:function(e,t){"object"==typeof e&&(t=e,e=undefined),t=t||{};var n,r,i,o,s,a,u,l,c=x.ajaxSetup({},t),f=c.context||c,p=c.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),d=x.Callbacks("once memory"),g=c.statusCode||{},m={},y={},v=0,b="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===v){if(!o){o={};while(t=Jt.exec(i))o[t[1].toLowerCase()]=t[2]}t=o[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===v?i:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return v||(e=y[n]=y[n]||e,m[e]=t),this},overrideMimeType:function(e){return v||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>v)for(t in e)g[t]=[g[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||b;return n&&n.abort(t),k(0,t),this}};if(h.promise(T).complete=d.add,T.success=T.done,T.error=T.fail,c.url=((e||c.url||Xt)+"").replace(Vt,"").replace(Zt,_t[1]+"//"),c.type=t.method||t.type||c.method||c.type,c.dataTypes=x.trim(c.dataType||"*").toLowerCase().match(w)||[""],null==c.crossDomain&&(a=en.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===_t[1]&&a[2]===_t[2]&&(a[3]||("http:"===a[1]?"80":"443"))===(_t[3]||("http:"===_t[1]?"80":"443")))),c.data&&c.processData&&"string"!=typeof c.data&&(c.data=x.param(c.data,c.traditional)),un(nn,c,t,T),2===v)return T;u=c.global,u&&0===x.active++&&x.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!Kt.test(c.type),r=c.url,c.hasContent||(c.data&&(r=c.url+=(Yt.test(r)?"&":"?")+c.data,delete c.data),c.cache===!1&&(c.url=Gt.test(r)?r.replace(Gt,"$1_="+Ut++):r+(Yt.test(r)?"&":"?")+"_="+Ut++)),c.ifModified&&(x.lastModified[r]&&T.setRequestHeader("If-Modified-Since",x.lastModified[r]),x.etag[r]&&T.setRequestHeader("If-None-Match",x.etag[r])),(c.data&&c.hasContent&&c.contentType!==!1||t.contentType)&&T.setRequestHeader("Content-Type",c.contentType),T.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+on+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)T.setRequestHeader(l,c.headers[l]);if(c.beforeSend&&(c.beforeSend.call(f,T,c)===!1||2===v))return T.abort();b="abort";for(l in{success:1,error:1,complete:1})T[l](c[l]);if(n=un(rn,c,t,T)){T.readyState=1,u&&p.trigger("ajaxSend",[T,c]),c.async&&c.timeout>0&&(s=setTimeout(function(){T.abort("timeout")},c.timeout));try{v=1,n.send(m,k)}catch(C){if(!(2>v))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,t,o,a){var l,m,y,b,w,C=t;2!==v&&(v=2,s&&clearTimeout(s),n=undefined,i=a||"",T.readyState=e>0?4:0,l=e>=200&&300>e||304===e,o&&(b=cn(c,T,o)),b=fn(c,b,T,l),l?(c.ifModified&&(w=T.getResponseHeader("Last-Modified"),w&&(x.lastModified[r]=w),w=T.getResponseHeader("etag"),w&&(x.etag[r]=w)),204===e?C="nocontent":304===e?C="notmodified":(C=b.state,m=b.data,y=b.error,l=!y)):(y=C,(e||!C)&&(C="error",0>e&&(e=0))),T.status=e,T.statusText=(t||C)+"",l?h.resolveWith(f,[m,C,T]):h.rejectWith(f,[T,C,y]),T.statusCode(g),g=undefined,u&&p.trigger(l?"ajaxSuccess":"ajaxError",[T,c,l?m:y]),d.fireWith(f,[T,C]),u&&(p.trigger("ajaxComplete",[T,c]),--x.active||x.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,t){return x.get(e,undefined,t,"script")}}),x.each(["get","post"],function(e,t){x[t]=function(e,n,r,i){return x.isFunction(n)&&(i=i||r,r=n,n=undefined),x.ajax({url:e,type:t,dataType:i,data:n,success:r})}});function cn(e,t,n){var r,i,o,s,a=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),r===undefined&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[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}s||(s=i)}o=o||s}return o?(o!==u[0]&&u.unshift(o),n[o]):undefined}function fn(e,t,n,r){var i,o,s,a,u,l={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)l[s.toLowerCase()]=e.converters[s];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(s=l[u+" "+o]||l["* "+o],!s)for(i in l)if(a=i.split(" "),a[1]===o&&(s=l[u+" "+a[0]]||l["* "+a[0]])){s===!0?s=l[i]:l[i]!==!0&&(o=a[0],c.unshift(a[1]));break}if(s!==!0)if(s&&e["throws"])t=s(t);else try{t=s(t)}catch(f){return{state:"parsererror",error:s?f:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===undefined&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),x.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=x("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),o.head.appendChild(t[0])},abort:function(){n&&n()}}}});var pn=[],hn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=pn.pop()||x.expando+"_"+Ut++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,s,a=t.jsonp!==!1&&(hn.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&hn.test(t.data)&&"data");return a||"jsonp"===t.dataTypes[0]?(i=t.jsonpCallback=x.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(hn,"$1"+i):t.jsonp!==!1&&(t.url+=(Yt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||x.error(i+" was not called"),s[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){s=arguments},r.always(function(){e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,pn.push(i)),s&&x.isFunction(o)&&o(s[0]),s=o=undefined}),"script"):undefined}),x.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var dn=x.ajaxSettings.xhr(),gn={0:200,1223:204},mn=0,yn={};e.ActiveXObject&&x(e).on("unload",function(){for(var e in yn)yn[e]();yn=undefined}),x.support.cors=!!dn&&"withCredentials"in dn,x.support.ajax=dn=!!dn,x.ajaxTransport(function(e){var t;return x.support.cors||dn&&!e.crossDomain?{send:function(n,r){var i,o,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)s[i]=e.xhrFields[i];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)s.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete yn[o],t=s.onload=s.onerror=null,"abort"===e?s.abort():"error"===e?r(s.status||404,s.statusText):r(gn[s.status]||s.status,s.statusText,"string"==typeof s.responseText?{text:s.responseText}:undefined,s.getAllResponseHeaders()))}},s.onload=t(),s.onerror=t("error"),t=yn[o=mn++]=t("abort"),s.send(e.hasContent&&e.data||null)},abort:function(){t&&t()}}:undefined});var vn,xn,bn=/^(?:toggle|show|hide)$/,wn=RegExp("^(?:([+-])=|)("+b+")([a-z%]*)$","i"),Tn=/queueHooks$/,Cn=[Dn],kn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=wn.exec(t),s=i.cur(),a=+s||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(x.cssNumber[e]?"":"px"),"px"!==r&&a){a=x.css(i.elem,e,!0)||n||1;do u=u||".5",a/=u,x.style(i.elem,e,a+r);while(u!==(u=i.cur()/s)&&1!==u&&--l)}i.unit=r,i.start=a,i.end=o[1]?a+(o[1]+1)*n:n}return i}]};function Nn(){return setTimeout(function(){vn=undefined}),vn=x.now()}function En(e,t){x.each(t,function(t,n){var r=(kn[t]||[]).concat(kn["*"]),i=0,o=r.length;for(;o>i;i++)if(r[i].call(e,t,n))return})}function Sn(e,t,n){var r,i,o=0,s=Cn.length,a=x.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=vn||Nn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,s=0,u=l.tweens.length;for(;u>s;s++)l.tweens[s].run(o);return a.notifyWith(e,[l,o,n]),1>o&&u?n:(a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:vn||Nn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?a.resolveWith(e,[l,t]):a.rejectWith(e,[l,t]),this}}),c=l.props;for(jn(c,l.opts.specialEasing);s>o;o++)if(r=Cn[o].call(l,e,c,l.opts))return r;return En(l,c),x.isFunction(l.opts.start)&&l.opts.start.call(e,l),x.fx.timer(x.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function jn(e,t){var n,r,i,o,s;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),s=x.cssHooks[r],s&&"expand"in s){o=s.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(Sn,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],kn[n]=kn[n]||[],kn[n].unshift(t)},prefilter:function(e,t){t?Cn.unshift(e):Cn.push(e)}});function Dn(e,t,n){var r,i,o,s,a,u,l,c,f,p=this,h=e.style,d={},g=[],m=e.nodeType&&At(e);n.queue||(c=x._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,f=c.empty.fire,c.empty.fire=function(){c.unqueued||f()}),c.unqueued++,p.always(function(){p.always(function(){c.unqueued--,x.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(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]})),a=q.get(e,"fxshow");for(r in t)if(o=t[r],bn.exec(o)){if(delete t[r],u=u||"toggle"===o,o===(m?"hide":"show")){if("show"!==o||a===undefined||a[r]===undefined)continue;m=!0}g.push(r)}if(s=g.length){a=q.get(e,"fxshow")||q.access(e,"fxshow",{}),"hidden"in a&&(m=a.hidden),u&&(a.hidden=!m),m?x(e).show():p.done(function(){x(e).hide()}),p.done(function(){var t;q.remove(e,"fxshow");for(t in d)x.style(e,t,d[t])});for(r=0;s>r;r++)i=g[r],l=p.createTween(i,m?a[i]:0),d[i]=a[i]||x.style(e,i),i in a||(a[i]=l.start,m&&(l.end=l.start,l.start="width"===i||"height"===i?1:0))}}function An(e,t,n,r,i){return new An.prototype.init(e,t,n,r,i)}x.Tween=An,An.prototype={constructor:An,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=An.propHooks[this.prop];return e&&e.get?e.get(this):An.propHooks._default.get(this)},run:function(e){var t,n=An.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):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):An.propHooks._default.set(this),this}},An.prototype.init.prototype=An.prototype,An.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},An.propHooks.scrollTop=An.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(Ln(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(At).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),s=function(){var t=Sn(this,x.extend({},e),o);s.finish=function(){t.stop(!0)},(i||q.get(this,"finish"))&&t.stop(!0)};return s.finish=s,i||o.queue===!1?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=undefined),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=x.timers,s=q.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&Tn.test(i)&&r(s[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));(t||!n)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=q.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,s=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;s>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function Ln(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=St[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:Ln("show"),slideUp:Ln("hide"),slideToggle:Ln("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=An.prototype.init,x.fx.tick=function(){var e,t=x.timers,n=0;for(vn=x.now();t.length>n;n++)e=t[n],e()||t[n]!==e||t.splice(n--,1);t.length||x.fx.stop(),vn=undefined},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){xn||(xn=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(xn),xn=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===undefined?this:this.each(function(t){x.offset.setOffset(this,e,t)});var t,n,i=this[0],o={top:0,left:0},s=i&&i.ownerDocument;if(s)return t=s.documentElement,x.contains(t,i)?(typeof i.getBoundingClientRect!==r&&(o=i.getBoundingClientRect()),n=qn(s),{top:o.top+n.pageYOffset-t.clientTop,left:o.left+n.pageXOffset-t.clientLeft}):o},x.offset={setOffset:function(e,t,n){var r,i,o,s,a,u,l,c=x.css(e,"position"),f=x(e),p={};"static"===c&&(e.style.position="relative"),a=f.offset(),o=x.css(e,"top"),u=x.css(e,"left"),l=("absolute"===c||"fixed"===c)&&(o+u).indexOf("auto")>-1,l?(r=f.position(),s=r.top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(u)||0),x.isFunction(t)&&(t=t.call(e,n,a)),null!=t.top&&(p.top=t.top-a.top+s),null!=t.left&&(p.left=t.left-a.left+i),"using"in t?t.using.call(e,p):f.css(p)}},x.fn.extend({position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===x.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(r=e.offset()),r.top+=x.css(e[0],"borderTopWidth",!0),r.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-x.css(n,"marginTop",!0),left:t.left-r.left-x.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,n){var r="pageYOffset"===n;x.fn[t]=function(i){return x.access(this,function(t,i,o){var s=qn(t);return o===undefined?s?s[n]:t[i]:(s?s.scrollTo(r?e.pageXOffset:o,r?o:e.pageYOffset):t[i]=o,undefined)},t,i,arguments.length,null)}});function qn(e){return x.isWindow(e)?e:9===e.nodeType&&e.defaultView}x.each({Height:"height",Width:"width"},function(e,t){x.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){x.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),s=n||(r===!0||i===!0?"margin":"border");return x.access(this,function(t,n,r){var i;return x.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):r===undefined?x.css(t,n,s):x.style(t,n,r,s)},t,o?r:undefined,o,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&"object"==typeof module.exports?module.exports=x:"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}),"object"==typeof e&&"object"==typeof e.document&&(e.jQuery=e.$=x)})(window);
-}
-
-/*
- * Including d3.js
- * http://d3js.org/
- * Copyright 2012, Michael Bostock
- * Released under BSD licenses.
- */ 
-
-(function(){if(!Date.now){Date.now=function(){return +new Date}}try{document.createElement("div").style.setProperty("opacity",0,"")}catch(C7){var Bn=CSSStyleDeclaration.prototype,Dw=Bn.setProperty;Bn.setProperty=function(e,Eo,En){Dw.call(this,e,Eo+"",En)}}d3={version:"2.8.1"};function Eh(Ep,Eo){try{for(var En in Eo){Object.defineProperty(Ep.prototype,En,{value:Eo[En],enumerable:false})}}catch(Eq){Ep.prototype=Eo}}var Bu=Al;function Ef(En){var e=-1,Ep=En.length,Eo=[];while(++e<Ep){Eo.push(En[e])}return Eo}function Al(e){return Array.prototype.slice.call(e)}try{Bu(document.documentElement.childNodes)[0].nodeType}catch(EE){Bu=Ef}var Ca=[].__proto__?function(En,e){En.__proto__=e}:function(Eo,e){for(var En in e){Eo[En]=e[En]}};d3.map=function(e){var Eo=new AC;for(var En in e){Eo.set(En,e[En])}return Eo};function AC(){}Eh(AC,{has:function(e){return Ej+e in this},get:function(e){return this[Ej+e]},set:function(e,En){return this[Ej+e]=En},remove:function(e){e=Ej+e;return e in this&&delete this[e]},keys:function(){var e=[];this.forEach(function(En){e.push(En)});return e},values:function(){var e=[];this.forEach(function(En,Eo){e.push(Eo)});return e},entries:function(){var e=[];this.forEach(function(En,Eo){e.push({key:En,value:Eo})});return e},forEach:function(En){for(var e in this){if(e.charCodeAt(0)===Bp){En.call(this,e.substring(1),this[e])}}}});var Ej="\0",Bp=Ej.charCodeAt(0);function m(){return this}d3.functor=function(e){return typeof e==="function"?e:function(){return e}};d3.rebind=function(Eo,En){var e=1,Eq=arguments.length,Ep;while(++e<Eq){Eo[Ep=arguments[e]]=CL(Eo,En,En[Ep])}return Eo};function CL(En,e,Eo){return function(){var Ep=Eo.apply(e,arguments);return arguments.length?En:Ep}}d3.ascending=function(En,e){return En<e?-1:En>e?1:En>=e?0:NaN};d3.descending=function(En,e){return e<En?-1:e>En?1:e>=En?0:NaN};d3.mean=function(Es,Eq){var Er=Es.length,En,e=0,Ep=-1,Eo=0;if(arguments.length===1){while(++Ep<Er){if(EL(En=Es[Ep])){e+=(En-e)/++Eo}}}else{while(++Ep<Er){if(EL(En=Eq.call(Es,Es[Ep],Ep))){e+=(En-e)/++Eo}}}return Eo?e:undefined};d3.median=function(En,e){if(arguments.length>1){En=En.map(e)}En=En.filter(EL);return En.length?d3.quantile(En.sort(d3.ascending),0.5):undefined};d3.min=function(Er,Ep){var Eo=-1,Eq=Er.length,En,e;if(arguments.length===1){while(++Eo<Eq&&((En=Er[Eo])==null||En!=En)){En=undefined}while(++Eo<Eq){if((e=Er[Eo])!=null&&En>e){En=e}}}else{while(++Eo<Eq&&((En=Ep.call(Er,Er[Eo],Eo))==null||En!=En)){En=undefined}while(++Eo<Eq){if((e=Ep.call(Er,Er[Eo],Eo))!=null&&En>e){En=e}}}return En};d3.max=function(Er,Ep){var Eo=-1,Eq=Er.length,En,e;if(arguments.length===1){while(++Eo<Eq&&((En=Er[Eo])==null||En!=En)){En=undefined}while(++Eo<Eq){if((e=Er[Eo])!=null&&e>En){En=e}}}else{while(++Eo<Eq&&((En=Ep.call(Er,Er[Eo],Eo))==null||En!=En)){En=undefined}while(++Eo<Eq){if((e=Ep.call(Er,Er[Eo],Eo))!=null&&e>En){En=e}}}return En};d3.extent=function(Es,Ep){var Eo=-1,Er=Es.length,En,e,Eq;if(arguments.length===1){while(++Eo<Er&&((En=Eq=Es[Eo])==null||En!=En)){En=Eq=undefined}while(++Eo<Er){if((e=Es[Eo])!=null){if(En>e){En=e}if(Eq<e){Eq=e}}}}else{while(++Eo<Er&&((En=Eq=Ep.call(Es,Es[Eo],Eo))==null||En!=En)){En=undefined}while(++Eo<Er){if((e=Ep.call(Es,Es[Eo],Eo))!=null){if(En>e){En=e}if(Eq<e){Eq=e}}}}return[En,Eq]};d3.random={normal:function(e,En){if(arguments.length<2){En=1}if(arguments.length<1){e=0}return function(){var Eo,Eq,Ep;do{Eo=Math.random()*2-1;Eq=Math.random()*2-1;Ep=Eo*Eo+Eq*Eq}while(!Ep||Ep>1);return e+En*Eo*Math.sqrt(-2*Math.log(Ep)/Ep)}}};function EL(e){return e!=null&&!isNaN(e)}d3.sum=function(Er,Ep){var Eo=0,Eq=Er.length,e,En=-1;if(arguments.length===1){while(++En<Eq){if(!isNaN(e=+Er[En])){Eo+=e}}}else{while(++En<Eq){if(!isNaN(e=+Ep.call(Er,Er[En],En))){Eo+=e}}}return Eo};d3.quantile=function(Eo,Es){var Ep=(Eo.length-1)*Es+1,Eq=Math.floor(Ep),En=Eo[Eq-1],Er=Ep-Eq;return Er?En+Er*(Eo[Eq]-En):En};d3.transpose=function(e){return d3.zip.apply(d3,e)};d3.zip=function(){if(!(Er=arguments.length)){return[]}for(var Ep=-1,e=d3.min(arguments,Cr),Eo=new Array(e);++Ep<e;){for(var En=-1,Er,Eq=Eo[Ep]=new Array(Er);++En<Er;){Eq[En]=arguments[En][Ep]}}return Eo};function Cr(e){return e.length}d3.bisector=function(e){return{left:function(Eo,En,Er,Eq){if(arguments.length<3){Er=0}if(arguments.length<4){Eq=Eo.length}while(Er<Eq){var Ep=Er+Eq>>1;if(e.call(Eo,Eo[Ep],Ep)<En){Er=Ep+1}else{Eq=Ep}}return Er},right:function(Eo,En,Er,Eq){if(arguments.length<3){Er=0}if(arguments.length<4){Eq=Eo.length}while(Er<Eq){var Ep=Er+Eq>>1;if(En<e.call(Eo,Eo[Ep],Ep)){Eq=Ep}else{Er=Ep+1}}return Er}}};var Dg=d3.bisector(function(e){return e});d3.bisectLeft=Dg.left;d3.bisect=d3.bisectRight=Dg.right;d3.first=function(Er,Ep){var Eo=0,Eq=Er.length,En=Er[0],e;if(arguments.length===1){Ep=d3.ascending}while(++Eo<Eq){if(Ep.call(Er,En,e=Er[Eo])>0){En=e}}return En};d3.last=function(Er,Ep){var Eo=0,Eq=Er.length,En=Er[0],e;if(arguments.length===1){Ep=d3.ascending}while(++Eo<Eq){if(Ep.call(Er,En,e=Er[Eo])<=0){En=e}}return En};d3.nest=function(){var Ep={},Eo=[],Es=[],En,Eq;function Er(E0,Ey){if(Ey>=Eo.length){return Eq?Eq.call(Ep,E0):(En?E0.sort(En):E0)}var Ez=-1,Eu=E0.length,E2=Eo[Ey++],Ex,Ew,Ev=new AC,E1,Et={};while(++Ez<Eu){if(E1=Ev.get(Ex=E2(Ew=E0[Ez]))){E1.push(Ew)}else{Ev.set(Ex,[Ew])}}Ev.forEach(function(E3){Et[E3]=Er(Ev.get(E3),Ey)});return Et}function e(Ew,Ex){if(Ex>=Eo.length){return Ew}var Et=[],Eu=Es[Ex++],Ev;for(Ev in Ew){Et.push({key:Ev,values:e(Ew[Ev],Ex)})}if(Eu){Et.sort(function(Ez,Ey){return Eu(Ez.key,Ey.key)})}return Et}Ep.map=function(Et){return Er(Et,0)};Ep.entries=function(Et){return e(Er(Et,0),0)};Ep.key=function(Et){Eo.push(Et);return Ep};Ep.sortKeys=function(Et){Es[Eo.length-1]=Et;return Ep};Ep.sortValues=function(Et){En=Et;return Ep};Ep.rollup=function(Et){Eq=Et;return Ep};return Ep};d3.keys=function(Eo){var En=[];for(var e in Eo){En.push(e)}return En};d3.values=function(Eo){var e=[];for(var En in Eo){e.push(Eo[En])}return e};d3.entries=function(Eo){var e=[];for(var En in Eo){e.push({key:En,value:Eo[En]})}return e};d3.permute=function(Eq,En){var e=[],Eo=-1,Ep=En.length;while(++Eo<Ep){e[Eo]=Eq[En[Eo]]}return e};d3.merge=function(e){return Array.prototype.concat.apply([],e)};d3.split=function(Es,Eq){var Ep=[],e=[],Eo,En=-1,Er=Es.length;if(arguments.length<2){Eq=CY}while(++En<Er){if(Eq.call(e,Eo=Es[En],En)){e=[]}else{if(!e.length){Ep.push(e)}e.push(Eo)}}return Ep};function CY(e){return e==null}function BJ(e){return e.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}d3.range=function(Es,Eq,Er){if(arguments.length<3){Er=1;if(arguments.length<2){Eq=Es;Es=0}}if((Eq-Es)/Er===Infinity){throw new Error("infinite range")}var En=[],e=Dd(Math.abs(Er)),Ep=-1,Eo;Es*=e,Eq*=e,Er*=e;if(Er<0){while((Eo=Es+Er*++Ep)>Eq){En.push(Eo/e)}}else{while((Eo=Es+Er*++Ep)<Eq){En.push(Eo/e)}}return En};function Dd(e){var En=1;while(e*En%1){En*=10}return En}d3.requote=function(e){return e.replace(BY,"\\$&")};var BY=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(e,En){return En?Math.round(e*(En=Math.pow(10,En)))/En:Math.round(e)};d3.xhr=function(e,Eo,Ep){var En=new XMLHttpRequest;if(arguments.length<3){Ep=Eo,Eo=null}else{if(Eo&&En.overrideMimeType){En.overrideMimeType(Eo)}}En.open("GET",e,true);if(Eo){En.setRequestHeader("Accept",Eo)}En.onreadystatechange=function(){if(En.readyState===4){Ep(En.status<300?En:null)}};En.send(null)};d3.text=function(e,Eo,Ep){function En(Eq){Ep(Eq&&Eq.responseText)}if(arguments.length<3){Ep=Eo;Eo=null}d3.xhr(e,Eo,En)};d3.json=function(e,En){d3.text(e,"application/json",function(Eo){En(Eo?JSON.parse(Eo):null)})};d3.html=function(e,En){d3.text(e,"text/html",function(Ep){if(Ep!=null){var Eo=document.createRange();Eo.selectNode(document.body);Ep=Eo.createContextualFragment(Ep)}En(Ep)})};d3.xml=function(e,Eo,Ep){function En(Eq){Ep(Eq&&Eq.responseXML)}if(arguments.length<3){Ep=Eo;Eo=null}d3.xhr(e,Eo,En)};var CB={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};d3.ns={prefix:CB,qualify:function(e){var En=e.indexOf(":"),Eo=e;if(En>=0){Eo=e.substring(0,En);e=e.substring(En+1)}return CB.hasOwnProperty(Eo)?{space:CB[Eo],local:e}:e}};d3.dispatch=function(){var e=new CW,En=-1,Eo=arguments.length;while(++En<Eo){e[arguments[En]]=Cu(e)}return e};function CW(){}CW.prototype.on=function(Eo,Ep){var En=Eo.indexOf("."),e="";if(En>0){e=Eo.substring(En+1);Eo=Eo.substring(0,En)}return arguments.length<2?this[Eo].on(e):this[Eo].on(e,Ep)};function Cu(e){var Eo=[],En=new AC;function Ep(){var Es=Eo,Er=-1,Et=Es.length,Eq;while(++Er<Et){if(Eq=Es[Er].on){Eq.apply(this,arguments)}}return e}Ep.on=function(Er,Et){var Eq=En.get(Er),Es;if(arguments.length<2){return Eq&&Eq.on}if(Eq){Eq.on=null;Eo=Eo.slice(0,Es=Eo.indexOf(Eq)).concat(Eo.slice(Es+1));En.remove(Er)}if(Et){Eo.push(En.set(Er,{on:Et}))}return e};return Ep}d3.format=function(Eu){var Er=BC.exec(Eu),Ew=Er[1]||" ",En=Er[3]||"",Ep=Er[5],e=+Er[6],Ex=Er[7],Es=Er[8],Et=Er[9],Eo=1,Ev="",Eq=false;if(Es){Es=+Es.substring(1)}if(Ep){Ew="0";if(Ex){e-=Math.floor((e-1)/4)}}switch(Et){case"n":Ex=true;Et="g";break;case"%":Eo=100;Ev="%";Et="f";break;case"p":Eo=100;Ev="%";Et="r";break;case"d":Eq=true;Es=0;break;case"s":Eo=-1;Et="r";break}if(Et=="r"&&!Es){Et="g"}Et=R.get(Et)||AY;return function(E1){if(Eq&&(E1%1)){return""}var Ey=(E1<0)&&(E1=-E1)?"\u2212":En;if(Eo<0){var E0=d3.formatPrefix(E1,Es);E1*=E0.scale;Ev=E0.symbol}else{E1*=Eo}E1=Et(E1,Es);if(Ep){var Ez=E1.length+Ey.length;if(Ez<e){E1=new Array(e-Ez+1).join(Ew)+E1}if(Ex){E1=Bb(E1)}E1=Ey+E1}else{if(Ex){E1=Bb(E1)}E1=Ey+E1;var Ez=E1.length;if(Ez<e){E1=new Array(e-Ez+1).join(Ew)+E1}}return E1+Ev}};var BC=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/;var R=d3.map({g:function(e,En){return e.toPrecision(En)},e:function(e,En){return e.toExponential(En)},f:function(e,En){return e.toFixed(En)},r:function(e,En){return d3.round(e,En=CD(e,En)).toFixed(Math.max(0,Math.min(20,En)))}});function CD(e,En){return En-(e?1+Math.floor(Math.log(e+Math.pow(10,1+Math.floor(Math.log(e)/Math.LN10)-En))/Math.LN10):1)}function AY(e){return e+""}function Bb(Ep){var En=Ep.lastIndexOf("."),Eo=En>=0?Ep.substring(En):(En=Ep.length,""),e=[];while(En>0){e.push(Ep.substring(En-=3,En+3))}return e.reverse().join(",")+Eo}var A9=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(Bt);d3.formatPrefix=function(Eo,e){var En=0;if(Eo){if(Eo<0){Eo*=-1}if(e){Eo=d3.round(Eo,CD(Eo,e))}En=1+Math.floor(1e-12+Math.log(Eo)/Math.LN10);En=Math.max(-24,Math.min(24,Math.floor((En<=0?En+1:En-1)/3)*3))}return A9[8+En/3]};function Bt(En,e){return{scale:Math.pow(10,(8-e)*3),symbol:En}}var Au=AH(2),Y=AH(3),EG=function(){return Ba};var l=d3.map({linear:EG,poly:AH,quad:function(){return Au},cubic:function(){return Y},sin:function(){return DX},exp:function(){return C4},circle:function(){return B9},elastic:k,back:D5,bounce:function(){return A3}});var I=d3.map({"in":Ba,out:U,"in-out":AO,"out-in":function(e){return AO(U(e))}});d3.ease=function(En){var Ep=En.indexOf("-"),Eo=Ep>=0?En.substring(0,Ep):En,e=Ep>=0?En.substring(Ep+1):"in";Eo=l.get(Eo)||EG;e=I.get(e)||Ba;return DB(e(Eo.apply(null,Array.prototype.slice.call(arguments,1))))};function DB(e){return function(En){return En<=0?0:En>=1?1:e(En)}}function U(e){return function(En){return 1-e(1-En)}}function AO(e){return function(En){return 0.5*(En<0.5?e(2*En):(2-e(2-2*En)))}}function Ba(e){return e}function AH(En){return function(e){return Math.pow(e,En)}}function DX(e){return 1-Math.cos(e*Math.PI/2)}function C4(e){return Math.pow(2,10*(e-1))}function B9(e){return 1-Math.sqrt(1-e*e)}function k(e,Eo){var En;if(arguments.length<2){Eo=0.45}if(arguments.length<1){e=1;En=Eo/4}else{En=Eo/(2*Math.PI)*Math.asin(1/e)}return function(Ep){return 1+e*Math.pow(2,10*-Ep)*Math.sin((Ep-En)*2*Math.PI/Eo)}}function D5(e){if(!e){e=1.70158}return function(En){return En*En*((e+1)*En-e)}}function A3(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+0.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+0.9375:7.5625*(e-=2.625/2.75)*e+0.984375}d3.event=null;function EW(){d3.event.stopPropagation();d3.event.preventDefault()}function n(){var Eo=d3.event,En;while(En=Eo.sourceEvent){Eo=En}return Eo}function EF(Eo){var e=new CW,En=0,Ep=arguments.length;while(++En<Ep){e[arguments[En]]=Cu(e)}e.of=function(Er,Eq){return function(Es){try{var Et=Es.sourceEvent=d3.event;Es.target=Eo;d3.event=Es;e[Es.type].apply(Er,Eq)}finally{d3.event=Et}}};return e}d3.interpolate=function(En,e){var Eo=d3.interpolators.length,Ep;while(--Eo>=0&&!(Ep=d3.interpolators[Eo](En,e))){}return Ep};d3.interpolateNumber=function(En,e){e-=En;return function(Eo){return En+e*Eo}};d3.interpolateRound=function(En,e){e-=En;return function(Eo){return Math.round(En+e*Eo)}};d3.interpolateString=function(Et,Es){var Ep,Er,Eq,Ev=0,Eu=0,Ew=[],e=[],Eo,En;DK.lastIndex=0;for(Er=0;Ep=DK.exec(Es);++Er){if(Ep.index){Ew.push(Es.substring(Ev,Eu=Ep.index))}e.push({i:Ew.length,x:Ep[0]});Ew.push(null);Ev=DK.lastIndex}if(Ev<Es.length){Ew.push(Es.substring(Ev))}for(Er=0,Eo=e.length;(Ep=DK.exec(Et))&&Er<Eo;++Er){En=e[Er];if(En.x==Ep[0]){if(En.i){if(Ew[En.i+1]==null){Ew[En.i-1]+=En.x;Ew.splice(En.i,1);for(Eq=Er+1;Eq<Eo;++Eq){e[Eq].i--}}else{Ew[En.i-1]+=En.x+Ew[En.i+1];Ew.splice(En.i,2);for(Eq=Er+1;Eq<Eo;++Eq){e[Eq].i-=2}}}else{if(Ew[En.i+1]==null){Ew[En.i]=En.x}else{Ew[En.i]=En.x+Ew[En.i+1];Ew.splice(En.i+1,1);for(Eq=Er+1;Eq<Eo;++Eq){e[Eq].i--}}}e.splice(Er,1);Eo--;Er--}else{En.x=d3.interpolateNumber(parseFloat(Ep[0]),parseFloat(En.x))}}while(Er<Eo){En=e.pop();if(Ew[En.i+1]==null){Ew[En.i]=En.x}else{Ew[En.i]=En.x+Ew[En.i+1];Ew.splice(En.i+1,1)}Eo--}if(Ew.length===1){return Ew[0]==null?e[0].x:function(){return Es}}return function(Ex){for(Er=0;Er<Eo;++Er){Ew[(En=e[Er]).i]=En.x(Ex)}return Ew.join("")}};d3.interpolateTransform=function(Ez,Ey){var E0=[],En=[],Er,Eq=d3.transform(Ez),Ep=d3.transform(Ey),Ev=Eq.translate,Eu=Ep.translate,Eo=Eq.rotate,e=Ep.rotate,Et=Eq.skew,Es=Ep.skew,Ex=Eq.scale,Ew=Ep.scale;if(Ev[0]!=Eu[0]||Ev[1]!=Eu[1]){E0.push("translate(",null,",",null,")");En.push({i:1,x:d3.interpolateNumber(Ev[0],Eu[0])},{i:3,x:d3.interpolateNumber(Ev[1],Eu[1])})}else{if(Eu[0]||Eu[1]){E0.push("translate("+Eu+")")}else{E0.push("")}}if(Eo!=e){En.push({i:E0.push(E0.pop()+"rotate(",null,")")-2,x:d3.interpolateNumber(Eo,e)})}else{if(e){E0.push(E0.pop()+"rotate("+e+")")}}if(Et!=Es){En.push({i:E0.push(E0.pop()+"skewX(",null,")")-2,x:d3.interpolateNumber(Et,Es)})}else{if(Es){E0.push(E0.pop()+"skewX("+Es+")")}}if(Ex[0]!=Ew[0]||Ex[1]!=Ew[1]){Er=E0.push(E0.pop()+"scale(",null,",",null,")");En.push({i:Er-4,x:d3.interpolateNumber(Ex[0],Ew[0])},{i:Er-2,x:d3.interpolateNumber(Ex[1],Ew[1])})}else{if(Ew[0]!=1||Ew[1]!=1){E0.push(E0.pop()+"scale("+Ew+")")}}Er=En.length;return function(E2){var E1=-1,E3;while(++E1<Er){E0[(E3=En[E1]).i]=E3.x(E2)}return E0.join("")}};d3.interpolateRgb=function(En,e){En=d3.rgb(En);e=d3.rgb(e);var Ep=En.r,Eo=En.g,Es=En.b,Er=e.r-Ep,Eq=e.g-Eo,Et=e.b-Es;return function(Eu){return"#"+BA(Math.round(Ep+Er*Eu))+BA(Math.round(Eo+Eq*Eu))+BA(Math.round(Es+Et*Eu))}};d3.interpolateHsl=function(Eo,e){Eo=d3.hsl(Eo);e=d3.hsl(e);var Et=Eo.h,Es=Eo.s,Ep=Eo.l,Er=e.h-Et,Eq=e.s-Es,En=e.l-Ep;return function(Eu){return AU(Et+Er*Eu,Es+Eq*Eu,Ep+En*Eu).toString()}};d3.interpolateArray=function(Eq,Eo){var En=[],Et=[],Ep=Eq.length,e=Eo.length,Es=Math.min(Eq.length,Eo.length),Er;for(Er=0;Er<Es;++Er){En.push(d3.interpolate(Eq[Er],Eo[Er]))}for(;Er<Ep;++Er){Et[Er]=Eq[Er]}for(;Er<e;++Er){Et[Er]=Eo[Er]}return function(Eu){for(Er=0;Er<Es;++Er){Et[Er]=En[Er](Eu)}return Et}};d3.interpolateObject=function(En,e){var Ep={},Eq={},Eo;for(Eo in En){if(Eo in e){Ep[Eo]=C5(Eo)(En[Eo],e[Eo])}else{Eq[Eo]=En[Eo]}}for(Eo in e){if(!(Eo in En)){Eq[Eo]=e[Eo]}}return function(Er){for(Eo in Ep){Eq[Eo]=Ep[Eo](Er)}return Eq}};var DK=/[-+]?(?:\d*\.?\d+)(?:[eE][-+]?\d+)?/g;function C5(e){return e=="transform"?d3.interpolateTransform:d3.interpolate}d3.interpolators=[d3.interpolateObject,function(En,e){return(e instanceof Array)&&d3.interpolateArray(En,e)},function(En,e){return(typeof En==="string"||typeof e==="string")&&d3.interpolateString(En+"",e+"")},function(En,e){return(typeof e==="string"?p.has(e)||/^(#|rgb\(|hsl\()/.test(e):e instanceof Cl||e instanceof C3)&&d3.interpolateRgb(En,e)},function(En,e){return !isNaN(En=+En)&&!isNaN(e=+e)&&d3.interpolateNumber(En,e)}];function EO(En,e){e=e-(En=+En)?1/(e-En):0;return function(Eo){return(Eo-En)*e}}function x(En,e){e=e-(En=+En)?1/(e-En):0;return function(Eo){return Math.max(0,Math.min(1,(Eo-En)*e))}}d3.rgb=function(Eo,En,e){return arguments.length===1?(Eo instanceof Cl?CG(Eo.r,Eo.g,Eo.b):AJ(""+Eo,CG,AU)):CG(~~Eo,~~En,~~e)};function CG(Eo,En,e){return new Cl(Eo,En,e)}function Cl(Eo,En,e){this.r=Eo;this.g=En;this.b=e}Cl.prototype.brighter=function(En){En=Math.pow(0.7,arguments.length?En:1);var Eq=this.r,Ep=this.g,e=this.b,Eo=30;if(!Eq&&!Ep&&!e){return CG(Eo,Eo,Eo)}if(Eq&&Eq<Eo){Eq=Eo}if(Ep&&Ep<Eo){Ep=Eo}if(e&&e<Eo){e=Eo}return CG(Math.min(255,Math.floor(Eq/En)),Math.min(255,Math.floor(Ep/En)),Math.min(255,Math.floor(e/En)))};Cl.prototype.darker=function(e){e=Math.pow(0.7,arguments.length?e:1);return CG(Math.floor(e*this.r),Math.floor(e*this.g),Math.floor(e*this.b))};Cl.prototype.hsl=function(){return Dk(this.r,this.g,this.b)};Cl.prototype.toString=function(){return"#"+BA(this.r)+BA(this.g)+BA(this.b)};function BA(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function AJ(Er,Ep,Es){var e=0,Eo=0,Eq=0,Eu,Et,En;Eu=/([a-z]+)\((.*)\)/i.exec(Er);if(Eu){Et=Eu[2].split(",");switch(Eu[1]){case"hsl":return Es(parseFloat(Et[0]),parseFloat(Et[1])/100,parseFloat(Et[2])/100);case"rgb":return Ep(CZ(Et[0]),CZ(Et[1]),CZ(Et[2]))}}if(En=p.get(Er)){return Ep(En.r,En.g,En.b)}if(Er!=null&&Er.charAt(0)==="#"){if(Er.length===4){e=Er.charAt(1);e+=e;Eo=Er.charAt(2);Eo+=Eo;Eq=Er.charAt(3);Eq+=Eq}else{if(Er.length===7){e=Er.substring(1,3);Eo=Er.substring(3,5);Eq=Er.substring(5,7)}}e=parseInt(e,16);Eo=parseInt(Eo,16);Eq=parseInt(Eq,16)}return Ep(e,Eo,Eq)}function Dk(e,Eq,Es){var Eo=Math.min(e/=255,Eq/=255,Es/=255),Et=Math.max(e,Eq,Es),Er=Et-Eo,Ep,Eu,En=(Et+Eo)/2;if(Er){Eu=En<0.5?Er/(Et+Eo):Er/(2-Et-Eo);if(e==Et){Ep=(Eq-Es)/Er+(Eq<Es?6:0)}else{if(Eq==Et){Ep=(Es-e)/Er+2}else{Ep=(e-Eq)/Er+4}}Ep*=60}else{Eu=Ep=0}return CP(Ep,Eu,En)}function CZ(En){var e=parseFloat(En);return En.charAt(En.length-1)==="%"?Math.round(e*2.55):e}var p=d3.map({aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"});p.forEach(function(e,En){p.set(e,AJ(En,CG,AU))});d3.hsl=function(Eo,En,e){return arguments.length===1?(Eo instanceof C3?CP(Eo.h,Eo.s,Eo.l):AJ(""+Eo,Dk,CP)):CP(+Eo,+En,+e)};function CP(Eo,En,e){return new C3(Eo,En,e)}function C3(Eo,En,e){this.h=Eo;this.s=En;this.l=e}C3.prototype.brighter=function(e){e=Math.pow(0.7,arguments.length?e:1);return CP(this.h,this.s,this.l/e)};C3.prototype.darker=function(e){e=Math.pow(0.7,arguments.length?e:1);return CP(this.h,this.s,e*this.l)};C3.prototype.rgb=function(){return AU(this.h,this.s,this.l)};C3.prototype.toString=function(){return this.rgb().toString()};function AU(Er,Eq,e){var Ep,Eo;Er=Er%360;if(Er<0){Er+=360}Eq=Eq<0?0:Eq>1?1:Eq;e=e<0?0:e>1?1:e;Eo=e<=0.5?e*(1+Eq):e+Eq-e*Eq;Ep=2*e-Eo;function En(Et){if(Et>360){Et-=360}else{if(Et<0){Et+=360}}if(Et<60){return Ep+(Eo-Ep)*Et/60}if(Et<180){return Eo}if(Et<240){return Ep+(Eo-Ep)*(240-Et)/60}return Ep}function Es(Et){return Math.round(En(Et)*255)}return CG(Es(Er+120),Es(Er),Es(Er-120))}function B2(e){Ca(e,B1);return e}var Bf=function(e,En){return En.querySelector(e)},DT=function(e,En){return En.querySelectorAll(e)},CO=document.documentElement,B=CO.matchesSelector||CO.webkitMatchesSelector||CO.mozMatchesSelector||CO.msMatchesSelector||CO.oMatchesSelector,A=function(En,e){return B.call(En,e)};if(typeof Sizzle==="function"){Bf=function(e,En){return Sizzle(e,En)[0]};DT=function(e,En){return Sizzle.uniqueSort(Sizzle(e,En))};A=Sizzle.matchesSelector}var B1=[];d3.selection=function(){return Dz};d3.selection.prototype=B1;B1.select=function(Er){var Eo=[],Ev,e,Eu,Ep;if(typeof Er!=="function"){Er=S(Er)}for(var Es=-1,Eq=this.length;++Es<Eq;){Eo.push(Ev=[]);Ev.parentNode=(Eu=this[Es]).parentNode;for(var Et=-1,En=Eu.length;++Et<En;){if(Ep=Eu[Et]){Ev.push(e=Er.call(Ep,Ep.__data__,Et));if(e&&"__data__" in Ep){e.__data__=Ep.__data__}}else{Ev.push(null)}}}return B2(Eo)};function S(e){return function(){return Bf(e,this)}}B1.selectAll=function(Eq){var En=[],Eu,Eo;if(typeof Eq!=="function"){Eq=BU(Eq)}for(var Er=-1,Ep=this.length;++Er<Ep;){for(var Et=this[Er],Es=-1,e=Et.length;++Es<e;){if(Eo=Et[Es]){En.push(Eu=Bu(Eq.call(Eo,Eo.__data__,Es)));Eu.parentNode=Eo}}}return B2(En)};function BU(e){return function(){return DT(e,this)}}B1.attr=function(En,Et){En=d3.ns.qualify(En);if(arguments.length<2){var Er=this.node();return En.local?Er.getAttributeNS(En.space,En.local):Er.getAttribute(En)}function Eo(){this.removeAttribute(En)}function Eq(){this.removeAttributeNS(En.space,En.local)}function Eu(){this.setAttribute(En,Et)}function Ep(){this.setAttributeNS(En.space,En.local,Et)}function Es(){var Ev=Et.apply(this,arguments);if(Ev==null){this.removeAttribute(En)}else{this.setAttribute(En,Ev)}}function e(){var Ev=Et.apply(this,arguments);if(Ev==null){this.removeAttributeNS(En.space,En.local)}else{this.setAttributeNS(En.space,En.local,Ev)}}return this.each(Et==null?(En.local?Eq:Eo):(typeof Et==="function"?(En.local?e:Es):(En.local?Ep:Eu)))};B1.classed=function(e,Eo){var Ep=e.split(G),Eq=Ep.length,En=-1;if(arguments.length>1){while(++En<Eq){Dq.call(this,Ep[En],Eo)}return this}else{while(++En<Eq){if(!Dq.call(this,Ep[En])){return false}}return true}};var G=/\s+/g;function Dq(e,Eq){var En=new RegExp("(^|\\s+)"+d3.requote(e)+"(\\s+|$)","g");if(arguments.length<2){var Ep=this.node();if(Et=Ep.classList){return Et.contains(e)}var Et=Ep.className;En.lastIndex=0;return En.test(Et.baseVal!=null?Et.baseVal:Et)}function Es(){if(Ew=this.classList){return Ew.add(e)}var Ew=this.className,Eu=Ew.baseVal!=null,Ev=Eu?Ew.baseVal:Ew;En.lastIndex=0;if(!En.test(Ev)){Ev=BJ(Ev+" "+e);if(Eu){Ew.baseVal=Ev}else{this.className=Ev}}}function Er(){if(Ew=this.classList){return Ew.remove(e)}var Ew=this.className,Eu=Ew.baseVal!=null,Ev=Eu?Ew.baseVal:Ew;Ev=BJ(Ev.replace(En," "));if(Eu){Ew.baseVal=Ev}else{this.className=Ev}}function Eo(){(Eq.apply(this,arguments)?Es:Er).call(this)}return this.each(typeof Eq==="function"?Eo:Eq?Es:Er)}B1.style=function(Eo,Er,Ep){if(arguments.length<3){Ep=""}if(arguments.length<2){return window.getComputedStyle(this.node(),null).getPropertyValue(Eo)}function En(){this.style.removeProperty(Eo)}function Eq(){this.style.setProperty(Eo,Er,Ep)}function e(){var Es=Er.apply(this,arguments);if(Es==null){this.style.removeProperty(Eo)}else{this.style.setProperty(Eo,Es,Ep)}}return this.each(Er==null?En:(typeof Er==="function"?e:Eq))};B1.property=function(En,Ep){if(arguments.length<2){return this.node()[En]}function e(){delete this[En]}function Eo(){this[En]=Ep}function Eq(){var Er=Ep.apply(this,arguments);if(Er==null){delete this[En]}else{this[En]=Er}}return this.each(Ep==null?e:(typeof Ep==="function"?Eq:Eo))};B1.text=function(e){return arguments.length<1?this.node().textContent:this.each(typeof e==="function"?function(){var En=e.apply(this,arguments);this.textContent=En==null?"":En}:e==null?function(){this.textContent=""}:function(){this.textContent=e})};B1.html=function(e){return arguments.length<1?this.node().innerHTML:this.each(typeof e==="function"?function(){var En=e.apply(this,arguments);this.innerHTML=En==null?"":En}:e==null?function(){this.innerHTML=""}:function(){this.innerHTML=e})};B1.append=function(En){En=d3.ns.qualify(En);function e(){return this.appendChild(document.createElementNS(this.namespaceURI,En))}function Eo(){return this.appendChild(document.createElementNS(En.space,En.local))}return this.select(En.local?Eo:e)};B1.insert=function(e,Eo){e=d3.ns.qualify(e);function En(){return this.insertBefore(document.createElementNS(this.namespaceURI,e),Bf(Eo,this))}function Ep(){return this.insertBefore(document.createElementNS(e.space,e.local),Bf(Eo,this))}return this.select(e.local?Ep:En)};B1.remove=function(){return this.each(function(){var e=this.parentNode;if(e){e.removeChild(this)}})};B1.data=function(Et,Ev){var Eq=-1,En=this.length,Eu,Eo;if(!arguments.length){Et=new Array(En=(Eu=this[0]).length);while(++Eq<En){if(Eo=Eu[Eq]){Et[Eq]=Eo.__data__}}return Et}function Er(E8,E0){var E3,Ex=E8.length,Ez=E0.length,E6=Math.min(Ex,Ez),E5=Math.max(Ex,Ez),FA=[],E7=[],E4=[],Ey,Ew;if(Ev){var FB=new AC,E9=[],E2,E1=E0.length;for(E3=-1;++E3<Ex;){E2=Ev.call(Ey=E8[E3],Ey.__data__,E3);if(FB.has(E2)){E4[E1++]=Ey}else{FB.set(E2,Ey)}E9.push(E2)}for(E3=-1;++E3<Ez;){E2=Ev.call(E0,Ew=E0[E3],E3);if(FB.has(E2)){FA[E3]=Ey=FB.get(E2);Ey.__data__=Ew;E7[E3]=E4[E3]=null}else{E7[E3]=a(Ew);FA[E3]=E4[E3]=null}FB.remove(E2)}for(E3=-1;++E3<Ex;){if(FB.has(E9[E3])){E4[E3]=E8[E3]}}}else{for(E3=-1;++E3<E6;){Ey=E8[E3];Ew=E0[E3];if(Ey){Ey.__data__=Ew;FA[E3]=Ey;E7[E3]=E4[E3]=null}else{E7[E3]=a(Ew);FA[E3]=E4[E3]=null}}for(;E3<Ez;++E3){E7[E3]=a(E0[E3]);FA[E3]=E4[E3]=null}for(;E3<E5;++E3){E4[E3]=E8[E3];E7[E3]=FA[E3]=null}}E7.update=FA;E7.parentNode=FA.parentNode=E4.parentNode=E8.parentNode;Es.push(E7);Ep.push(FA);e.push(E4)}var Es=Ar([]),Ep=B2([]),e=B2([]);if(typeof Et==="function"){while(++Eq<En){Er(Eu=this[Eq],Et.call(Eu,Eu.parentNode.__data__,Eq))}}else{while(++Eq<En){Er(Eu=this[Eq],Et)}}Ep.enter=function(){return Es};Ep.exit=function(){return e};return Ep};function a(e){return{__data__:e}}B1.datum=B1.map=function(e){return arguments.length<1?this.property("__data__"):this.property("__data__",e)};B1.filter=function(e){var Eo=[],Eu,Et,Ep;if(typeof e!=="function"){e=AQ(e)}for(var Er=0,Eq=this.length;Er<Eq;Er++){Eo.push(Eu=[]);Eu.parentNode=(Et=this[Er]).parentNode;for(var Es=0,En=Et.length;Es<En;Es++){if((Ep=Et[Es])&&e.call(Ep,Ep.__data__,Es)){Eu.push(Ep)}}}return B2(Eo)};function AQ(e){return function(){return A(this,e)}}B1.order=function(){for(var En=-1,e=this.length;++En<e;){for(var Er=this[En],Eo=Er.length-1,Ep=Er[Eo],Eq;--Eo>=0;){if(Eq=Er[Eo]){if(Ep&&Ep!==Eq.nextSibling){Ep.parentNode.insertBefore(Eq,Ep)}Ep=Eq}}}return this};B1.sort=function(En){En=Dv.apply(this,arguments);for(var Eo=-1,e=this.length;++Eo<e;){this[Eo].sort(En)}return this.order()};function Dv(e){if(!arguments.length){e=d3.ascending}return function(Eo,En){return e(Eo&&Eo.__data__,En&&En.__data__)}}B1.on=function(Ep,Eq,e){if(arguments.length<3){e=false}var En="__on"+Ep,Eo=Ep.indexOf(".");if(Eo>0){Ep=Ep.substring(0,Eo)}if(arguments.length<2){return(Eo=this.node()[En])&&Eo._}return this.each(function(Ev,Es){var Et=this,Eu=Et[En];if(Eu){Et.removeEventListener(Ep,Eu,Eu.$);delete Et[En]}if(Eq){Et.addEventListener(Ep,Et[En]=Er,Er.$=e);Er._=Eq}function Er(Ew){var Ex=d3.event;d3.event=Ew;try{Eq.call(Et,Et.__data__,Es)}finally{d3.event=Ex}}})};B1.each=function(Es){for(var En=-1,e=this.length;++En<e;){for(var Eq=this[En],Eo=-1,Er=Eq.length;++Eo<Er;){var Ep=Eq[Eo];if(Ep){Es.call(Ep,Ep.__data__,Eo,En)}}}return this};B1.call=function(e){e.apply(this,(arguments[0]=this,arguments));return this};B1.empty=function(){return !this.node()};B1.node=function(Es){for(var En=0,e=this.length;En<e;En++){for(var Eq=this[En],Eo=0,Er=Eq.length;Eo<Er;Eo++){var Ep=Eq[Eo];if(Ep){return Ep}}}return null};B1.transition=function(){var En=[],Eo,Er;for(var Ep=-1,e=this.length;++Ep<e;){En.push(Eo=[]);for(var Es=this[Ep],Eq=-1,Et=Es.length;++Eq<Et;){Eo.push((Er=Es[Eq])?{node:Er,delay:Cf,duration:D6}:null)}}return Dx(En,ED||++ER,Date.now())};var Dz=B2([[document]]);Dz[0].parentNode=CO;d3.select=function(e){return typeof e==="string"?Dz.select(e):B2([[e]])};d3.selectAll=function(e){return typeof e==="string"?Dz.selectAll(e):B2([Bu(e)])};function Ar(e){Ca(e,Ci);return e}var Ci=[];d3.selection.enter=Ar;d3.selection.enter.prototype=Ci;Ci.append=B1.append;Ci.insert=B1.insert;Ci.empty=B1.empty;Ci.node=B1.node;Ci.select=function(Er){var Eo=[],Ew,e,Eu,Ev,Eq;for(var Es=-1,Ep=this.length;++Es<Ep;){Eu=(Ev=this[Es]).update;Eo.push(Ew=[]);Ew.parentNode=Ev.parentNode;for(var Et=-1,En=Ev.length;++Et<En;){if(Eq=Ev[Et]){Ew.push(Eu[Et]=e=Er.call(Ev.parentNode,Eq.__data__,Et));e.__data__=Eq.__data__}else{Ew.push(null)}}}return B2(Eo)};function Dx(e,Er,Ep){Ca(e,CJ);var Eo=new AC,En=d3.dispatch("start","end"),Eq=AV;e.id=Er;e.time=Ep;e.tween=function(Es,Et){if(arguments.length<2){return Eo.get(Es)}if(Et==null){Eo.remove(Es)}else{Eo.set(Es,Et)}return e};e.ease=function(Es){if(!arguments.length){return Eq}Eq=typeof Es==="function"?Es:d3.ease.apply(d3,arguments);return e};e.each=function(Es,Et){if(arguments.length<2){return Bv.call(e,Es)}En.on(Es,Et);return e};d3.timer(function(Es){e.each(function(E0,Ex,Ew){var E2=[],Eu=this,Ey=e[Ew][Ex].delay,Ev=e[Ew][Ex].duration,E3=Eu.__transition__||(Eu.__transition__={active:0,count:0});++E3.count;Ey<=Es?Et(Es):d3.timer(Et,Ey,Ep);function Et(E4){if(E3.active>Er){return E1()}E3.active=Er;Eo.forEach(function(E5,E6){if(tween=E6.call(Eu,E0,Ex)){E2.push(tween)}});En.start.call(Eu,E0,Ex);if(!Ez(E4)){d3.timer(Ez,0,Ep)}return 1}function Ez(E4){if(E3.active!==Er){return E1()}var E5=(E4-Ey)/Ev,E6=Eq(E5),E7=E2.length;while(E7>0){E2[--E7].call(Eu,E6)}if(E5>=1){E1();ED=Er;En.end.call(Eu,E0,Ex);ED=0;return 1}}function E1(){if(!--E3.count){delete Eu.__transition__}return 1}});return 1},0,Ep);return e}var Q={};function D4(Eo,En,e){return e!=""&&Q}function E(Ep,e){var Eo=C5(Ep);function En(Eu,Et,Er){var Es=e.call(this,Eu,Et);return Es==null?Er!=""&&Q:Er!=Es&&Eo(Er,Es)}function Eq(Et,Es,Er){return Er!=e&&Eo(Er,e)}return typeof e==="function"?En:e==null?D4:(e+="",Eq)}var CJ=[],ER=0,ED=0,D=0,D2=250,Cv=d3.ease("cubic-in-out"),Cf=D,D6=D2,AV=Cv;CJ.call=B1.call;d3.transition=function(e){return arguments.length?(ED?e.transition():e):Dz.transition()};d3.transition.prototype=CJ;CJ.select=function(Er){var Eo=[],Ev,e,Ep;if(typeof Er!=="function"){Er=S(Er)}for(var Es=-1,Eq=this.length;++Es<Eq;){Eo.push(Ev=[]);for(var Eu=this[Es],Et=-1,En=Eu.length;++Et<En;){if((Ep=Eu[Et])&&(e=Er.call(Ep.node,Ep.node.__data__,Et))){if("__data__" in Ep.node){e.__data__=Ep.node.__data__}Ev.push({node:e,delay:Ep.delay,duration:Ep.duration})}else{Ev.push(null)}}}return Dx(Eo,this.id,this.time).ease(this.ease())};CJ.selectAll=function(Es){var Ep=[],Ex,e,Eq;if(typeof Es!=="function"){Es=BU(Es)}for(var Eu=-1,Er=this.length;++Eu<Er;){for(var Ew=this[Eu],Ev=-1,Eo=Ew.length;++Ev<Eo;){if(Eq=Ew[Ev]){e=Es.call(Eq.node,Eq.node.__data__,Ev);Ep.push(Ex=[]);for(var Et=-1,En=e.length;++Et<En;){Ex.push({node:e[Et],delay:Eq.delay,duration:Eq.duration})}}}}return Dx(Ep,this.id,this.time).ease(this.ease())};CJ.attr=function(e,En){return this.attrTween(e,E(e,En))};CJ.attrTween=function(e,Eo){var En=d3.ns.qualify(e);function Ep(Et,Er){var Es=Eo.call(this,Et,Er,this.getAttribute(En));return Es===Q?(this.removeAttribute(En),null):Es&&function(Eu){this.setAttribute(En,Es(Eu))}}function Eq(Et,Er){var Es=Eo.call(this,Et,Er,this.getAttributeNS(En.space,En.local));return Es===Q?(this.removeAttributeNS(En.space,En.local),null):Es&&function(Eu){this.setAttributeNS(En.space,En.local,Es(Eu))}}return this.tween("attr."+e,En.local?Eq:Ep)};CJ.style=function(e,Eo,En){if(arguments.length<3){En=""}return this.styleTween(e,E(e,Eo),En)};CJ.styleTween=function(e,Eo,En){if(arguments.length<3){En=""}return this.tween("style."+e,function(Er,Ep){var Eq=Eo.call(this,Er,Ep,window.getComputedStyle(this,null).getPropertyValue(e));return Eq===Q?(this.style.removeProperty(e),null):Eq&&function(Es){this.style.setProperty(e,Eq(Es),En)}})};CJ.text=function(e){return this.tween("text",function(Eo,En){this.textContent=typeof e==="function"?e.call(this,Eo,En):e})};CJ.remove=function(){return this.each("end.transition",function(){var e;if(!this.__transition__&&(e=this.parentNode)){e.removeChild(this)}})};CJ.delay=function(En){var e=this;return e.each(typeof En==="function"?function(Eq,Ep,Eo){e[Eo][Ep].delay=En.apply(this,arguments)|0}:(En=En|0,function(Eq,Ep,Eo){e[Eo][Ep].delay=En}))};CJ.duration=function(En){var e=this;return e.each(typeof En==="function"?function(Eq,Ep,Eo){e[Eo][Ep].duration=Math.max(1,En.apply(this,arguments)|0)}:(En=Math.max(1,En|0),function(Eq,Ep,Eo){e[Eo][Ep].duration=En}))};function Bv(Ew){var e=ED,Eq=AV,Eu=Cf,Er=D6;ED=this.id;AV=this.ease();for(var Es=0,Ep=this.length;Es<Ep;Es++){for(var Ev=this[Es],Et=0,En=Ev.length;Et<En;Et++){var Eo=Ev[Et];if(Eo){Cf=this[Es][Et].delay;D6=this[Es][Et].duration;Ew.call(Eo=Eo.node,Eo.__data__,Et,Es)}}}ED=e;AV=Eq;Cf=Eu;D6=Er;return this}CJ.transition=function(){return this.select(m)};var Ay=null,A6,Ct;d3.timer=function(Er,e,Eq){var Ep=false,Eo,En=Ay;if(arguments.length<3){if(arguments.length<2){e=0}else{if(!isFinite(e)){return}}Eq=Date.now()}while(En){if(En.callback===Er){En.then=Eq;En.delay=e;Ep=true;break}Eo=En;En=En.next}if(!Ep){Ay={callback:Er,then:Eq,delay:e,next:Ay}}if(!A6){Ct=clearTimeout(Ct);A6=1;EM(EN)}};function EN(){var e,Eo=Date.now(),Ep=Ay;while(Ep){e=Eo-Ep.then;if(e>=Ep.delay){Ep.flush=Ep.callback(e)}Ep=Ep.next}var En=Ck()-Eo;if(En>24){if(isFinite(En)){clearTimeout(Ct);Ct=setTimeout(EN,En)}A6=0}else{A6=1;EM(EN)}}d3.timer.flush=function(){var e,En=Date.now(),Eo=Ay;while(Eo){e=En-Eo.then;if(!Eo.delay){Eo.flush=Eo.callback(e)}Eo=Eo.next}Ck()};function Ck(){var En=null,e=Ay,Eo=Infinity;while(e){if(e.flush){e=En?En.next=e.next:Ay=e.next}else{Eo=Math.min(Eo,e.then+e.delay);e=(En=e).next}}return Eo}var EM=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,17)};d3.transform=function(En){var Eo=document.createElementNS(d3.ns.prefix.svg,"g"),e={a:1,b:0,c:0,d:1,e:0,f:0};return(d3.transform=function(Ep){Eo.setAttribute("transform",Ep);var Eq=Eo.transform.baseVal.consolidate();return new N(Eq?Eq.matrix:e)})(En)};function N(e){var Ep=[e.a,e.b],En=[e.c,e.d],Er=C2(Ep),Eo=Cb(Ep,En),Eq=C2(Ap(En,Ep,-Eo))||0;if(Ep[0]*En[1]<En[0]*Ep[1]){Ep[0]*=-1;Ep[1]*=-1;Er*=-1;Eo*=-1}this.rotate=(Er?Math.atan2(Ep[1],Ep[0]):Math.atan2(-En[0],En[1]))*CQ;this.translate=[e.e,e.f];this.scale=[Er,Eq];this.skew=Eq?Math.atan2(Eo,Eq)*CQ:0}N.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};function Cb(En,e){return En[0]*e[0]+En[1]*e[1]}function C2(e){var En=Math.sqrt(Cb(e,e));if(En){e[0]/=En;e[1]/=En}return En}function Ap(En,e,Eo){En[0]+=Eo*e[0];En[1]+=Eo*e[1];return En}var CQ=180/Math.PI;d3.mouse=function(e){return AK(e,n())};var BH=/WebKit/.test(navigator.userAgent)?-1:0;function AK(Ep,Es){var Eq=Ep.ownerSVGElement||Ep;if(Eq.createSVGPoint){var En=Eq.createSVGPoint();if((BH<0)&&(window.scrollX||window.scrollY)){Eq=d3.select(document.body).append("svg").style("position","absolute").style("top",0).style("left",0);var Eo=Eq[0][0].getScreenCTM();BH=!(Eo.f||Eo.e);Eq.remove()}if(BH){En.x=Es.pageX;En.y=Es.pageY}else{En.x=Es.clientX;En.y=Es.clientY}En=En.matrixTransform(Ep.getScreenCTM().inverse());return[En.x,En.y]}var Er=Ep.getBoundingClientRect();return[Es.clientX-Er.left-Ep.clientLeft,Es.clientY-Er.top-Ep.clientTop]}d3.touches=function(e,En){if(arguments.length<2){En=n().touches}return En?Bu(En).map(function(Ep){var Eo=AK(e,Ep);Eo.identifier=Ep.identifier;return Eo}):[]};function AB(){}d3.scale={};function CH(En){var Eo=En[0],e=En[En.length-1];return Eo<e?[Eo,e]:[e,Eo]}function AL(e){return e.rangeExtent?e.rangeExtent():CH(e.range())}function Dc(Es,Eq){var Er=0,Ep=Es.length-1,Eo=Es[Er],En=Es[Ep],e;if(En<Eo){e=Er;Er=Ep;Ep=e;e=Eo;Eo=En;En=e}if(e=En-Eo){Eq=Eq(e);Es[Er]=Eq.floor(Eo);Es[Ep]=Eq.ceil(En)}return Es}function CU(){return Math}d3.scale.linear=function(){return CE([0,1],[0,1],d3.interpolate,false)};function CE(Er,Ep,Eq,Et){var Eo,En;function e(){var Eu=Math.min(Er.length,Ep.length)>2?b:AA,Ev=Et?x:EO;Eo=Eu(Er,Ep,Ev,Eq);En=Eu(Ep,Er,Ev,d3.interpolate);return Es}function Es(Eu){return Eo(Eu)}Es.invert=function(Eu){return En(Eu)};Es.domain=function(Eu){if(!arguments.length){return Er}Er=Eu.map(Number);return e()};Es.range=function(Eu){if(!arguments.length){return Ep}Ep=Eu;return e()};Es.rangeRound=function(Eu){return Es.range(Eu).interpolate(d3.interpolateRound)};Es.clamp=function(Eu){if(!arguments.length){return Et}Et=Eu;return e()};Es.interpolate=function(Eu){if(!arguments.length){return Eq}Eq=Eu;return e()};Es.ticks=function(Eu){return Ce(Er,Eu)};Es.tickFormat=function(Eu){return Co(Er,Eu)};Es.nice=function(){Dc(Er,AE);return e()};Es.copy=function(){return CE(Er,Ep,Eq,Et)};return e()}function DU(En,e){return d3.rebind(En,e,"range","rangeRound","interpolate","clamp")}function AE(e){e=Math.pow(10,Math.round(Math.log(e)/Math.LN10)-1);return{floor:function(En){return Math.floor(En/e)*e},ceil:function(En){return Math.ceil(En/e)*e}}}function O(Er,e){var Eo=CH(Er),En=Eo[1]-Eo[0],Eq=Math.pow(10,Math.floor(Math.log(En/e)/Math.LN10)),Ep=e/En*Eq;if(Ep<=0.15){Eq*=10}else{if(Ep<=0.35){Eq*=5}else{if(Ep<=0.75){Eq*=2}}}Eo[0]=Math.ceil(Eo[0]/Eq)*Eq;Eo[1]=Math.floor(Eo[1]/Eq)*Eq+Eq*0.5;Eo[2]=Eq;return Eo}function Ce(En,e){return d3.range.apply(d3,O(En,e))}function Co(En,e){return d3.format(",."+Math.max(0,-Math.floor(Math.log(O(En,e)[2])/Math.LN10+0.01))+"f")}function AA(Eq,e,Er,Eo){var En=Er(Eq[0],Eq[1]),Ep=Eo(e[0],e[1]);return function(Es){return Ep(En(Es))}}function b(Es,En,Et,Eq){var Ep=[],Er=[],Eo=0,e=Math.min(Es.length,En.length)-1;if(Es[e]<Es[0]){Es=Es.slice().reverse();En=En.slice().reverse()}while(++Eo<=e){Ep.push(Et(Es[Eo-1],Es[Eo]));Er.push(Eq(En[Eo-1],En[Eo]))}return function(Eu){var Ev=d3.bisect(Es,Eu,1,e)-1;return Er[Ev](Ep[Ev](Eu))}}d3.scale.log=function(){return Dt(d3.scale.linear(),DV)};function Dt(e,En){var Eo=En.pow;function Ep(Eq){return e(En(Eq))}Ep.invert=function(Eq){return Eo(e.invert(Eq))};Ep.domain=function(Eq){if(!arguments.length){return e.domain().map(Eo)}En=Eq[0]<0?DY:DV;Eo=En.pow;e.domain(Eq.map(En));return Ep};Ep.nice=function(){e.domain(Dc(e.domain(),CU));return Ep};Ep.ticks=function(){var Ev=CH(e.domain()),Ew=[];if(Ev.every(isFinite)){var Eu=Math.floor(Ev[0]),Et=Math.ceil(Ev[1]),Es=Eo(Ev[0]),Er=Eo(Ev[1]);if(En===DY){Ew.push(Eo(Eu));for(;Eu++<Et;){for(var Eq=9;Eq>0;Eq--){Ew.push(Eo(Eu)*Eq)}}}else{for(;Eu<Et;Eu++){for(var Eq=1;Eq<10;Eq++){Ew.push(Eo(Eu)*Eq)}}Ew.push(Eo(Eu))}for(Eu=0;Ew[Eu]<Es;Eu++){}for(Et=Ew.length;Ew[Et-1]>Er;Et--){}Ew=Ew.slice(Eu,Et)}return Ew};Ep.tickFormat=function(Eu,Et){if(arguments.length<2){Et=Bg}if(arguments.length<1){return Et}var Eq=Eu/Ep.ticks().length,Er=En===DY?(Es=-1e-12,Math.floor):(Es=1e-12,Math.ceil),Es;return function(Ev){return Ev/Eo(Er(En(Ev)+Es))<Eq?Et(Ev):""}};Ep.copy=function(){return Dt(e.copy(),En)};return DU(Ep,e)}var Bg=d3.format(".0e");function DV(e){return Math.log(e<0?0:e)/Math.LN10}function DY(e){return -Math.log(e>0?0:-e)/Math.LN10}DV.pow=function(e){return Math.pow(10,e)};DY.pow=function(e){return -Math.pow(10,-e)};d3.scale.pow=function(){return Dh(d3.scale.linear(),1)};function Dh(e,Eo){var En=DM(Eo),Ep=DM(1/Eo);function Eq(Er){return e(En(Er))}Eq.invert=function(Er){return Ep(e.invert(Er))};Eq.domain=function(Er){if(!arguments.length){return e.domain().map(Ep)}e.domain(Er.map(En));return Eq};Eq.ticks=function(Er){return Ce(Eq.domain(),Er)};Eq.tickFormat=function(Er){return Co(Eq.domain(),Er)};Eq.nice=function(){return Eq.domain(Dc(Eq.domain(),AE))};Eq.exponent=function(Er){if(!arguments.length){return Eo}var Es=Eq.domain();En=DM(Eo=Er);Ep=DM(1/Eo);return Eq.domain(Es)};Eq.copy=function(){return Dh(e.copy(),Eo)};return DU(Eq,e)}function DM(En){return function(e){return e<0?-Math.pow(-e,En):Math.pow(e,En)}}d3.scale.sqrt=function(){return d3.scale.pow().exponent(0.5)};d3.scale.ordinal=function(){return A7([],{t:"range",x:[]})};function A7(Er,Eo){var Eq,En,Ep;function Es(Et){return En[((Eq.get(Et)||Eq.set(Et,Er.push(Et)))-1)%En.length]}function e(Eu,Et){return d3.range(Er.length).map(function(Ev){return Eu+Et*Ev})}Es.domain=function(Et){if(!arguments.length){return Er}Er=[];Eq=new AC;var Ev=-1,Ew=Et.length,Eu;while(++Ev<Ew){if(!Eq.has(Eu=Et[Ev])){Eq.set(Eu,Er.push(Eu))}}return Es[Eo.t](Eo.x,Eo.p)};Es.range=function(Et){if(!arguments.length){return En}En=Et;Ep=0;Eo={t:"range",x:Et};return Es};Es.rangePoints=function(Et,Ew){if(arguments.length<2){Ew=0}var Ex=Et[0],Eu=Et[1],Ev=(Eu-Ex)/(Er.length-1+Ew);En=e(Er.length<2?(Ex+Eu)/2:Ex+Ev*Ew/2,Ev);Ep=0;Eo={t:"rangePoints",x:Et,p:Ew};return Es};Es.rangeBands=function(Et,Ex){if(arguments.length<2){Ex=0}var Eu=Et[1]<Et[0],Ey=Et[Eu-0],Ev=Et[1-Eu],Ew=(Ev-Ey)/(Er.length+Ex);En=e(Ey+Ew*Ex,Ew);if(Eu){En.reverse()}Ep=Ew*(1-Ex);Eo={t:"rangeBands",x:Et,p:Ex};return Es};Es.rangeRoundBands=function(Et,Ey){if(arguments.length<2){Ey=0}var Ev=Et[1]<Et[0],Ez=Et[Ev-0],Ew=Et[1-Ev],Ex=Math.floor((Ew-Ez)/(Er.length+Ey)),Eu=Ew-Ez-(Er.length-Ey)*Ex;En=e(Ez+Math.round(Eu/2),Ex);if(Ev){En.reverse()}Ep=Math.round(Ex*(1-Ey));Eo={t:"rangeRoundBands",x:Et,p:Ey};return Es};Es.rangeBand=function(){return Ep};Es.rangeExtent=function(){return CH(Eo.x)};Es.copy=function(){return A7(Er,Eo)};return Es.domain(Er)}d3.scale.category10=function(){return d3.scale.ordinal().range(BE)};d3.scale.category20=function(){return d3.scale.ordinal().range(A2)};d3.scale.category20b=function(){return d3.scale.ordinal().range(EC)};d3.scale.category20c=function(){return d3.scale.ordinal().range(EB)};var BE=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"];var A2=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"];var EC=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"];var EB=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return V([],[])};function V(Eo,En){var Ep;function e(){var Er=0,Et=Eo.length,Es=En.length;Ep=[];while(++Er<Es){Ep[Er-1]=d3.quantile(Eo,Er/Es)}return Eq}function Eq(Er){if(isNaN(Er=+Er)){return NaN}return En[d3.bisect(Ep,Er)]}Eq.domain=function(Er){if(!arguments.length){return Eo}Eo=Er.filter(function(Es){return !isNaN(Es)}).sort(d3.ascending);return e()};Eq.range=function(Er){if(!arguments.length){return En}En=Er;return e()};Eq.quantiles=function(){return Ep};Eq.copy=function(){return V(Eo,En)};return e()}d3.scale.quantize=function(){return Bq(0,1,[0,1])};function Bq(Eq,Eo,En){var Er,Ep;function Es(Et){return En[Math.max(0,Math.min(Ep,Math.floor(Er*(Et-Eq))))]}function e(){Er=En.length/(Eo-Eq);Ep=En.length-1;return Es}Es.domain=function(Et){if(!arguments.length){return[Eq,Eo]}Eq=+Et[0];Eo=+Et[Et.length-1];return e()};Es.range=function(Et){if(!arguments.length){return En}En=Et;return e()};Es.copy=function(){return Bq(Eq,Eo,En)};return e()}d3.scale.identity=function(){return CV([0,1])};function CV(En){function e(Eo){return +Eo}e.invert=e;e.domain=e.range=function(Eo){if(!arguments.length){return En}En=Eo.map(e);return e};e.ticks=function(Eo){return Ce(En,Eo)};e.tickFormat=function(Eo){return Co(En,Eo)};e.copy=function(){return CV(En)};return e}d3.svg={};d3.svg.arc=function(){var Eq=Af,Ep=BN,Eo=DZ,e=s;function En(){var Eu=Eq.apply(this,arguments),Et=Ep.apply(this,arguments),Es=Eo.apply(this,arguments)+EU,Er=e.apply(this,arguments)+EU,E0=(Er<Es&&(E0=Es,Es=Er,Er=E0),Er-Es),Ex=E0<Math.PI?"0":"1",Ew=Math.cos(Es),Ez=Math.sin(Es),Ev=Math.cos(Er),Ey=Math.sin(Er);return E0>=EZ?(Eu?"M0,"+Et+"A"+Et+","+Et+" 0 1,1 0,"+(-Et)+"A"+Et+","+Et+" 0 1,1 0,"+Et+"M0,"+Eu+"A"+Eu+","+Eu+" 0 1,0 0,"+(-Eu)+"A"+Eu+","+Eu+" 0 1,0 0,"+Eu+"Z":"M0,"+Et+"A"+Et+","+Et+" 0 1,1 0,"+(-Et)+"A"+Et+","+Et+" 0 1,1 0,"+Et+"Z"):(Eu?"M"+Et*Ew+","+Et*Ez+"A"+Et+","+Et+" 0 "+Ex+",1 "+Et*Ev+","+Et*Ey+"L"+Eu*Ev+","+Eu*Ey+"A"+Eu+","+Eu+" 0 "+Ex+",0 "+Eu*Ew+","+Eu*Ez+"Z":"M"+Et*Ew+","+Et*Ez+"A"+Et+","+Et+" 0 "+Ex+",1 "+Et*Ev+","+Et*Ey+"L0,0Z")}En.innerRadius=function(Er){if(!arguments.length){return Eq}Eq=d3.functor(Er);return En};En.outerRadius=function(Er){if(!arguments.length){return Ep}Ep=d3.functor(Er);return En};En.startAngle=function(Er){if(!arguments.length){return Eo}Eo=d3.functor(Er);return En};En.endAngle=function(Er){if(!arguments.length){return e}e=d3.functor(Er);return En};En.centroid=function(){var Es=(Eq.apply(this,arguments)+Ep.apply(this,arguments))/2,Er=(Eo.apply(this,arguments)+e.apply(this,arguments))/2+EU;return[Math.cos(Er)*Es,Math.sin(Er)*Es]};return En};var EU=-Math.PI/2,EZ=2*Math.PI-0.000001;function Af(e){return e.innerRadius}function BN(e){return e.outerRadius}function DZ(e){return e.startAngle}function s(e){return e.endAngle}function Cn(En){var e=D1,Es=D0,Ep=B6,Er=Az.get(Ep),Eq=0.7;function Eo(Et){return Et.length<1?null:"M"+Er(En(z(this,Et,e,Es)),Eq)}Eo.x=function(Et){if(!arguments.length){return e}e=Et;return Eo};Eo.y=function(Et){if(!arguments.length){return Es}Es=Et;return Eo};Eo.interpolate=function(Et){if(!arguments.length){return Ep}if(!Az.has(Et+="")){Et=B6}Er=Az.get(Ep=Et);return Eo};Eo.tension=function(Et){if(!arguments.length){return Eq}Eq=Et;return Eo};return Eo}d3.svg.line=function(){return Cn(Object)};function z(Ev,Eq,Es,Er){var Eu=[],Ep=-1,e=Eq.length,Eo=typeof Es==="function",En=typeof Er==="function",Et;if(Eo&&En){while(++Ep<e){Eu.push([Es.call(Ev,Et=Eq[Ep],Ep),Er.call(Ev,Et,Ep)])}}else{if(Eo){while(++Ep<e){Eu.push([Es.call(Ev,Eq[Ep],Ep),Er])}}else{if(En){while(++Ep<e){Eu.push([Es,Er.call(Ev,Eq[Ep],Ep)])}}else{while(++Ep<e){Eu.push([Es,Er])}}}}return Eu}function D1(e){return e[0]}function D0(e){return e[1]}var B6="linear";var Az=d3.map({linear:Ec,"step-before":AZ,"step-after":EQ,basis:Cs,"basis-open":AW,"basis-closed":BL,bundle:BM,cardinal:Bz,"cardinal-open":Aw,"cardinal-closed":P,monotone:Bd});function Ec(En){var e=0,Eq=En.length,Ep=En[0],Eo=[Ep[0],",",Ep[1]];while(++e<Eq){Eo.push("L",(Ep=En[e])[0],",",Ep[1])}return Eo.join("")}function AZ(En){var e=0,Eq=En.length,Ep=En[0],Eo=[Ep[0],",",Ep[1]];while(++e<Eq){Eo.push("V",(Ep=En[e])[1],"H",Ep[0])}return Eo.join("")}function EQ(En){var e=0,Eq=En.length,Ep=En[0],Eo=[Ep[0],",",Ep[1]];while(++e<Eq){Eo.push("H",(Ep=En[e])[0],"V",Ep[1])}return Eo.join("")}function Aw(En,e){return En.length<4?Ec(En):En[1]+BR(En.slice(1,En.length-1),As(En,e))}function P(En,e){return En.length<3?Ec(En):En[0]+BR((En.push(En[0]),En),As([En[En.length-2]].concat(En,[En[1]]),e))}function Bz(Eo,En,e){return Eo.length<3?Ec(Eo):Eo[0]+BR(Eo,As(Eo,En))}function BR(Es,Er){if(Er.length<1||(Es.length!=Er.length&&Es.length!=Er.length+2)){return Ec(Es)}var Et=Es.length!=Er.length,Ew="",Eu=Es[0],e=Es[1],Eq=Er[0],Ev=Eq,Eo=1;if(Et){Ew+="Q"+(e[0]-Eq[0]*2/3)+","+(e[1]-Eq[1]*2/3)+","+e[0]+","+e[1];Eu=Es[1];Eo=2}if(Er.length>1){Ev=Er[1];e=Es[Eo];Eo++;Ew+="C"+(Eu[0]+Eq[0])+","+(Eu[1]+Eq[1])+","+(e[0]-Ev[0])+","+(e[1]-Ev[1])+","+e[0]+","+e[1];for(var En=2;En<Er.length;En++,Eo++){e=Es[Eo];Ev=Er[En];Ew+="S"+(e[0]-Ev[0])+","+(e[1]-Ev[1])+","+e[0]+","+e[1]}}if(Et){var Ep=Es[Eo];Ew+="Q"+(e[0]+Ev[0]*2/3)+","+(e[1]+Ev[1]*2/3)+","+Ep[0]+","+Ep[1]}return Ew}function As(Es,Eq){var Eo=[],Ep=(1-Eq)/2,Eu,Et=Es[0],Er=Es[1],En=1,e=Es.length;while(++En<e){Eu=Et;Et=Er;Er=Es[En];Eo.push([Ep*(Er[0]-Eu[0]),Ep*(Er[1]-Eu[1])])}return Eo}function Cs(Et){if(Et.length<3){return Ec(Et)}var Eo=1,En=Et.length,Ep=Et[0],e=Ep[0],Er=Ep[1],Es=[e,e,e,(Ep=Et[1])[0]],Eq=[Er,Er,Er,Ep[1]],Eu=[e,",",Er];Am(Eu,Es,Eq);while(++Eo<En){Ep=Et[Eo];Es.shift();Es.push(Ep[0]);Eq.shift();Eq.push(Ep[1]);Am(Eu,Es,Eq)}Eo=-1;while(++Eo<2){Es.shift();Es.push(Ep[0]);Eq.shift();Eq.push(Ep[1]);Am(Eu,Es,Eq)}return Eu.join("")}function AW(Ep){if(Ep.length<4){return Ec(Ep)}var Er=[],Eo=-1,Es=Ep.length,Eq,En=[0],e=[0];while(++Eo<3){Eq=Ep[Eo];En.push(Eq[0]);e.push(Eq[1])}Er.push(Df(EH,En)+","+Df(EH,e));--Eo;while(++Eo<Es){Eq=Ep[Eo];En.shift();En.push(Eq[0]);e.shift();e.push(Eq[1]);Am(Er,En,e)}return Er.join("")}function BL(Eq){var Es,Ep=-1,Et=Eq.length,e=Et+4,Er,Eo=[],En=[];while(++Ep<4){Er=Eq[Ep%Et];Eo.push(Er[0]);En.push(Er[1])}Es=[Df(EH,Eo),",",Df(EH,En)];--Ep;while(++Ep<e){Er=Eq[Ep%Et];Eo.shift();Eo.push(Er[0]);En.shift();En.push(Er[1]);Am(Es,Eo,En)}return Es.join("")}function BM(Es,Er){var Eo=Es.length-1,En=Es[0][0],Eq=Es[0][1],Ev=Es[Eo][0]-En,Eu=Es[Eo][1]-Eq,Ep=-1,e,Et;while(++Ep<=Eo){e=Es[Ep];Et=Ep/Eo;e[0]=Er*e[0]+(1-Er)*(En+Et*Ev);e[1]=Er*e[1]+(1-Er)*(Eq+Et*Eu)}return Cs(Es)}function Df(En,e){return En[0]*e[0]+En[1]*e[1]+En[2]*e[2]+En[3]*e[3]}var EK=[0,2/3,1/3,0],EI=[0,1/3,2/3,0],EH=[0,1/6,2/3,1/6];function Am(En,e,Eo){En.push("C",Df(EK,e),",",Df(EK,Eo),",",Df(EI,e),",",Df(EI,Eo),",",Df(EH,e),",",Df(EH,Eo))}function Ei(En,e){return(e[1]-En[1])/(e[0]-En[0])}function CA(Ep){var Eo=0,En=Ep.length-1,e=[],Es=Ep[0],Er=Ep[1],Eq=e[0]=Ei(Es,Er);while(++Eo<En){e[Eo]=Eq+(Eq=Ei(Es=Er,Er=Ep[Eo+1]))}e[Eo]=Eq;return e}function u(Et){var Eq=[],Ep,Es,Er,Eu,e=CA(Et),Eo=-1,En=Et.length-1;while(++Eo<En){Ep=Ei(Et[Eo],Et[Eo+1]);if(Math.abs(Ep)<0.000001){e[Eo]=e[Eo+1]=0}else{Es=e[Eo]/Ep;Er=e[Eo+1]/Ep;Eu=Es*Es+Er*Er;if(Eu>9){Eu=Ep*3/Math.sqrt(Eu);e[Eo]=Eu*Es;e[Eo+1]=Eu*Er}}}Eo=-1;while(++Eo<=En){Eu=(Et[Math.min(En,Eo+1)][0]-Et[Math.max(0,Eo-1)][0])/(6*(1+e[Eo]*e[Eo]));Eq.push([Eu||0,e[Eo]*Eu||0])}return Eq}function Bd(e){return e.length<3?Ec(e):e[0]+BR(e,u(e))}d3.svg.line.radial=function(){var e=Cn(f);e.radius=e.x,delete e.x;e.angle=e.y,delete e.y;return e};function f(Ep){var e,Eo=-1,Er=Ep.length,Eq,En;while(++Eo<Er){e=Ep[Eo];Eq=e[0];En=e[1]+EU;e[0]=Eq*Math.cos(En);e[1]=Eq*Math.sin(En)}return Ep}function Ek(Er){var Eo=D1,En=D1,Ev=0,Et=D0,Es,Eq,Ep,Eu=0.7;function e(Ey){if(Ey.length<1){return null}var Ex=z(this,Ey,Eo,Ev),Ew=z(this,Ey,Eo===En?Bi(Ex):En,Ev===Et?Bh(Ex):Et);return"M"+Eq(Er(Ew),Eu)+"L"+Ep(Er(Ex.reverse()),Eu)+"Z"}e.x=function(Ew){if(!arguments.length){return En}Eo=En=Ew;return e};e.x0=function(Ew){if(!arguments.length){return Eo}Eo=Ew;return e};e.x1=function(Ew){if(!arguments.length){return En}En=Ew;return e};e.y=function(Ew){if(!arguments.length){return Et}Ev=Et=Ew;return e};e.y0=function(Ew){if(!arguments.length){return Ev}Ev=Ew;return e};e.y1=function(Ew){if(!arguments.length){return Et}Et=Ew;return e};e.interpolate=function(Ew){if(!arguments.length){return Es}if(!Az.has(Ew+="")){Ew=B6}Eq=Az.get(Es=Ew);Ep=Eq.reverse||Eq;return e};e.tension=function(Ew){if(!arguments.length){return Eu}Eu=Ew;return e};return e.interpolate("linear")}AZ.reverse=EQ;EQ.reverse=AZ;d3.svg.area=function(){return Ek(Object)};function Bi(e){return function(Eo,En){return e[En][0]}}function Bh(e){return function(Eo,En){return e[En][1]}}d3.svg.area.radial=function(){var e=Ek(f);e.radius=e.x,delete e.x;e.innerRadius=e.x0,delete e.x0;e.outerRadius=e.x1,delete e.x1;e.angle=e.y,delete e.y;e.startAngle=e.y0,delete e.y0;e.endAngle=e.y1,delete e.y1;return e};d3.svg.chord=function(){var e=t,Et=AD,Es=X,Eu=DZ,Eq=s;function Er(Ez,Ex){var Ey=Ev(this,e,Ez,Ex),Ew=Ev(this,Et,Ez,Ex);return"M"+Ey.p0+En(Ey.r,Ey.p1,Ey.a1-Ey.a0)+(Eo(Ey,Ew)?Ep(Ey.r,Ey.p1,Ey.r,Ey.p0):Ep(Ey.r,Ey.p1,Ew.r,Ew.p0)+En(Ew.r,Ew.p1,Ew.a1-Ew.a0)+Ep(Ew.r,Ew.p1,Ey.r,Ey.p0))+"Z"}function Ev(Ez,E2,E3,E0){var Ey=E2.call(Ez,E3,E0),E1=Es.call(Ez,Ey,E0),Ex=Eu.call(Ez,Ey,E0)+EU,Ew=Eq.call(Ez,Ey,E0)+EU;return{r:E1,a0:Ex,a1:Ew,p0:[E1*Math.cos(Ex),E1*Math.sin(Ex)],p1:[E1*Math.cos(Ew),E1*Math.sin(Ew)]}}function Eo(Ex,Ew){return Ex.a0==Ew.a0&&Ex.a1==Ew.a1}function En(Ex,Ey,Ew){return"A"+Ex+","+Ex+" 0 "+ +(Ew>Math.PI)+",1 "+Ey}function Ep(Ex,Ez,Ew,Ey){return"Q 0,0 "+Ey}Er.radius=function(Ew){if(!arguments.length){return Es}Es=d3.functor(Ew);return Er};Er.source=function(Ew){if(!arguments.length){return e}e=d3.functor(Ew);return Er};Er.target=function(Ew){if(!arguments.length){return Et}Et=d3.functor(Ew);return Er};Er.startAngle=function(Ew){if(!arguments.length){return Eu}Eu=d3.functor(Ew);return Er};Er.endAngle=function(Ew){if(!arguments.length){return Eq}Eq=d3.functor(Ew);return Er};return Er};function t(e){return e.source}function AD(e){return e.target}function X(e){return e.radius}function Dp(e){return e.startAngle}function CI(e){return e.endAngle}d3.svg.diagonal=function(){var Eo=t,Ep=AD,e=L;function En(Eu,Er){var Ev=Eo.call(this,Eu,Er),Es=Ep.call(this,Eu,Er),Eq=(Ev.y+Es.y)/2,Et=[Ev,{x:Ev.x,y:Eq},{x:Es.x,y:Eq},Es];Et=Et.map(e);return"M"+Et[0]+"C"+Et[1]+" "+Et[2]+" "+Et[3]}En.source=function(Eq){if(!arguments.length){return Eo}Eo=d3.functor(Eq);return En};En.target=function(Eq){if(!arguments.length){return Ep}Ep=d3.functor(Eq);return En};En.projection=function(Eq){if(!arguments.length){return e}e=Eq;return En};return En};function L(e){return[e.x,e.y]}d3.svg.diagonal.radial=function(){var Eo=d3.svg.diagonal(),e=L,En=Eo.projection;Eo.projection=function(Ep){return arguments.length?En(M(e=Ep)):e};return Eo};function M(e){return function(){var Ep=e.apply(this,arguments),Eo=Ep[0],En=Ep[1]+EU;return[Eo*Math.cos(En),Eo*Math.sin(En)]}}d3.svg.mouse=d3.mouse;d3.svg.touches=d3.touches;d3.svg.symbol=function(){var En=AI,e=Cj;function Eo(Eq,Ep){return(Ea.get(En.call(this,Eq,Ep))||A0)(e.call(this,Eq,Ep))}Eo.type=function(Ep){if(!arguments.length){return En}En=d3.functor(Ep);return Eo};Eo.size=function(Ep){if(!arguments.length){return e}e=d3.functor(Ep);return Eo};return Eo};function Cj(){return 64}function AI(){return"circle"}function A0(e){var En=Math.sqrt(e/Math.PI);return"M0,"+En+"A"+En+","+En+" 0 1,1 0,"+(-En)+"A"+En+","+En+" 0 1,1 0,"+En+"Z"}var Ea=d3.map({circle:A0,cross:function(e){var En=Math.sqrt(e/5)/2;return"M"+-3*En+","+-En+"H"+-En+"V"+-3*En+"H"+En+"V"+-En+"H"+3*En+"V"+En+"H"+En+"V"+3*En+"H"+-En+"V"+En+"H"+-3*En+"Z"},diamond:function(e){var En=Math.sqrt(e/(2*A4)),Eo=En*A4;return"M0,"+-En+"L"+Eo+",0 0,"+En+" "+-Eo+",0Z"},square:function(e){var En=Math.sqrt(e)/2;return"M"+-En+","+-En+"L"+En+","+-En+" "+En+","+En+" "+-En+","+En+"Z"},"triangle-down":function(e){var Eo=Math.sqrt(e/Ax),En=Eo*Ax/2;return"M0,"+En+"L"+Eo+","+-En+" "+-Eo+","+-En+"Z"},"triangle-up":function(e){var Eo=Math.sqrt(e/Ax),En=Eo*Ax/2;return"M0,"+-En+"L"+Eo+","+En+" "+-Eo+","+En+"Z"}});d3.svg.symbolTypes=Ea.keys();var Ax=Math.sqrt(3),A4=Math.tan(30*Math.PI/180);d3.svg.axis=function(){var Ep=d3.scale.linear(),Es="bottom",Eq=6,e=6,En=6,Ew=3,Ev=[10],Er=null,Eu,Et=0;function Eo(Ex){Ex.each(function(){var FG=d3.select(this);var FH=Er==null?(Ep.ticks?Ep.ticks.apply(Ep,Ev):Ep.domain()):Er,FA=Eu==null?(Ep.tickFormat?Ep.tickFormat.apply(Ep,Ev):String):Eu;var E2=BO(Ep,FH,Et),E1=FG.selectAll(".minor").data(E2,String),FD=E1.enter().insert("line","g").attr("class","tick minor").style("opacity",0.000001),FB=d3.transition(E1.exit()).style("opacity",0.000001).remove(),Ez=d3.transition(E1).style("opacity",1);var FF=FG.selectAll("g").data(FH,String),E7=FF.enter().insert("g","path").style("opacity",0.000001),E9=d3.transition(FF.exit()).style("opacity",0.000001).remove(),E3=d3.transition(FF).style("opacity",1),Ey;var E6=AL(Ep),E8=FG.selectAll(".domain").data([0]),E0=E8.enter().append("path").attr("class","domain"),FI=d3.transition(E8);var FC=Ep.copy(),FE=this.__chart__||FC;this.__chart__=FC;E7.append("line").attr("class","tick");E7.append("text");E3.select("text").text(FA);switch(Es){case"bottom":Ey=Cz;FD.attr("y2",e);Ez.attr("x2",0).attr("y2",e);E7.select("line").attr("y2",Eq);E7.select("text").attr("y",Math.max(Eq,0)+Ew);E3.select("line").attr("x2",0).attr("y2",Eq);E3.select("text").attr("x",0).attr("y",Math.max(Eq,0)+Ew).attr("dy",".71em").attr("text-anchor","middle");FI.attr("d","M"+E6[0]+","+En+"V0H"+E6[1]+"V"+En);break;case"top":Ey=Cz;FD.attr("y2",-e);Ez.attr("x2",0).attr("y2",-e);E7.select("line").attr("y2",-Eq);E7.select("text").attr("y",-(Math.max(Eq,0)+Ew));E3.select("line").attr("x2",0).attr("y2",-Eq);E3.select("text").attr("x",0).attr("y",-(Math.max(Eq,0)+Ew)).attr("dy","0em").attr("text-anchor","middle");FI.attr("d","M"+E6[0]+","+-En+"V0H"+E6[1]+"V"+-En);break;case"left":Ey=Cx;FD.attr("x2",-e);Ez.attr("x2",-e).attr("y2",0);E7.select("line").attr("x2",-Eq);E7.select("text").attr("x",-(Math.max(Eq,0)+Ew));E3.select("line").attr("x2",-Eq).attr("y2",0);E3.select("text").attr("x",-(Math.max(Eq,0)+Ew)).attr("y",0).attr("dy",".32em").attr("text-anchor","end");FI.attr("d","M"+-En+","+E6[0]+"H0V"+E6[1]+"H"+-En);break;case"right":Ey=Cx;FD.attr("x2",e);Ez.attr("x2",e).attr("y2",0);E7.select("line").attr("x2",Eq);E7.select("text").attr("x",Math.max(Eq,0)+Ew);E3.select("line").attr("x2",Eq).attr("y2",0);E3.select("text").attr("x",Math.max(Eq,0)+Ew).attr("y",0).attr("dy",".32em").attr("text-anchor","start");FI.attr("d","M"+En+","+E6[0]+"H0V"+E6[1]+"H"+En);break}if(Ep.ticks){E7.call(Ey,FE);E3.call(Ey,FC);E9.call(Ey,FC);FD.call(Ey,FE);Ez.call(Ey,FC);FB.call(Ey,FC)}else{var E5=FC.rangeBand()/2,E4=function(FJ){return FC(FJ)+E5};E7.call(Ey,E4);E3.call(Ey,E4)}})}Eo.scale=function(Ex){if(!arguments.length){return Ep}Ep=Ex;return Eo};Eo.orient=function(Ex){if(!arguments.length){return Es}Es=Ex;return Eo};Eo.ticks=function(){if(!arguments.length){return Ev}Ev=arguments;return Eo};Eo.tickValues=function(Ex){if(!arguments.length){return Er}Er=Ex;return Eo};Eo.tickFormat=function(Ex){if(!arguments.length){return Eu}Eu=Ex;return Eo};Eo.tickSize=function(Ex,E0,Ey){if(!arguments.length){return Eq}var Ez=arguments.length-1;Eq=+Ex;e=Ez>1?+E0:Eq;En=Ez>0?+arguments[Ez]:Eq;return Eo};Eo.tickPadding=function(Ex){if(!arguments.length){return Ew}Ew=+Ex;return Eo};Eo.tickSubdivide=function(Ex){if(!arguments.length){return Et}Et=+Ex;return Eo};return Eo};function Cz(En,e){En.attr("transform",function(Eo){return"translate("+e(Eo)+",0)"})}function Cx(e,En){e.attr("transform",function(Eo){return"translate(0,"+En(Eo)+")"})}function BO(Eo,Es,En){Et=[];if(En&&Es.length>1){var Ev=CH(Eo.domain()),Et,Eq=-1,e=Es.length,Er=(Es[1]-Es[0])/++En,Ep,Eu;while(++Eq<e){for(Ep=En;--Ep>0;){if((Eu=+Es[Eq]-Ep*Er)>=Ev[0]){Et.push(Eu)}}}for(--Eq,Ep=0;++Ep<En&&(Eu=+Es[Eq]+Ep*Er)<Ev[1];){Et.push(Eu)}}return Et}d3.svg.brush=function(){var e=EF(Eq,"brushstart","brush","brushend"),Es=null,Er=null,Et=v[0],Ew=[[0,0],[0,0]],En;function Eq(Ex){Ex.each(function(){var E0=d3.select(this),Ez=E0.selectAll(".background").data([0]),Ey=E0.selectAll(".extent").data([0]),E2=E0.selectAll(".resize").data(Et,String),E1;E0.style("pointer-events","all").on("mousedown.brush",Eu).on("touchstart.brush",Eu);Ez.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair");Ey.enter().append("rect").attr("class","extent").style("cursor","move");E2.enter().append("g").attr("class",function(E3){return"resize "+E3}).style("cursor",function(E3){return CX[E3]}).append("rect").attr("x",function(E3){return/[ew]$/.test(E3)?-3:null}).attr("y",function(E3){return/^[ns]/.test(E3)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden");E2.style("display",Eq.empty()?"none":null);E2.exit().remove();if(Es){E1=AL(Es);Ez.attr("x",E1[0]).attr("width",E1[1]-E1[0]);Ep(E0)}if(Er){E1=AL(Er);Ez.attr("y",E1[0]).attr("height",E1[1]-E1[0]);Eo(E0)}Ev(E0)})}function Ev(Ex){Ex.selectAll(".resize").attr("transform",function(Ey){return"translate("+Ew[+/e$/.test(Ey)][0]+","+Ew[+/^s/.test(Ey)][1]+")"})}function Ep(Ex){Ex.select(".extent").attr("x",Ew[0][0]);Ex.selectAll(".extent,.n>rect,.s>rect").attr("width",Ew[1][0]-Ew[0][0])}function Eo(Ex){Ex.select(".extent").attr("y",Ew[0][1]);Ex.selectAll(".extent,.e>rect,.w>rect").attr("height",Ew[1][1]-Ew[0][1])}function Eu(){var FG=this,Ey=d3.select(d3.event.target),E4=e.of(FG,arguments),FB=d3.select(FG),FD=Ey.datum(),E9=!/^(n|s)$/.test(FD)&&Es,E7=!/^(e|w)$/.test(FD)&&Er,E8=Ey.classed("extent"),FE,FF=E5(),Ez;var E2=d3.select(window).on("mousemove.brush",E3).on("mouseup.brush",Ex).on("touchmove.brush",E3).on("touchend.brush",Ex).on("keydown.brush",E6).on("keyup.brush",E1);if(E8){FF[0]=Ew[0][0]-FF[0];FF[1]=Ew[0][1]-FF[1]}else{if(FD){var FC=+/w$/.test(FD),FA=+/^n/.test(FD);Ez=[Ew[1-FC][0]-FF[0],Ew[1-FA][1]-FF[1]];FF[0]=Ew[FC][0];FF[1]=Ew[FA][1]}else{if(d3.event.altKey){FE=FF.slice()}}}FB.style("pointer-events","none").selectAll(".resize").style("display",null);d3.select("body").style("cursor",Ey.style("cursor"));E4({type:"brushstart"});E3();EW();function E5(){var FH=d3.event.changedTouches;return FH?d3.touches(FG,FH)[0]:d3.mouse(FG)}function E6(){if(d3.event.keyCode==32){if(!E8){FE=null;FF[0]-=Ew[1][0];FF[1]-=Ew[1][1];E8=2}EW()}}function E1(){if(d3.event.keyCode==32&&E8==2){FF[0]+=Ew[1][0];FF[1]+=Ew[1][1];E8=0;EW()}}function E3(){var FH=E5(),FI=false;if(Ez){FH[0]+=Ez[0];FH[1]+=Ez[1]}if(!E8){if(d3.event.altKey){if(!FE){FE=[(Ew[0][0]+Ew[1][0])/2,(Ew[0][1]+Ew[1][1])/2]}FF[0]=Ew[+(FH[0]<FE[0])][0];FF[1]=Ew[+(FH[1]<FE[1])][1]}else{FE=null}}if(E9&&E0(FH,Es,0)){Ep(FB);FI=true}if(E7&&E0(FH,Er,1)){Eo(FB);FI=true}if(FI){Ev(FB);E4({type:"brush",mode:E8?"move":"resize"})}}function E0(FP,FJ,FL){var FM=AL(FJ),FI=FM[0],FH=FM[1],FN=FF[FL],FQ=Ew[1][FL]-Ew[0][FL],FK,FO;if(E8){FI-=FN;FH-=FQ+FN}FK=Math.max(FI,Math.min(FH,FP[FL]));if(E8){FO=(FK+=FN)+FQ}else{if(FE){FN=Math.max(FI,Math.min(FH,2*FE[FL]-FK))}if(FN<FK){FO=FK;FK=FN}else{FO=FN}}if(Ew[0][FL]!==FK||Ew[1][FL]!==FO){En=null;Ew[0][FL]=FK;Ew[1][FL]=FO;return true}}function Ex(){E3();FB.style("pointer-events","all").selectAll(".resize").style("display",Eq.empty()?"none":null);d3.select("body").style("cursor",null);E2.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null);E4({type:"brushend"});EW()}}Eq.x=function(Ex){if(!arguments.length){return Es}Es=Ex;Et=v[!Es<<1|!Er];return Eq};Eq.y=function(Ex){if(!arguments.length){return Er}Er=Ex;Et=v[!Es<<1|!Er];return Eq};Eq.extent=function(E2){var Ez,Ex,E1,E0,Ey;if(!arguments.length){E2=En||Ew;if(Es){Ez=E2[0][0],Ex=E2[1][0];if(!En){Ez=Ew[0][0],Ex=Ew[1][0];if(Es.invert){Ez=Es.invert(Ez),Ex=Es.invert(Ex)}if(Ex<Ez){Ey=Ez,Ez=Ex,Ex=Ey}}}if(Er){E1=E2[0][1],E0=E2[1][1];if(!En){E1=Ew[0][1],E0=Ew[1][1];if(Er.invert){E1=Er.invert(E1),E0=Er.invert(E0)}if(E0<E1){Ey=E1,E1=E0,E0=Ey}}}return Es&&Er?[[Ez,E1],[Ex,E0]]:Es?[Ez,Ex]:Er&&[E1,E0]}En=[[0,0],[0,0]];if(Es){Ez=E2[0],Ex=E2[1];if(Er){Ez=Ez[0],Ex=Ex[0]}En[0][0]=Ez,En[1][0]=Ex;if(Es.invert){Ez=Es(Ez),Ex=Es(Ex)}if(Ex<Ez){Ey=Ez,Ez=Ex,Ex=Ey}Ew[0][0]=Ez|0,Ew[1][0]=Ex|0}if(Er){E1=E2[0],E0=E2[1];if(Es){E1=E1[1],E0=E0[1]}En[0][1]=E1,En[1][1]=E0;if(Er.invert){E1=Er(E1),E0=Er(E0)}if(E0<E1){Ey=E1,E1=E0,E0=Ey}Ew[0][1]=E1|0,Ew[1][1]=E0|0}return Eq};Eq.clear=function(){En=null;Ew[0][0]=Ew[0][1]=Ew[1][0]=Ew[1][1]=0;return Eq};Eq.empty=function(){return(Es&&Ew[0][0]===Ew[1][0])||(Er&&Ew[0][1]===Ew[1][1])};return d3.rebind(Eq,e,"on")};var CX={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"};var v=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];d3.behavior={};d3.behavior.drag=function(){var Ep=EF(Eo,"drag","dragstart","dragend"),e=null;function Eo(){this.on("mousedown.drag",En).on("touchstart.drag",En)}function En(){var Es=this,Ew=Ep.of(Es,arguments),Ev=d3.event.target,Er,Et=Ey(),Eu=0;var Ex=d3.select(window).on("mousemove.drag",Ez).on("touchmove.drag",Ez).on("mouseup.drag",Eq,true).on("touchend.drag",Eq,true);if(e){Er=e.apply(Es,arguments);Er=[Er.x-Et[0],Er.y-Et[1]]}else{Er=[0,0]}Ew({type:"dragstart"});function Ey(){var E2=Es.parentNode,E1=d3.event.changedTouches;return E1?d3.touches(E2,E1)[0]:d3.mouse(E2)}function Ez(){if(!Es.parentNode){return Eq()}var E3=Ey(),E2=E3[0]-Et[0],E1=E3[1]-Et[1];Eu|=E2|E1;Et=E3;EW();Ew({type:"drag",x:E3[0]+Er[0],y:E3[1]+Er[1],dx:E2,dy:E1})}function Eq(){Ew({type:"dragend"});if(Eu){EW();if(d3.event.target===Ev){Ex.on("click.drag",E0,true)}}Ex.on("mousemove.drag",null).on("touchmove.drag",null).on("mouseup.drag",null).on("touchend.drag",null)}function E0(){EW();Ex.on("click.drag",null)}}Eo.origin=function(Eq){if(!arguments.length){return e}e=Eq;return Eo};return d3.rebind(Eo,Ep,"on")};d3.behavior.zoom=function(){var Et=[0,0],E4,E8=1,E0,Eo=DN,Ez=EF(e,"zoom"),E3,E1,Eq,Ep,Es;function e(){this.on("mousedown.zoom",Ex).on("mousewheel.zoom",Ew).on("mousemove.zoom",E5).on("DOMMouseScroll.zoom",Ew).on("dblclick.zoom",Eu).on("touchstart.zoom",E2).on("touchmove.zoom",Ev).on("touchend.zoom",E2)}e.translate=function(E9){if(!arguments.length){return Et}Et=E9.map(Number);return e};e.scale=function(E9){if(!arguments.length){return E8}E8=+E9;return e};e.scaleExtent=function(E9){if(!arguments.length){return Eo}Eo=E9==null?DN:E9.map(Number);return e};e.x=function(E9){if(!arguments.length){return E1}E1=E9;E3=E9.copy();return e};e.y=function(E9){if(!arguments.length){return Ep}Ep=E9;Eq=E9.copy();return e};function En(E9){return[(E9[0]-Et[0])/E8,(E9[1]-Et[1])/E8]}function Ey(E9){return[E9[0]*E8+Et[0],E9[1]*E8+Et[1]]}function Er(E9){E8=Math.max(Eo[0],Math.min(Eo[1],E9))}function E6(FA,E9){E9=Ey(E9);Et[0]+=FA[0]-E9[0];Et[1]+=FA[1]-E9[1]}function E7(E9){if(E1){E1.domain(E3.range().map(function(FA){return(FA-Et[0])/E8}).map(E3.invert))}if(Ep){Ep.domain(Eq.range().map(function(FA){return(FA-Et[1])/E8}).map(Eq.invert))}d3.event.preventDefault();E9({type:"zoom",scale:E8,translate:Et})}function Ex(){var FC=this,FF=Ez.of(FC,arguments),FE=d3.event.target,FD=0,FG=d3.select(window).on("mousemove.zoom",FB).on("mouseup.zoom",FA),E9=En(d3.mouse(FC));window.focus();EW();function FB(){FD=1;E6(d3.mouse(FC),E9);E7(FF)}function FA(){if(FD){EW()}FG.on("mousemove.zoom",null).on("mouseup.zoom",null);if(FD&&d3.event.target===FE){FG.on("click.zoom",FH)}}function FH(){EW();FG.on("click.zoom",null)}}function Ew(){if(!E4){E4=En(d3.mouse(this))}Er(Math.pow(2,BB()*0.002)*E8);E6(d3.mouse(this),E4);E7(Ez.of(this,arguments))}function E5(){E4=null}function Eu(){var FA=d3.mouse(this),E9=En(FA);Er(d3.event.shiftKey?E8/2:E8*2);E6(FA,E9);E7(Ez.of(this,arguments))}function E2(){var FC=d3.touches(this),FA=Date.now();E0=E8;E4={};FC.forEach(function(FD){E4[FD.identifier]=En(FD)});EW();if((FC.length===1)&&(FA-Es<500)){var FB=FC[0],E9=En(FC[0]);Er(E8*2);E6(FB,E9);E7(Ez.of(this,arguments))}Es=FA}function Ev(){var FB=d3.touches(this),FD=FB[0],FA=E4[FD.identifier];if(FC=FB[1]){var FC,E9=E4[FC.identifier];FD=[(FD[0]+FC[0])/2,(FD[1]+FC[1])/2];FA=[(FA[0]+E9[0])/2,(FA[1]+E9[1])/2];Er(d3.event.scale*E0)}E6(FD,FA);E7(Ez.of(this,arguments))}return d3.rebind(e,Ez,"on")};var B5,DN=[0,Infinity];function BB(){if(!B5){B5=d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode}var Eo=d3.event,Ep;try{B5.scrollTop=1000;B5.dispatchEvent(Eo);Ep=1000-B5.scrollTop}catch(En){Ep=Eo.wheelDelta||(-Eo.detail*5)}return Ep}d3.layout={};d3.layout.bundle=function(){return function(e){var Eo=[],En=-1,Ep=e.length;while(++En<Ep){Eo.push(CR(e[En]))}return Eo}};function CR(Ep){var Er=Ep.source,e=Ep.target,Eq=DI(Er,e),Eo=[Er];while(Er!==Eq){Er=Er.parent;Eo.push(Er)}var En=Eo.length;while(e!==Eq){Eo.splice(En,0,e);e=e.parent}return Eo}function C1(Eo){var En=[],e=Eo.parent;while(e!=null){En.push(Eo);Eo=e;e=e.parent}En.push(Eo);return En}function DI(Ep,En){if(Ep===En){return Ep}var Eo=C1(Ep),e=C1(En),Eq=Eo.pop(),Er=e.pop(),Es=null;while(Eq===Er){Es=Eq;Eq=Eo.pop();Er=e.pop()}return Es}d3.layout.chord=function(){var Er={},Es,Ep,Ew,Eo,Ev=0,e,En,Eq;function Eu(){var E1={},E4=[],FC=d3.range(Eo),E8=[],E2,FA,E0,E5,E3;Es=[];Ep=[];E2=0,E5=-1;while(++E5<Eo){FA=0,E3=-1;while(++E3<Eo){FA+=Ew[E5][E3]}E4.push(FA);E8.push(d3.range(Eo));E2+=FA}if(e){FC.sort(function(FE,FD){return e(E4[FE],E4[FD])})}if(En){E8.forEach(function(FE,FD){FE.sort(function(FG,FF){return En(Ew[FD][FG],Ew[FD][FF])})})}E2=(2*Math.PI-Ev*Eo)/E2;FA=0,E5=-1;while(++E5<Eo){E0=FA,E3=-1;while(++E3<Eo){var E9=FC[E5],E7=E8[E9][E3],FB=Ew[E9][E7],Ez=FA,Ey=FA+=FB*E2;E1[E9+"-"+E7]={index:E9,subindex:E7,startAngle:Ez,endAngle:Ey,value:FB}}Ep.push({index:E9,startAngle:E0,endAngle:FA,value:(FA-E0)/E2});FA+=Ev}E5=-1;while(++E5<Eo){E3=E5-1;while(++E3<Eo){var Ex=E1[E5+"-"+E3],E6=E1[E3+"-"+E5];if(Ex.value||E6.value){Es.push(Ex.value<E6.value?{source:E6,target:Ex}:{source:Ex,target:E6})}}}if(Eq){Et()}}function Et(){Es.sort(function(Ey,Ex){return Eq((Ey.source.value+Ey.target.value)/2,(Ex.source.value+Ex.target.value)/2)})}Er.matrix=function(Ex){if(!arguments.length){return Ew}Eo=(Ew=Ex)&&Ew.length;Es=Ep=null;return Er};Er.padding=function(Ex){if(!arguments.length){return Ev}Ev=Ex;Es=Ep=null;return Er};Er.sortGroups=function(Ex){if(!arguments.length){return e}e=Ex;Es=Ep=null;return Er};Er.sortSubgroups=function(Ex){if(!arguments.length){return En}En=Ex;Es=null;return Er};Er.sortChords=function(Ex){if(!arguments.length){return Eq}Eq=Ex;if(Es){Et()}return Er};Er.chords=function(){if(!Es){Eu()}return Es};Er.groups=function(){if(!Ep){Eu()}return Ep};return Er};d3.layout.force=function(){var En={},E0=d3.dispatch("start","tick","end"),Ew=[1,1],E2,Eq,Et=0.9,E4=DJ,Ep=A8,Ez=-30,Er=0.1,Eu=0.8,E3,Ey=[],Eo=[],Es,e,Ev;function E1(E5){return function(FC,E7,FB,E6,FA){if(FC.point!==E5){var FE=FC.cx-E5.x,FD=FC.cy-E5.y,E9=1/Math.sqrt(FE*FE+FD*FD);if((E6-E7)*E9<Eu){var E8=FC.charge*E9*E9;E5.px-=FE*E8;E5.py-=FD*E8;return true}if(FC.point&&isFinite(E9)){var E8=FC.pointCharge*E9*E9;E5.px-=FE*E8;E5.py-=FD*E8}}return !FC.charge}}En.tick=function(){if((Eq*=0.99)<0.005){E0.end({type:"end",alpha:Eq=0});return true}var E7=Ey.length,E8=Eo.length,E5,FB,E6,FF,FE,E9,FA,FD,FC;for(FB=0;FB<E8;++FB){E6=Eo[FB];FF=E6.source;FE=E6.target;FD=FE.x-FF.x;FC=FE.y-FF.y;if(E9=(FD*FD+FC*FC)){E9=Eq*e[FB]*((E9=Math.sqrt(E9))-Es[FB])/E9;FD*=E9;FC*=E9;FE.x-=FD*(FA=FF.weight/(FE.weight+FF.weight));FE.y-=FC*FA;FF.x+=FD*(FA=1-FA);FF.y+=FC*FA}}if(FA=Eq*Er){FD=Ew[0]/2;FC=Ew[1]/2;FB=-1;if(FA){while(++FB<E7){E6=Ey[FB];E6.x+=(FD-E6.x)*FA;E6.y+=(FC-E6.y)*FA}}}if(Ez){Dn(E5=d3.geom.quadtree(Ey),Eq,Ev);FB=-1;while(++FB<E7){if(!(E6=Ey[FB]).fixed){E5.visit(E1(E6))}}}FB=-1;while(++FB<E7){E6=Ey[FB];if(E6.fixed){E6.x=E6.px;E6.y=E6.py}else{E6.x-=(E6.px-(E6.px=E6.x))*Et;E6.y-=(E6.py-(E6.py=E6.y))*Et}}E0.tick({type:"tick",alpha:Eq})};En.nodes=function(E5){if(!arguments.length){return Ey}Ey=E5;return En};En.links=function(E5){if(!arguments.length){return Eo}Eo=E5;return En};En.size=function(E5){if(!arguments.length){return Ew}Ew=E5;return En};En.linkDistance=function(E5){if(!arguments.length){return E4}E4=d3.functor(E5);return En};En.distance=En.linkDistance;En.linkStrength=function(E5){if(!arguments.length){return Ep}Ep=d3.functor(E5);return En};En.friction=function(E5){if(!arguments.length){return Et}Et=E5;return En};En.charge=function(E5){if(!arguments.length){return Ez}Ez=typeof E5==="function"?E5:+E5;return En};En.gravity=function(E5){if(!arguments.length){return Er}Er=E5;return En};En.theta=function(E5){if(!arguments.length){return Eu}Eu=E5;return En};En.alpha=function(E5){if(!arguments.length){return Eq}if(Eq){if(E5>0){Eq=E5}else{Eq=0}}else{if(E5>0){E0.start({type:"start",alpha:Eq=E5});d3.timer(En.tick)}}return En};En.start=function(){var E9,E8,E6=Ey.length,E7=Eo.length,FC=Ew[0],FB=Ew[1],FE,E5;for(E9=0;E9<E6;++E9){(E5=Ey[E9]).index=E9;E5.weight=0}Es=[];e=[];for(E9=0;E9<E7;++E9){E5=Eo[E9];if(typeof E5.source=="number"){E5.source=Ey[E5.source]}if(typeof E5.target=="number"){E5.target=Ey[E5.target]}Es[E9]=E4.call(this,E5,E9);e[E9]=Ep.call(this,E5,E9);++E5.source.weight;++E5.target.weight}for(E9=0;E9<E6;++E9){E5=Ey[E9];if(isNaN(E5.x)){E5.x=FA("x",FC)}if(isNaN(E5.y)){E5.y=FA("y",FB)}if(isNaN(E5.px)){E5.px=E5.x}if(isNaN(E5.py)){E5.py=E5.y}}Ev=[];if(typeof Ez==="function"){for(E9=0;E9<E6;++E9){Ev[E9]=+Ez.call(this,Ey[E9],E9)}}else{for(E9=0;E9<E6;++E9){Ev[E9]=Ez}}function FA(FK,FJ){var FI=FD(E9),FH=-1,FG=FI.length,FF;while(++FH<FG){if(!isNaN(FF=FI[FH][FK])){return FF}}return Math.random()*FJ}function FD(){if(!FE){FE=[];for(E8=0;E8<E6;++E8){FE[E8]=[]}for(E8=0;E8<E7;++E8){var FF=Eo[E8];FE[FF.source.index].push(FF.target);FE[FF.target.index].push(FF.source)}}return FE[E9]}return En.resume()};En.resume=function(){return En.alpha(0.1)};En.stop=function(){return En.alpha(0)};En.drag=function(){if(!E2){E2=d3.behavior.drag().origin(Object).on("dragstart",Ex).on("drag",C6).on("dragend",Cc)}this.on("mouseover.force",J).on("mouseout.force",Dm).call(E2)};function Ex(E5){J(DC=E5);Cy=En}return d3.rebind(En,E0,"on")};var Cy,DC;function J(e){e.fixed|=2}function Dm(e){if(e!==DC){e.fixed&=1}}function Cc(){DC.fixed&=1;Cy=DC=null}function C6(){DC.px=d3.event.x;DC.py=d3.event.y;Cy.resume()}function Dn(Ev,Eq,Eu){var Er=0,Eo=0;Ev.charge=0;if(!Ev.leaf){var e=Ev.nodes,En=e.length,Es=-1,Et;while(++Es<En){Et=e[Es];if(Et==null){continue}Dn(Et,Eq,Eu);Ev.charge+=Et.charge;Er+=Et.charge*Et.cx;Eo+=Et.charge*Et.cy}}if(Ev.point){if(!Ev.leaf){Ev.point.x+=Math.random()-0.5;Ev.point.y+=Math.random()-0.5}var Ep=Eq*Eu[Ev.point.index];Ev.charge+=Ev.pointCharge=Ep;Er+=Ep*Ev.point.x;Eo+=Ep*Ev.point.y}Ev.cx=Er/Ev.charge;Ev.cy=Eo/Ev.charge}function DJ(e){return 20}function A8(e){return 1}d3.layout.partition=function(){var Eo=d3.layout.hierarchy(),Ep=[1,1];function e(Et,Ex,Ez,Ey){var Er=Et.children;Et.x=Ex;Et.y=Et.depth*Ey;Et.dx=Ez;Et.dy=Ey;if(Er&&(Es=Er.length)){var Eu=-1,Es,Ew,Ev;Ez=Et.value?Ez/Et.value:0;while(++Eu<Es){e(Ew=Er[Eu],Ex,Ev=Ew.value*Ez,Ey);Ex+=Ev}}}function Eq(Et){var Es=Et.children,Eu=0;if(Es&&(Ev=Es.length)){var Er=-1,Ev;while(++Er<Ev){Eu=Math.max(Eu,Eq(Es[Er]))}}return 1+Eu}function En(Et,Es){var Er=Eo.call(this,Et,Es);e(Er[0],0,Ep[0],Ep[1]/Eq(Er[0]));return Er}En.size=function(Er){if(!arguments.length){return Ep}Ep=Er;return En};return Di(En,Eo)};d3.layout.pie=function(){var Eq=Number,Ep=j,Eo=0,En=2*Math.PI;function e(Ex,Ev){var Et=Ex.map(function(Ez,Ey){return +Eq.call(e,Ez,Ey)});var Er=+(typeof Eo==="function"?Eo.apply(this,arguments):Eo);var Es=((typeof En==="function"?En.apply(this,arguments):En)-Eo)/d3.sum(Et);var Eu=d3.range(Ex.length);if(Ep!=null){Eu.sort(Ep===j?function(Ez,Ey){return Et[Ey]-Et[Ez]}:function(Ez,Ey){return Ep(Ex[Ez],Ex[Ey])})}var Ew=[];Eu.forEach(function(Ey){Ew[Ey]={data:Ex[Ey],value:d=Et[Ey],startAngle:Er,endAngle:Er+=d*Es}});return Ew}e.value=function(Er){if(!arguments.length){return Eq}Eq=Er;return e};e.sort=function(Er){if(!arguments.length){return Ep}Ep=Er;return e};e.startAngle=function(Er){if(!arguments.length){return Eo}Eo=Er;return e};e.endAngle=function(Er){if(!arguments.length){return En}En=Er;return e};return e};var j={};d3.layout.stack=function(){var Ep=Object,Eo=An,Er=DE,Eq=DF,En=r,Es=q;function e(E0,E2){var E1=E0.map(function(E5,E4){return Ep.call(e,E5,E4)});var E3=E1.map(function(E5,E4){return E5.map(function(E6,E7){return[En.call(e,E6,E7),Es.call(e,E6,E7)]})});var Ex=Eo.call(e,E3,E2);E1=d3.permute(E1,Ex);E3=d3.permute(E3,Ex);var Ew=Er.call(e,E3,E2);var Eu=E1.length,Ev=E1[0].length,Ez,Ey,Et;for(Ey=0;Ey<Ev;++Ey){Eq.call(e,E1[0][Ey],Et=Ew[Ey],E3[0][Ey][1]);for(Ez=1;Ez<Eu;++Ez){Eq.call(e,E1[Ez][Ey],Et+=E3[Ez-1][Ey][1],E3[Ez][Ey][1])}}return E0}e.values=function(Et){if(!arguments.length){return Ep}Ep=Et;return e};e.order=function(Et){if(!arguments.length){return Eo}Eo=typeof Et==="function"?Et:AP.get(Et)||An;return e};e.offset=function(Et){if(!arguments.length){return Er}Er=typeof Et==="function"?Et:o.get(Et)||DE;return e};e.x=function(Et){if(!arguments.length){return En}En=Et;return e};e.y=function(Et){if(!arguments.length){return Es}Es=Et;return e};e.out=function(Et){if(!arguments.length){return Eq}Eq=Et;return e};return e};function r(e){return e.x}function q(e){return e.y}function DF(En,e,Eo){En.y0=e;En.y=Eo}var AP=d3.map({"inside-out":function(Eq){var Eo=Eq.length,Er,Ep,Ev=Eq.map(At),Es=Eq.map(Bj),Et=d3.range(Eo).sort(function(Ey,Ex){return Ev[Ey]-Ev[Ex]}),Eu=0,e=0,Ew=[],En=[];for(Er=0;Er<Eo;++Er){Ep=Et[Er];if(Eu<e){Eu+=Es[Ep];Ew.push(Ep)}else{e+=Es[Ep];En.push(Ep)}}return En.reverse().concat(Ew)},reverse:function(e){return d3.range(e.length).reverse()},"default":An});var o=d3.map({silhouette:function(Eq){var En=Eq.length,Eo=Eq[0].length,Es=[],Et=0,Er,Ep,e,Eu=[];for(Ep=0;Ep<Eo;++Ep){for(Er=0,e=0;Er<En;Er++){e+=Eq[Er][Ep][1]}if(e>Et){Et=e}Es.push(e)}for(Ep=0;Ep<Eo;++Ep){Eu[Ep]=(Et-Es[Ep])/2}return Eu},wiggle:function(Es){var En=Es.length,Ew=Es[0],Eo=Ew.length,Eu=0,Et,Er,Eq,Ez,Ey,Ev,E0,e,Ep,Ex=[];Ex[0]=e=Ep=0;for(Er=1;Er<Eo;++Er){for(Et=0,Ez=0;Et<En;++Et){Ez+=Es[Et][Er][1]}for(Et=0,Ey=0,E0=Ew[Er][0]-Ew[Er-1][0];Et<En;++Et){for(Eq=0,Ev=(Es[Et][Er][1]-Es[Et][Er-1][1])/(2*E0);Eq<Et;++Eq){Ev+=(Es[Eq][Er][1]-Es[Eq][Er-1][1])/E0}Ey+=Ev*Es[Et][Er][1]}Ex[Er]=e-=Ez?Ey/Ez*E0:0;if(e<Ep){Ep=e}}for(Er=0;Er<Eo;++Er){Ex[Er]-=Ep}return Ex},expand:function(Er){var Et=Er.length,e=Er[0].length,En=1/Et,Ep,Eo,Es,Eq=[];for(Eo=0;Eo<e;++Eo){for(Ep=0,Es=0;Ep<Et;Ep++){Es+=Er[Ep][Eo][1]}if(Es){for(Ep=0;Ep<Et;Ep++){Er[Ep][Eo][1]/=Es}}else{for(Ep=0;Ep<Et;Ep++){Er[Ep][Eo][1]=En}}}for(Eo=0;Eo<e;++Eo){Eq[Eo]=0}return Eq},zero:DE});function An(e){return d3.range(e.length)}function DE(Ep){var En=-1,e=Ep[0].length,Eo=[];while(++En<e){Eo[En]=0}return Eo}function At(Er){var Ep=1,Eo=0,En=Er[0][1],e,Eq=Er.length;for(;Ep<Eq;++Ep){if((e=Er[Ep][1])>En){Eo=Ep;En=e}}return Eo}function Bj(e){return e.reduce(DD,0)}function DD(e,En){return e+En[1]}d3.layout.histogram=function(){var Eq=true,En=Number,e=AX,Eo=EP;function Ep(Eu,Ev){var E0=[],Ey=Eu.map(En,this),Ew=e.call(this,Ey,Ev),Ez=Eo.call(this,Ew,Ey,Ev),E1,Ev=-1,Er=Ey.length,Es=Ez.length-1,Et=Eq?1:1/Er,Ex;while(++Ev<Es){E1=E0[Ev]=[];E1.dx=Ez[Ev+1]-(E1.x=Ez[Ev]);E1.y=0}Ev=-1;while(++Ev<Er){Ex=Ey[Ev];if((Ex>=Ew[0])&&(Ex<=Ew[1])){E1=E0[d3.bisect(Ez,Ex,1,Es)-1];E1.y+=Et;E1.push(Eu[Ev])}}return E0}Ep.value=function(Er){if(!arguments.length){return En}En=Er;return Ep};Ep.range=function(Er){if(!arguments.length){return e}e=d3.functor(Er);return Ep};Ep.bins=function(Er){if(!arguments.length){return Eo}Eo=typeof Er==="number"?function(Es){return F(Es,Er)}:d3.functor(Er);return Ep};Ep.frequency=function(Er){if(!arguments.length){return Eq}Eq=!!Er;return Ep};return Ep};function EP(En,e){return F(En,Math.ceil(Math.log(e.length)/Math.LN2+1))}function F(Ep,Er){var Eo=-1,En=+Ep[0],e=(Ep[1]-En)/Er,Eq=[];while(++Eo<=Er){Eq[Eo]=e*Eo+En}return Eq}function AX(e){return[d3.min(e),d3.max(e)]}d3.layout.hierarchy=function(){var Eo=Bx,En=AR,Eq=EY;function Ep(Ex,Ew,Es){var Ez=En.call(e,Ex,Ew),Eu=H?Ex:{data:Ex};Eu.depth=Ew;Es.push(Eu);if(Ez&&(Et=Ez.length)){var Ey=-1,Et,E0=Eu.children=[],E1=0,Ev=Ew+1;while(++Ey<Et){d=Ep(Ez[Ey],Ev,Es);d.parent=Eu;E0.push(d);E1+=d.value}if(Eo){E0.sort(Eo)}if(Eq){Eu.value=E1}}else{if(Eq){Eu.value=+Eq.call(e,Ex,Ew)||0}}return Eu}function Er(Ew,Ex){var Ev=Ew.children,Es=0;if(Ev&&(Ey=Ev.length)){var Eu=-1,Ey,Et=Ex+1;while(++Eu<Ey){Es+=Er(Ev[Eu],Et)}}else{if(Eq){Es=+Eq.call(e,H?Ew:Ew.data,Ex)||0}}if(Eq){Ew.value=Es}return Es}function e(Et){var Es=[];Ep(Et,0,Es);return Es}e.sort=function(Es){if(!arguments.length){return Eo}Eo=Es;return e};e.children=function(Es){if(!arguments.length){return En}En=Es;return e};e.value=function(Es){if(!arguments.length){return Eq}Eq=Es;return e};e.revalue=function(Es){Er(Es,0);return Es};return e};function Di(En,e){d3.rebind(En,e,"sort","children","value");En.links=Dj;En.nodes=function(Eo){H=true;return(En.nodes=En)(Eo)};return En}function AR(e){return e.children}function EY(e){return e.value}function Bx(En,e){return e.value-En.value}function Dj(e){return d3.merge(e.map(function(En){return(En.children||[]).map(function(Eo){return{source:En,target:Eo}})}))}var H=false;d3.layout.pack=function(){var e=d3.layout.hierarchy().sort(CM),Eo=[1,1];function En(Ev,Et){var Es=e.call(this,Ev,Et),Eq=Es[0];Eq.x=0;Eq.y=0;B7(Eq);var Ep=Eo[0],Eu=Eo[1],Er=1/Math.max(2*Eq.r/Ep,2*Eq.r/Eu);C0(Eq,Ep/2,Eu/2,Er);return Es}En.size=function(Ep){if(!arguments.length){return Eo}Eo=Ep;return En};return Di(En,e)};function CM(En,e){return En.value-e.value}function Ao(En,e){var Eo=En._pack_next;En._pack_next=e;e._pack_prev=En;e._pack_next=Eo;Eo._pack_prev=e}function AT(En,e){En._pack_next=e;e._pack_prev=En}function CF(Eo,e){var Ep=e.x-Eo.x,En=e.y-Eo.y,Eq=Eo.r+e.r;return Eq*Eq-Ep*Ep-En*En>0.001}function g(Ew){var E1=Infinity,E5=-Infinity,e=Infinity,Eq=-Infinity,Ev=Ew.length,E4,E3,E2,Ez,Ey;function Eo(E6){E1=Math.min(E6.x-E6.r,E1);E5=Math.max(E6.x+E6.r,E5);e=Math.min(E6.y-E6.r,e);Eq=Math.max(E6.y+E6.r,Eq)}Ew.forEach(AG);E4=Ew[0];E4.x=-E4.r;E4.y=0;Eo(E4);if(Ev>1){E3=Ew[1];E3.x=E3.r;E3.y=0;Eo(E3);if(Ev>2){E2=Ew[2];AS(E4,E3,E2);Eo(E2);Ao(E4,E2);E4._pack_prev=E2;Ao(E2,E3);E3=E4._pack_next;for(var E0=3;E0<Ev;E0++){AS(E4,E3,E2=Ew[E0]);var En=0,Er=1,Ep=1;for(Ez=E3._pack_next;Ez!==E3;Ez=Ez._pack_next,Er++){if(CF(Ez,E2)){En=1;break}}if(En==1){for(Ey=E4._pack_prev;Ey!==Ez._pack_prev;Ey=Ey._pack_prev,Ep++){if(CF(Ey,E2)){break}}}if(En){if(Er<Ep||(Er==Ep&&E3.r<E4.r)){AT(E4,E3=Ez)}else{AT(E4=Ey,E3)}E0--}else{Ao(E4,E2);E3=E2;Eo(E2)}}}}var Et=(E1+E5)/2,Es=(e+Eq)/2,Eu=0;for(var E0=0;E0<Ev;E0++){var Ex=Ew[E0];Ex.x-=Et;Ex.y-=Es;Eu=Math.max(Eu,Ex.r+Math.sqrt(Ex.x*Ex.x+Ex.y*Ex.y))}Ew.forEach(CS);return Eu}function AG(e){e._pack_next=e._pack_prev=e}function CS(e){delete e._pack_next;delete e._pack_prev}function B7(En){var e=En.children;if(e&&e.length){e.forEach(B7);En.r=g(e)}else{En.r=Math.sqrt(En.value)}}function C0(Eq,e,Es,En){var Ep=Eq.children;Eq.x=(e+=En*Eq.x);Eq.y=(Es+=En*Eq.y);Eq.r*=En;if(Ep){var Eo=-1,Er=Ep.length;while(++Eo<Er){C0(Ep[Eo],e,Es,En)}}}function AS(Er,Ep,En){var Eu=Er.r+En.r,Ex=Ep.x-Er.x,Ev=Ep.y-Er.y;if(Eu&&(Ex||Ev)){var Ew=Ep.r+En.r,Et=Math.sqrt(Ex*Ex+Ev*Ev),Es=Math.max(-1,Math.min(1,(Eu*Eu+Et*Et-Ew*Ew)/(2*Eu*Et))),e=Math.acos(Es),Eq=Es*(Eu/=Et),Eo=Math.sin(e)*Eu;En.x=Er.x+Eq*Ex+Eo*Ev;En.y=Er.y+Eq*Ev-Eo*Ex}else{En.x=Er.x+Eu;En.y=Er.y}}d3.layout.cluster=function(){var En=d3.layout.hierarchy().sort(null).value(null),Ep=Bm,Eo=[1,1];function e(Ex,Eu){var Eq=En.call(this,Ex,Eu),Ey=Eq[0],Ez,E0=0,Ew,Ev;ET(Ey,function(E3){var E2=E3.children;if(E2&&E2.length){E3.x=Ad(E2);E3.y=Ac(E2)}else{E3.x=Ez?E0+=Ep(E3,Ez):0;E3.y=0;Ez=E3}});var Et=CN(Ey),E1=Br(Ey),Es=Et.x-Ep(Et,E1)/2,Er=E1.x+Ep(E1,Et)/2;ET(Ey,function(E2){E2.x=(E2.x-Es)/(Er-Es)*Eo[0];E2.y=(1-(Ey.y?E2.y/Ey.y:1))*Eo[1]});return Eq}e.separation=function(Eq){if(!arguments.length){return Ep}Ep=Eq;return e};e.size=function(Eq){if(!arguments.length){return Eo}Eo=Eq;return e};return Di(e,En)};function Ac(e){return 1+d3.max(e,function(En){return En.y})}function Ad(e){return e.reduce(function(En,Eo){return En+Eo.x},0)/e.length}function CN(En){var e=En.children;return e&&e.length?CN(e[0]):En}function Br(En){var e=En.children,Eo;return e&&(Eo=e.length)?Br(e[Eo-1]):En}d3.layout.tree=function(){var En=d3.layout.hierarchy().sort(null).value(null),Ep=Bm,Eo=[1,1];function e(Ex,Ev){var Er=En.call(this,Ex,Ev),Ez=Er[0];function Ew(E7,E3){var E5=E7.children,FA=E7._tree;if(E5&&(E6=E5.length)){var E6,FC=E5[0],FB,E9=FC,E4,E8=-1;while(++E8<E6){E4=E5[E8];Ew(E4,FB);E9=Eq(E4,FB,E9);FB=E4}Bo(E7);var FD=0.5*(FC._tree.prelim+E4._tree.prelim);if(E3){FA.prelim=E3._tree.prelim+Ep(E7,E3);FA.mod=FA.prelim-FD}else{FA.prelim=FD}}else{if(E3){FA.prelim=E3._tree.prelim+Ep(E7,E3)}}}function Ey(E6,E3){E6.x=E6._tree.prelim+E3;var E5=E6.children;if(E5&&(E7=E5.length)){var E4=-1,E7;E3+=E6._tree.mod;while(++E4<E7){Ey(E5[E4],E3)}}}function Eq(E7,E3,FA){if(E3){var E6=E7,E5=E7,E9=E3,E8=E7.parent.children[0],FC=E6._tree.mod,FB=E5._tree.mod,FE=E9._tree.mod,FD=E8._tree.mod,E4;while(E9=y(E9),E6=Ee(E6),E9&&E6){E8=Ee(E8);E5=y(E5);E5._tree.ancestor=E7;E4=E9._tree.prelim+FE-E6._tree.prelim-FC+Ep(E9,E6);if(E4>0){Eg(DP(E9,E7,FA),E7,E4);FC+=E4;FB+=E4}FE+=E9._tree.mod;FC+=E6._tree.mod;FD+=E8._tree.mod;FB+=E5._tree.mod}if(E9&&!y(E5)){E5._tree.thread=E9;E5._tree.mod+=FE-FB}if(E6&&!Ee(E8)){E8._tree.thread=E6;E8._tree.mod+=FC-FD;FA=E7}}return FA}ET(Ez,function(E4,E3){E4._tree={ancestor:E4,prelim:0,mod:0,change:0,shift:0,number:E3?E3._tree.number+1:0}});Ew(Ez);Ey(Ez,-Ez._tree.prelim);var Eu=B4(Ez,Ah),E2=B4(Ez,BT),E1=B4(Ez,W),Et=Eu.x-Ep(Eu,E2)/2,Es=E2.x+Ep(E2,Eu)/2,E0=E1.depth||1;ET(Ez,function(E3){E3.x=(E3.x-Et)/(Es-Et)*Eo[0];E3.y=E3.depth/E0*Eo[1];delete E3._tree});return Er}e.separation=function(Eq){if(!arguments.length){return Ep}Ep=Eq;return e};e.size=function(Eq){if(!arguments.length){return Eo}Eo=Eq;return e};return Di(e,En)};function Bm(En,e){return En.parent==e.parent?1:2}function Ee(En){var e=En.children;return e&&e.length?e[0]:En._tree.thread}function y(En){var e=En.children,Eo;return e&&(Eo=e.length)?e[Eo-1]:En._tree.thread}function B4(Eo,Ep){var En=Eo.children;if(En&&(Eq=En.length)){var Er,Eq,e=-1;while(++e<Eq){if(Ep(Er=B4(En[e],Ep),Eo)>0){Eo=Er}}}return Eo}function BT(En,e){return En.x-e.x}function Ah(En,e){return e.x-En.x}function W(En,e){return En.depth-e.depth}function ET(En,Eo){function e(Et,Es){var Er=Et.children;if(Er&&(Eu=Er.length)){var Ev,Eq=null,Ep=-1,Eu;while(++Ep<Eu){Ev=Er[Ep];e(Ev,Eq);Eq=Ev}}Eo(Et,Es)}e(En,null)}function Bo(Ep){var e=0,Er=0,Eo=Ep.children,En=Eo.length,Eq;while(--En>=0){Eq=Eo[En]._tree;Eq.prelim+=e;Eq.mod+=e;e+=Eq.shift+(Er+=Eq.change)}}function Eg(En,Eo,e){En=En._tree;Eo=Eo._tree;var Ep=e/(Eo.number-En.number);En.change+=Ep;Eo.change-=Ep;Eo.shift+=e;Eo.prelim+=e;Eo.mod+=e}function DP(e,Eo,En){return e._tree.ancestor.parent==Eo.parent?e._tree.ancestor:En}d3.layout.treemap=function(){var Et=d3.layout.hierarchy(),Ex=Math.round,Ez=[1,1],Eu=null,e=Cm,Ev=false,Er,Es=0.5*(1+Math.sqrt(5));function En(E2,E0){var E1=-1,E5=E2.length,E4,E3;while(++E1<E5){E3=(E4=E2[E1]).value*(E0<0?0:E0);E4.area=isNaN(E3)||E3<=0?0:E3}}function Ep(E4){var E1=E4.children;if(E1&&E1.length){var E7=e(E4),E9=[],E6=E1.slice(),E0,E5=Infinity,E3,E8=Math.min(E7.dx,E7.dy),E2;En(E6,E7.dx*E7.dy/E4.value);E9.area=0;while((E2=E6.length)>0){E9.push(E0=E6[E2-1]);E9.area+=E0.area;if((E3=Eo(E9,E8))<=E5){E6.pop();E5=E3}else{E9.area-=E9.pop().area;Eq(E9,E8,E7,false);E8=Math.min(E7.dx,E7.dy);E9.length=E9.area=0;E5=Infinity}}if(E9.length){Eq(E9,E8,E7,true);E9.length=E9.area=0}E1.forEach(Ep)}}function Ey(E3){var E0=E3.children;if(E0&&E0.length){var E2=e(E3),E1=E0.slice(),E5,E4=[];En(E1,E2.dx*E2.dy/E3.value);E4.area=0;while(E5=E1.pop()){E4.push(E5);E4.area+=E5.area;if(E5.z!=null){Eq(E4,E5.z?E2.dx:E2.dy,E2,!E1.length);E4.length=E4.area=0}}E0.forEach(Ey)}}function Eo(E5,E1){var E3=E5.area,E4,E7=0,E0=Infinity,E2=-1,E6=E5.length;while(++E2<E6){if(!(E4=E5[E2].area)){continue}if(E4<E0){E0=E4}if(E4>E7){E7=E4}}E3*=E3;E1*=E1;return E3?Math.max((E1*E7*Es)/E3,E3/(E1*E0*Es)):Infinity}function Eq(E9,E8,E4,E7){var E2=-1,E1=E9.length,E5=E4.x,E3=E4.y,E6=E8?Ex(E9.area/E8):0,E0;if(E8==E4.dx){if(E7||E6>E4.dy){E6=E4.dy}while(++E2<E1){E0=E9[E2];E0.x=E5;E0.y=E3;E0.dy=E6;E5+=E0.dx=Math.min(E4.x+E4.dx-E5,E6?Ex(E0.area/E6):0)}E0.z=true;E0.dx+=E4.x+E4.dx-E5;E4.y+=E6;E4.dy-=E6}else{if(E7||E6>E4.dx){E6=E4.dx}while(++E2<E1){E0=E9[E2];E0.x=E5;E0.y=E3;E0.dx=E6;E3+=E0.dy=Math.min(E4.y+E4.dy-E3,E6?Ex(E0.area/E6):0)}E0.z=false;E0.dy+=E4.y+E4.dy-E3;E4.x+=E6;E4.dx-=E6}}function Ew(E2){var E1=Er||Et(E2),E0=E1[0];E0.x=0;E0.y=0;E0.dx=Ez[0];E0.dy=Ez[1];if(Er){Et.revalue(E0)}En([E0],E0.dx*E0.dy/E0.value);(Er?Ey:Ep)(E0);if(Ev){Er=E1}return E1}Ew.size=function(E0){if(!arguments.length){return Ez}Ez=E0;return Ew};Ew.padding=function(E0){if(!arguments.length){return Eu}function E3(E4){var E5=E0.call(Ew,E4,E4.depth);return E5==null?Cm(E4):AM(E4,typeof E5==="number"?[E5,E5,E5,E5]:E5)}function E2(E4){return AM(E4,E0)}var E1;e=(Eu=E0)==null?Cm:(E1=typeof E0)==="function"?E3:E1==="number"?(E0=[E0,E0,E0,E0],E2):E2;return Ew};Ew.round=function(E0){if(!arguments.length){return Ex!=Number}Ex=E0?Math.round:Number;return Ew};Ew.sticky=function(E0){if(!arguments.length){return Ev}Ev=E0;Er=null;return Ew};Ew.ratio=function(E0){if(!arguments.length){return Es}Es=E0;return Ew};return Di(Ew,Et)};function Cm(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function AM(Ep,Eq){var e=Ep.x+Eq[3],Er=Ep.y+Eq[0],Eo=Ep.dx-Eq[1]-Eq[3],En=Ep.dy-Eq[0]-Eq[2];if(Eo<0){e+=Eo/2;Eo=0}if(En<0){Er+=En/2;En=0}return{x:e,y:Er,dx:Eo,dy:En}}d3.csv=function(e,En){d3.text(e,"text/csv",function(Eo){En(Eo&&d3.csv.parse(Eo))})};d3.csv.parse=function(e){var En;return d3.csv.parseRows(e,function(Es,Eq){if(Eq){var Er={},Ep=-1,Eo=En.length;while(++Ep<Eo){Er[En[Ep]]=Es[Ep]}return Er}else{En=Es;return null}})};d3.csv.parseRows=function(Et,Eq){var En={},Ep={},Ew=[],Eu=/\r\n|[,\r\n]/g,e=0,Ev,Er;Eu.lastIndex=0;function Eo(){if(Eu.lastIndex>=Et.length){return Ep}if(Er){Er=false;return En}var Ey=Eu.lastIndex;if(Et.charCodeAt(Ey)===34){var Ez=Ey;while(Ez++<Et.length){if(Et.charCodeAt(Ez)===34){if(Et.charCodeAt(Ez+1)!==34){break}Ez++}}Eu.lastIndex=Ez+2;var E0=Et.charCodeAt(Ez+1);if(E0===13){Er=true;if(Et.charCodeAt(Ez+2)===10){Eu.lastIndex++}}else{if(E0===10){Er=true}}return Et.substring(Ey+1,Ez).replace(/""/g,'"')}var Ex=Eu.exec(Et);if(Ex){Er=Ex[0].charCodeAt(0)!==44;return Et.substring(Ey,Ex.index)}Eu.lastIndex=Et.length;return Et.substring(Ey)}while((Ev=Eo())!==Ep){var Es=[];while((Ev!==En)&&(Ev!==Ep)){Es.push(Ev);Ev=Eo()}if(Eq&&!(Es=Eq(Es,e++))){continue}Ew.push(Es)}return Ew};d3.csv.format=function(e){return e.map(CC).join("\n")};function CC(e){return e.map(w).join(",")}function w(e){return/[",\n]/.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}d3.geo={};var CT=Math.PI/180;d3.geo.azimuthal=function(){var Er="orthographic",Eu,Ep=200,Eo=[480,250],e,Et,Eq,Es;function En(E6){var Ew=E6[0]*CT-e,E5=E6[1]*CT,E0=Math.cos(Ew),Ev=Math.sin(Ew),Ey=Math.cos(E5),E4=Math.sin(E5),Ex=Er!=="orthographic"?Es*E4+Eq*Ey*E0:null,E1,Ez=Er==="stereographic"?1/(1+Ex):Er==="gnomonic"?1/Ex:Er==="equidistant"?(E1=Math.acos(Ex),E1?E1/Math.sin(E1):0):Er==="equalarea"?Math.sqrt(2/(1+Ex)):1,E3=Ez*Ey*Ev,E2=Ez*(Es*Ey*E0-Eq*E4);return[Ep*E3+Eo[0],Ep*E2+Eo[1]]}En.invert=function(Ey){var Ev=(Ey[0]-Eo[0])/Ep,E1=(Ey[1]-Eo[1])/Ep,Ew=Math.sqrt(Ev*Ev+E1*E1),E0=Er==="stereographic"?2*Math.atan(Ew):Er==="gnomonic"?Math.atan(Ew):Er==="equidistant"?Ew:Er==="equalarea"?2*Math.asin(0.5*Ew):Math.asin(Ew),Ex=Math.sin(E0),Ez=Math.cos(E0);return[(e+Math.atan2(Ev*Ex,Ew*Eq*Ez+E1*Es*Ex))/CT,Math.asin(Ez*Es-(Ew?(E1*Ex*Eq)/Ew:0))/CT]};En.mode=function(Ev){if(!arguments.length){return Er}Er=Ev+"";return En};En.origin=function(Ev){if(!arguments.length){return Eu}Eu=Ev;e=Eu[0]*CT;Et=Eu[1]*CT;Eq=Math.cos(Et);Es=Math.sin(Et);return En};En.scale=function(Ev){if(!arguments.length){return Ep}Ep=+Ev;return En};En.translate=function(Ev){if(!arguments.length){return Eo}Eo=[+Ev[0],+Ev[1]];return En};return En.origin([0,0])};d3.geo.albers=function(){var Eu=[-98,38],Es=[29.5,45.5],Er=1000,Eq=[480,250],Et,Ep,En,Ev;function Eo(Ey){var Ew=Ep*(CT*Ey[0]-Et),Ex=Math.sqrt(En-2*Ep*Math.sin(CT*Ey[1]))/Ep;return[Er*Ex*Math.sin(Ew)+Eq[0],Er*(Ex*Math.cos(Ew)-Ev)+Eq[1]]}Eo.invert=function(Ez){var Ew=(Ez[0]-Eq[0])/Er,E1=(Ez[1]-Eq[1])/Er,E0=Ev+E1,Ex=Math.atan2(Ew,E0),Ey=Math.sqrt(Ew*Ew+E0*E0);return[(Et+Ex/Ep)/CT,Math.asin((En-Ey*Ey*Ep*Ep)/(2*Ep))/CT]};function e(){var Ex=CT*Es[0],Ew=CT*Es[1],E0=CT*Eu[1],Ey=Math.sin(Ex),Ez=Math.cos(Ex);Et=CT*Eu[0];Ep=0.5*(Ey+Math.sin(Ew));En=Ez*Ez+2*Ep*Ey;Ev=Math.sqrt(En-2*Ep*Math.sin(E0))/Ep;return Eo}Eo.origin=function(Ew){if(!arguments.length){return Eu}Eu=[+Ew[0],+Ew[1]];return e()};Eo.parallels=function(Ew){if(!arguments.length){return Es}Es=[+Ew[0],+Ew[1]];return e()};Eo.scale=function(Ew){if(!arguments.length){return Er}Er=+Ew;return Eo};Eo.translate=function(Ew){if(!arguments.length){return Eq}Eq=[+Ew[0],+Ew[1]];return Eo};return e()};d3.geo.albersUsa=function(){var e=d3.geo.albers();var Eq=d3.geo.albers().origin([-160,60]).parallels([55,65]);var Ep=d3.geo.albers().origin([-160,20]).parallels([8,18]);var Eo=d3.geo.albers().origin([-60,10]).parallels([8,18]);function En(Et){var Es=Et[0],Er=Et[1];return(Er>50?Eq:Es<-140?Ep:Er<21?Eo:e)(Et)}En.scale=function(Er){if(!arguments.length){return e.scale()}e.scale(Er);Eq.scale(Er*0.6);Ep.scale(Er);Eo.scale(Er*1.5);return En.translate(e.translate())};En.translate=function(Es){if(!arguments.length){return e.translate()}var Er=e.scale()/1000,Eu=Es[0],Et=Es[1];e.translate(Es);Eq.translate([Eu-400*Er,Et+170*Er]);Ep.translate([Eu-190*Er,Et+200*Er]);Eo.translate([Eu+580*Er,Et+430*Er]);return En};return En.scale(e.scale())};d3.geo.bonne=function(){var Er=200,Eq=[480,250],e,Ep,Eo,En;function Es(Ew){var Et=Ew[0]*CT-e,Ex=Ew[1]*CT-Ep;if(Eo){var Ev=En+Eo-Ex,Eu=Et*Math.cos(Ex)/Ev;Et=Ev*Math.sin(Eu);Ex=Ev*Math.cos(Eu)-En}else{Et*=Math.cos(Ex);Ex*=-1}return[Er*Et+Eq[0],Er*Ex+Eq[1]]}Es.invert=function(Ev){var Et=(Ev[0]-Eq[0])/Er,Ex=(Ev[1]-Eq[1])/Er;if(Eo){var Ew=En+Ex,Eu=Math.sqrt(Et*Et+Ew*Ew);Ex=En+Eo-Eu;Et=e+Eu*Math.atan2(Et,Ew)/Math.cos(Ex)}else{Ex*=-1;Et/=Math.cos(Ex)}return[Et/CT,Ex/CT]};Es.parallel=function(Et){if(!arguments.length){return Eo/CT}En=1/Math.tan(Eo=Et*CT);return Es};Es.origin=function(Et){if(!arguments.length){return[e/CT,Ep/CT]}e=Et[0]*CT;Ep=Et[1]*CT;return Es};Es.scale=function(Et){if(!arguments.length){return Er}Er=+Et;return Es};Es.translate=function(Et){if(!arguments.length){return Eq}Eq=[+Et[0],+Et[1]];return Es};return Es.origin([0,0]).parallel(45)};d3.geo.equirectangular=function(){var Eo=500,En=[480,250];function e(Eq){var Ep=Eq[0]/360,Er=-Eq[1]/360;return[Eo*Ep+En[0],Eo*Er+En[1]]}e.invert=function(Eq){var Ep=(Eq[0]-En[0])/Eo,Er=(Eq[1]-En[1])/Eo;return[360*Ep,-360*Er]};e.scale=function(Ep){if(!arguments.length){return Eo}Eo=+Ep;return e};e.translate=function(Ep){if(!arguments.length){return En}En=[+Ep[0],+Ep[1]];return e};return e};d3.geo.mercator=function(){var Eo=500,En=[480,250];function e(Eq){var Ep=Eq[0]/360,Er=-(Math.log(Math.tan(Math.PI/4+Eq[1]*CT/2))/CT)/360;return[Eo*Ep+En[0],Eo*Math.max(-0.5,Math.min(0.5,Er))+En[1]]}e.invert=function(Eq){var Ep=(Eq[0]-En[0])/Eo,Er=(Eq[1]-En[1])/Eo;return[360*Ep,2*Math.atan(Math.exp(-360*Er*CT))/CT-90]};e.scale=function(Ep){if(!arguments.length){return Eo}Eo=+Ep;return e};e.translate=function(Ep){if(!arguments.length){return En}En=[+Ep[0],+Ep[1]];return e};return e};function DA(En,e){return function(Eo){return Eo&&En.hasOwnProperty(Eo.type)?En[Eo.type](Eo):e}}d3.geo.path=function(){var Es=4.5,Ew=Z(Es),Er=d3.geo.albersUsa();function Ev(Ey,Ex){if(typeof Es==="function"){Ew=Z(Es.apply(this,arguments))}return En(Ey)||null}function Et(Ex){return Er(Ex).join(",")}var En=DA({FeatureCollection:function(E0){var Ez=[],Ey=E0.features,Ex=-1,E1=Ey.length;while(++Ex<E1){Ez.push(En(Ey[Ex].geometry))}return Ez.join("")},Feature:function(Ex){return En(Ex.geometry)},Point:function(Ex){return"M"+Et(Ex.coordinates)+Ew},MultiPoint:function(E0){var Ey=[],Ez=E0.coordinates,Ex=-1,E1=Ez.length;while(++Ex<E1){Ey.push("M",Et(Ez[Ex]),Ew)}return Ey.join("")},LineString:function(E0){var Ey=["M"],Ez=E0.coordinates,Ex=-1,E1=Ez.length;while(++Ex<E1){Ey.push(Et(Ez[Ex]),"L")}Ey.pop();return Ey.join("")},MultiLineString:function(E3){var E1=[],E2=E3.coordinates,E0=-1,E4=E2.length,Ey,Ez,Ex;while(++E0<E4){Ey=E2[E0];Ez=-1;Ex=Ey.length;E1.push("M");while(++Ez<Ex){E1.push(Et(Ey[Ez]),"L")}E1.pop()}return E1.join("")},Polygon:function(E3){var E1=[],E2=E3.coordinates,E0=-1,E4=E2.length,Ey,Ez,Ex;while(++E0<E4){Ey=E2[E0];Ez=-1;if((Ex=Ey.length-1)>0){E1.push("M");while(++Ez<Ex){E1.push(Et(Ey[Ez]),"L")}E1[E1.length-1]="Z"}}return E1.join("")},MultiPolygon:function(Ey){var E7=[],E6=Ey.coordinates,E5=-1,Ez=E6.length,E2,E4,E0,E3,E1,Ex;while(++E5<Ez){E2=E6[E5];E4=-1;E0=E2.length;while(++E4<E0){E3=E2[E4];E1=-1;if((Ex=E3.length-1)>0){E7.push("M");while(++E1<Ex){E7.push(Et(E3[E1]),"L")}E7[E7.length-1]="Z"}}}return E7.join("")},GeometryCollection:function(E0){var Ez=[],Ey=E0.geometries,Ex=-1,E1=Ey.length;while(++Ex<E1){Ez.push(En(Ey[Ex]))}return Ez.join("")}});var Eo=Ev.area=DA({FeatureCollection:function(E0){var Ez=0,Ey=E0.features,Ex=-1,E1=Ey.length;while(++Ex<E1){Ez+=Eo(Ey[Ex])}return Ez},Feature:function(Ex){return Eo(Ex.geometry)},Polygon:function(Ex){return Eq(Ex.coordinates)},MultiPolygon:function(E0){var Ey=0,Ez=E0.coordinates,Ex=-1,E1=Ez.length;while(++Ex<E1){Ey+=Eq(Ez[Ex])}return Ey},GeometryCollection:function(E0){var Ez=0,Ey=E0.geometries,Ex=-1,E1=Ey.length;while(++Ex<E1){Ez+=Eo(Ey[Ex])}return Ez}},0);function Eq(Ez){var Ey=Ep(Ez[0]),Ex=0,E0=Ez.length;while(++Ex<E0){Ey-=Ep(Ez[Ex])}return Ey}function e(E5){var E3=d3.geom.polygon(E5[0].map(Er)),Ex=E3.area(),Ey=E3.centroid(Ex<0?(Ex*=-1,1):-1),E4=Ey[0],E2=Ey[1],E1=Ex,E0=0,Ez=E5.length;while(++E0<Ez){E3=d3.geom.polygon(E5[E0].map(Er));Ex=E3.area();Ey=E3.centroid(Ex<0?(Ex*=-1,1):-1);E4-=Ey[0];E2-=Ey[1];E1-=Ex}return[E4,E2,6*E1]}var Eu=Ev.centroid=DA({Feature:function(Ex){return Eu(Ex.geometry)},Polygon:function(Ey){var Ex=e(Ey.coordinates);return[Ex[0]/Ex[2],Ex[1]/Ex[2]]},MultiPolygon:function(Ey){var Ex=0,E5=Ey.coordinates,Ez,E4=0,E3=0,E2=0,E1=-1,E0=E5.length;while(++E1<E0){Ez=e(E5[E1]);E4+=Ez[0];E3+=Ez[1];E2+=Ez[2]}return[E4/E2,E3/E2]}});function Ep(Ex){return Math.abs(d3.geom.polygon(Ex.map(Er)).area())}Ev.projection=function(Ex){Er=Ex;return Ev};Ev.pointRadius=function(Ex){if(typeof Ex==="function"){Es=Ex}else{Es=+Ex;Ew=Z(Es)}return Ev};return Ev};function Z(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+(-2*e)+"a"+e+","+e+" 0 1,1 0,"+(+2*e)+"z"}d3.geo.bounds=function(Eo){var Eq=Infinity,e=Infinity,En=-Infinity,Ep=-Infinity;Bc(Eo,function(Er,Es){if(Er<Eq){Eq=Er}if(Er>En){En=Er}if(Es<e){e=Es}if(Es>Ep){Ep=Es}});return[[Eq,e],[En,Ep]]};function Bc(En,e){if(Ds.hasOwnProperty(En.type)){Ds[En.type](En,e)}}var Ds={Feature:EX,FeatureCollection:DW,GeometryCollection:Cq,LineString:Db,MultiLineString:Do,MultiPoint:Db,MultiPolygon:EV,Point:EJ,Polygon:BI};function EX(En,e){Bc(En.geometry,e)}function DW(Ep,Eo){for(var e=Ep.features,En=0,Eq=e.length;En<Eq;En++){Bc(e[En].geometry,Eo)}}function Cq(Ep,Eo){for(var e=Ep.geometries,En=0,Eq=e.length;En<Eq;En++){Bc(e[En],Eo)}}function Db(Ep,Eo){for(var e=Ep.coordinates,En=0,Eq=e.length;En<Eq;En++){Eo.apply(null,e[En])}}function Do(Es,Er){for(var Eo=Es.coordinates,Eq=0,Et=Eo.length;Eq<Et;Eq++){for(var En=Eo[Eq],Ep=0,e=En.length;Ep<e;Ep++){Er.apply(null,En[Ep])}}}function EV(Es,Er){for(var Eo=Es.coordinates,Eq=0,Et=Eo.length;Eq<Et;Eq++){for(var En=Eo[Eq][0],Ep=0,e=En.length;Ep<e;Ep++){Er.apply(null,En[Ep])}}}function EJ(En,e){e.apply(null,En.coordinates)}function BI(Ep,Eo){for(var e=Ep.coordinates[0],En=0,Eq=e.length;En<Eq;En++){Eo.apply(null,e[En])}}d3.geo.circle=function(){var Eu=[0,0],Er=90-0.01,Es=Er*CT,Eo=d3.geo.greatArc().target(Object);function En(){}function Ep(Ev){return Eo.distance(Ev)<Es}En.clip=function(Ev){Eo.source(typeof Eu==="function"?Eu.apply(this,arguments):Eu);return Et(Ev)};var Et=DA({FeatureCollection:function(Ew){var Ev=Ew.features.map(Et).filter(Object);return Ev&&(Ew=Object.create(Ew),Ew.features=Ev,Ew)},Feature:function(Ew){var Ev=Et(Ew.geometry);return Ev&&(Ew=Object.create(Ew),Ew.geometry=Ev,Ew)},Point:function(Ev){return Ep(Ev.coordinates)&&Ev},MultiPoint:function(Ew){var Ev=Ew.coordinates.filter(Ep);return Ev.length&&{type:Ew.type,coordinates:Ev}},LineString:function(Ew){var Ev=Eq(Ew.coordinates);return Ev.length&&(Ew=Object.create(Ew),Ew.coordinates=Ev,Ew)},MultiLineString:function(Ew){var Ev=Ew.coordinates.map(Eq).filter(function(Ex){return Ex.length});return Ev.length&&(Ew=Object.create(Ew),Ew.coordinates=Ev,Ew)},Polygon:function(Ew){var Ev=Ew.coordinates.map(Eq);return Ev[0].length&&(Ew=Object.create(Ew),Ew.coordinates=Ev,Ew)},MultiPolygon:function(Ew){var Ev=Ew.coordinates.map(function(Ex){return Ex.map(Eq)}).filter(function(Ex){return Ex[0].length});return Ev.length&&(Ew=Object.create(Ew),Ew.coordinates=Ev,Ew)},GeometryCollection:function(Ew){var Ev=Ew.geometries.map(Et).filter(Object);return Ev.length&&(Ew=Object.create(Ew),Ew.geometries=Ev,Ew)}});function Eq(E0){var Ez=-1,Ex=E0.length,Ey=[],E3,E2,E1,Ew,Ev;while(++Ez<Ex){Ev=Eo.distance(E1=E0[Ez]);if(Ev<Es){if(E2){Ey.push(Em(E2,E1)((Ew-Es)/(Ew-Ev)))}Ey.push(E1);E3=E2=null}else{E2=E1;if(!E3&&Ey.length){Ey.push(Em(Ey[Ey.length-1],E2)((Es-Ew)/(Ev-Ew)));E3=E2}}Ew=Ev}if(E2&&Ey.length){Ev=Eo.distance(E1=Ey[0]);Ey.push(Em(E2,E1)((Ew-Es)/(Ew-Ev)))}return e(Ey)}function e(E1){var Ez=0,E2=E1.length,Ey,Ev,Ew=E2?[E1[0]]:E1,E0,Ex=Eo.source();while(++Ez<E2){E0=Eo.source(E1[Ez-1])(E1[Ez]).coordinates;for(Ey=0,Ev=E0.length;++Ey<Ev;){Ew.push(E0[Ey])}}Eo.source(Ex);return Ew}En.origin=function(Ev){if(!arguments.length){return Eu}Eu=Ev;return En};En.angle=function(Ev){if(!arguments.length){return Er}Es=(Er=+Ev)*CT;return En};En.precision=function(Ev){if(!arguments.length){return Eo.precision()}Eo.precision(Ev);return En};return En};d3.geo.greatArc=function(){var Eo=BZ,Ep=Be,En=6*CT;function e(){var Er=typeof Eo==="function"?Eo.apply(this,arguments):Eo,Eq=typeof Ep==="function"?Ep.apply(this,arguments):Ep,Et=Em(Er,Eq),Eu=En/Et.d,Es=0,Ev=[Er];while((Es+=Eu)<1){Ev.push(Et(Es))}Ev.push(Eq);return{type:"LineString",coordinates:Ev}}e.distance=function(){var Er=typeof Eo==="function"?Eo.apply(this,arguments):Eo,Eq=typeof Ep==="function"?Ep.apply(this,arguments):Ep;return Em(Er,Eq).d};e.source=function(Eq){if(!arguments.length){return Eo}Eo=Eq;return e};e.target=function(Eq){if(!arguments.length){return Ep}Ep=Eq;return e};e.precision=function(Eq){if(!arguments.length){return En/CT}En=Eq*CT;return e};return e};function BZ(e){return e.source}function Be(e){return e.target}function Em(E0,Ex){var Ep=E0[0]*CT,Ew=Math.cos(Ep),Eo=Math.sin(Ep),E2=E0[1]*CT,Er=Math.cos(E2),E1=Math.sin(E2),En=Ex[0]*CT,Ev=Math.cos(En),e=Math.sin(En),Ez=Ex[1]*CT,Eq=Math.cos(Ez),Ey=Math.sin(Ez),Eu=Es.d=Math.acos(Math.max(-1,Math.min(1,E1*Ey+Er*Eq*Math.cos(En-Ep)))),Et=Math.sin(Eu);function Es(E5){var E4=Math.sin(Eu-(E5*=Eu))/Et,E8=Math.sin(E5)/Et,E3=E4*Er*Ew+E8*Eq*Ev,E7=E4*Er*Eo+E8*Eq*e,E6=E4*E1+E8*Ey;return[Math.atan2(E7,E3)/CT,Math.atan2(E6,Math.sqrt(E3*E3+E7*E7))/CT]}return Es}d3.geo.greatCircle=d3.geo.circle;d3.geom={};d3.geom.contour=function(e,En){var Ev=En||K(e),Er=[],Et=Ev[0],Es=Ev[1],Ew=0,Eu=0,Ep=NaN,Eo=NaN,Eq=0;do{Eq=0;if(e(Et-1,Es-1)){Eq+=1}if(e(Et,Es-1)){Eq+=2}if(e(Et-1,Es)){Eq+=4}if(e(Et,Es)){Eq+=8}if(Eq===6){Ew=Eo===-1?-1:1;Eu=0}else{if(Eq===9){Ew=0;Eu=Ep===1?-1:1}else{Ew=BX[Eq];Eu=BV[Eq]}}if(Ew!=Ep&&Eu!=Eo){Er.push([Et,Es]);Ep=Ew;Eo=Eu}Et+=Ew;Es+=Eu}while(Ev[0]!=Et||Ev[1]!=Es);return Er};var BX=[1,0,1,1,-1,0,-1,1,0,0,0,0,-1,0,-1,NaN],BV=[0,-1,0,0,0,-1,0,0,1,-1,1,1,0,-1,0,NaN];function K(En){var e=0,Eo=0;while(true){if(En(e,Eo)){return[e,Eo]}if(e===0){e=Eo+1;Eo=0}else{e=e-1;Eo=Eo+1}}}d3.geom.hull=function(Ev){if(Ev.length<3){return[]}var Eu=Ev.length,Eq=Eu-1,E1=[],Ex=[],Es,Er,Et=0,Ep,Ez,En,Ew,E2,E0,Ey,Eo;for(Es=1;Es<Eu;++Es){if(Ev[Es][1]<Ev[Et][1]){Et=Es}else{if(Ev[Es][1]==Ev[Et][1]){Et=(Ev[Es][0]<Ev[Et][0]?Es:Et)}}}for(Es=0;Es<Eu;++Es){if(Es===Et){continue}Ez=Ev[Es][1]-Ev[Et][1];Ep=Ev[Es][0]-Ev[Et][0];E1.push({angle:Math.atan2(Ez,Ep),index:Es})}E1.sort(function(E4,E3){return E4.angle-E3.angle});Ey=E1[0].angle;E0=E1[0].index;E2=0;for(Es=1;Es<Eq;++Es){Er=E1[Es].index;if(Ey==E1[Es].angle){Ep=Ev[E0][0]-Ev[Et][0];Ez=Ev[E0][1]-Ev[Et][1];En=Ev[Er][0]-Ev[Et][0];Ew=Ev[Er][1]-Ev[Et][1];if((Ep*Ep+Ez*Ez)>=(En*En+Ew*Ew)){E1[Es].index=-1}else{E1[E2].index=-1;Ey=E1[Es].angle;E2=Es;E0=Er}}else{Ey=E1[Es].angle;E2=Es;E0=Er}}Ex.push(Et);for(Es=0,Er=0;Es<2;++Er){if(E1[Er].index!==-1){Ex.push(E1[Er].index);Es++}}Eo=Ex.length;for(;Er<Eq;++Er){if(E1[Er].index===-1){continue}while(!Bs(Ex[Eo-2],Ex[Eo-1],E1[Er].index,Ev)){--Eo}Ex[Eo++]=E1[Er].index}var e=[];for(Es=0;Es<Eo;++Es){e.push(Ev[Ex[Es]])}return e};function Bs(Ep,Eo,En,Ew){var Ex,Ev,Eu,Et,Es,Er,Eq;Ex=Ew[Ep];Ev=Ex[0];Eu=Ex[1];Ex=Ew[Eo];Et=Ex[0];Es=Ex[1];Ex=Ew[En];Er=Ex[0];Eq=Ex[1];return((Eq-Eu)*(Et-Ev)-(Es-Eu)*(Er-Ev))>0}d3.geom.polygon=function(e){e.area=function(){var Ep=0,Eq=e.length,Eo=e[Eq-1][0]*e[0][1],En=e[Eq-1][1]*e[0][0];while(++Ep<Eq){Eo+=e[Ep-1][0]*e[Ep][1];En+=e[Ep-1][1]*e[Ep][0]}return(En-Eo)*0.5};e.centroid=function(Eq){var Er=-1,Eu=e.length,Eo=0,Et=0,Ep,En=e[Eu-1],Es;if(!arguments.length){Eq=-1/(6*e.area())}while(++Er<Eu){Ep=En;En=e[Er];Es=Ep[0]*En[1]-En[0]*Ep[1];Eo+=(Ep[0]+En[0])*Es;Et+=(Ep[1]+En[1])*Es}return[Eo*Eq,Et*Eq]};e.clip=function(Et){var Ev,Eq=-1,En=e.length,Ep,Eo,Ew=e[En-1],Eu,Es,Er;while(++Eq<En){Ev=Et.slice();Et.length=0;Eu=e[Eq];Es=Ev[(Eo=Ev.length)-1];Ep=-1;while(++Ep<Eo){Er=Ev[Ep];if(T(Er,Ew,Eu)){if(!T(Es,Ew,Eu)){Et.push(De(Es,Er,Ew,Eu))}Et.push(Er)}else{if(T(Es,Ew,Eu)){Et.push(De(Es,Er,Ew,Eu))}}Es=Er}Ew=Eu}return Et};return e};function T(Eo,En,e){return(e[0]-En[0])*(Eo[1]-En[1])<(e[1]-En[1])*(Eo[0]-En[0])}function De(Ez,Ey,E2,E1){var Ex=Ez[0],Ew=Ey[0],Ev=E2[0],Et=E1[0],Ep=Ez[1],Eo=Ey[1],En=E2[1],e=E1[1],E3=Ex-Ev,Eq=Ew-Ex,E4=Et-Ev,Er=Ep-En,E0=Eo-Ep,Es=e-En,Eu=(E4*Er-Es*E3)/(Es*Eq-E4*E0);return[Ex+Eu*Eq,Ep+Eu*E0]}d3.geom.voronoi=function(En){var e=En.map(function(){return[]});Dy(En,function(Eq){var Ew,Ev,Ep,Eo,Et,Er;if(Eq.a===1&&Eq.b>=0){Ew=Eq.ep.r;Ev=Eq.ep.l}else{Ew=Eq.ep.l;Ev=Eq.ep.r}if(Eq.a===1){Et=Ew?Ew.y:-1000000;Ep=Eq.c-Eq.b*Et;Er=Ev?Ev.y:1000000;Eo=Eq.c-Eq.b*Er}else{Ep=Ew?Ew.x:-1000000;Et=Eq.c-Eq.a*Ep;Eo=Ev?Ev.x:1000000;Er=Eq.c-Eq.a*Eo}var Eu=[Ep,Et],Es=[Eo,Er];e[Eq.region.l.index].push(Eu,Es);e[Eq.region.r.index].push(Eu,Es)});return e.map(function(Eq,Ep){var Eo=En[Ep][0],Er=En[Ep][1];Eq.forEach(function(Es){Es.angle=Math.atan2(Es[0]-Eo,Es[1]-Er)});return Eq.sort(function(Et,Es){return Et.angle-Es.angle}).filter(function(Et,Es){return !Es||(Et.angle-Eq[Es-1].angle>1e-10)})})};var Bk={l:"r",r:"l"};function Dy(Er,Ep){var E5={list:Er.map(function(e,E7){return{index:E7,x:e[0],y:e[1]}}).sort(function(E7,e){return E7.y<e.y?-1:E7.y>e.y?1:E7.x<e.x?-1:E7.x>e.x?1:0}),bottomSite:null};var Eo={list:[],leftEnd:null,rightEnd:null,init:function(){Eo.leftEnd=Eo.createHalfEdge(null,"l");Eo.rightEnd=Eo.createHalfEdge(null,"l");Eo.leftEnd.r=Eo.rightEnd;Eo.rightEnd.l=Eo.leftEnd;Eo.list.unshift(Eo.leftEnd,Eo.rightEnd)},createHalfEdge:function(E7,e){return{edge:E7,side:e,vertex:null,l:null,r:null}},insert:function(E7,e){e.l=E7;e.r=E7.r;E7.r.l=e;E7.r=e},leftBound:function(E7){var e=Eo.leftEnd;do{e=e.r}while(e!=Eo.rightEnd&&E4.rightOf(e,E7));e=e.l;return e},del:function(e){e.l.r=e.r;e.r.l=e.l;e.edge=null},right:function(e){return e.r},left:function(e){return e.l},leftRegion:function(e){return e.edge==null?E5.bottomSite:e.edge.region[e.side]},rightRegion:function(e){return e.edge==null?E5.bottomSite:e.edge.region[Bk[e.side]]}};var E4={bisect:function(FA,E8){var E9={region:{l:FA,r:E8},ep:{l:null,r:null}};var E7=E8.x-FA.x,e=E8.y-FA.y,FC=E7>0?E7:-E7,FB=e>0?e:-e;E9.c=FA.x*E7+FA.y*e+(E7*E7+e*e)*0.5;if(FC>FB){E9.a=1;E9.b=e/E7;E9.c/=E7}else{E9.b=1;E9.a=E7/e;E9.c/=e}return E9},intersect:function(FA,E9){var FF=FA.edge,FE=E9.edge;if(!FF||!FE||(FF.region.r==FE.region.r)){return null}var FD=(FF.a*FE.b)-(FF.b*FE.a);if(Math.abs(FD)<1e-10){return null}var E8=(FF.c*FE.b-FE.c*FF.b)/FD,FI=(FE.c*FF.a-FF.c*FE.a)/FD,FH=FF.region.r,FC=FE.region.r,E7,FB;if((FH.y<FC.y)||(FH.y==FC.y&&FH.x<FC.x)){E7=FA;FB=FF}else{E7=E9;FB=FE}var FG=(E8>=FB.region.r.x);if((FG&&(E7.side==="l"))||(!FG&&(E7.side==="r"))){return null}return{x:E8,y:FI}},rightOf:function(FC,E7){var FG=FC.edge,FA=FG.region.r,FJ=(E7.x>FA.x);if(FJ&&(FC.side==="l")){return 1}if(!FJ&&(FC.side==="r")){return 0}if(FG.a===1){var FI=E7.y-FA.y,E8=E7.x-FA.x,FD=0,FH=0;if((!FJ&&(FG.b<0))||(FJ&&(FG.b>=0))){FH=FD=(FI>=FG.b*E8)}else{FH=((E7.x+E7.y*FG.b)>FG.c);if(FG.b<0){FH=!FH}if(!FH){FD=1}}if(!FD){var FK=FA.x-FG.region.l.x;FH=(FG.b*(E8*E8-FI*FI))<(FK*FI*(1+2*E8/FK+FG.b*FG.b));if(FG.b<0){FH=!FH}}}else{var E9=FG.c-FG.a*E7.x,FF=E7.y-E9,FE=E7.x-FA.x,FB=E9-FA.y;FH=(FF*FF)>(FE*FE+FB*FB)}return FC.side==="l"?FH:!FH},endPoint:function(E8,E7,e){E8.ep[E7]=e;if(!E8.ep[Bk[E7]]){return}Ep(E8)},distance:function(E9,E8){var E7=E9.x-E8.x,e=E9.y-E8.y;return Math.sqrt(E7*E7+e*e)}};var En={list:[],insert:function(FB,E7,FC){FB.vertex=E7;FB.ystar=E7.y+FC;for(var E8=0,FA=En.list,e=FA.length;E8<e;E8++){var E9=FA[E8];if(FB.ystar>E9.ystar||(FB.ystar==E9.ystar&&E7.x>E9.vertex.x)){continue}else{break}}FA.splice(E8,0,FB)},del:function(E9){for(var E8=0,E7=En.list,e=E7.length;E8<e&&(E7[E8]!=E9);++E8){}E7.splice(E8,1)},empty:function(){return En.list.length===0},nextEvent:function(E9){for(var E8=0,E7=En.list,e=E7.length;E8<e;++E8){if(E7[E8]==E9){return E7[E8+1]}}return null},min:function(){var e=En.list[0];return{x:e.vertex.x,y:e.ystar}},extractMin:function(){return En.list.shift()}};Eo.init();E5.bottomSite=E5.list.shift();var E6=E5.list.shift(),Et;var Ey,Ev,Eq,E2,Es;var Ew,Ex,E3,Ez,Eu;var E1,E0;while(true){if(!En.empty()){Et=En.min()}if(E6&&(En.empty()||E6.y<Et.y||(E6.y==Et.y&&E6.x<Et.x))){Ey=Eo.leftBound(E6);Ev=Eo.right(Ey);Ew=Eo.rightRegion(Ey);E1=E4.bisect(Ew,E6);Es=Eo.createHalfEdge(E1,"l");Eo.insert(Ey,Es);Ez=E4.intersect(Ey,Es);if(Ez){En.del(Ey);En.insert(Ey,Ez,E4.distance(Ez,E6))}Ey=Es;Es=Eo.createHalfEdge(E1,"r");Eo.insert(Ey,Es);Ez=E4.intersect(Es,Ev);if(Ez){En.insert(Es,Ez,E4.distance(Ez,E6))}E6=E5.list.shift()}else{if(!En.empty()){Ey=En.extractMin();Eq=Eo.left(Ey);Ev=Eo.right(Ey);E2=Eo.right(Ev);Ew=Eo.leftRegion(Ey);Ex=Eo.rightRegion(Ev);Eu=Ey.vertex;E4.endPoint(Ey.edge,Ey.side,Eu);E4.endPoint(Ev.edge,Ev.side,Eu);Eo.del(Ey);En.del(Ev);Eo.del(Ev);E0="l";if(Ew.y>Ex.y){E3=Ew;Ew=Ex;Ex=E3;E0="r"}E1=E4.bisect(Ew,Ex);Es=Eo.createHalfEdge(E1,E0);Eo.insert(Eq,Es);E4.endPoint(E1,Bk[E0],Eu);Ez=E4.intersect(Eq,Es);if(Ez){En.del(Eq);En.insert(Eq,Ez,E4.distance(Ez,Ew))}Ez=E4.intersect(Es,E2);if(Ez){En.insert(Es,Ez,E4.distance(Ez,Ew))}}else{break}}}for(Ey=Eo.right(Eo.leftEnd);Ey!=Eo.rightEnd;Ey=Eo.right(Ey)){Ep(Ey.edge)}}d3.geom.delaunay=function(En){var e=En.map(function(){return[]}),Eo=[];Dy(En,function(Ep){e[Ep.region.l.index].push(En[Ep.region.r.index])});e.forEach(function(Eu,Et){var Er=En[Et],Eq=Er[0],Ev=Er[1];Eu.forEach(function(Ew){Ew.angle=Math.atan2(Ew[0]-Eq,Ew[1]-Ev)});Eu.sort(function(Ex,Ew){return Ex.angle-Ew.angle});for(var Es=0,Ep=Eu.length-1;Es<Ep;Es++){Eo.push([Er,Eu[Es],Eu[Es+1]])}});return Eo};d3.geom.quadtree=function(Ev,Eo,Eu,e,Et){var En,Eq=-1,Ep=Ev.length;if(Ep&&isNaN(Ev[0].x)){Ev=Ev.map(h)}if(arguments.length<5){if(arguments.length===3){Et=e=Eu;Eu=Eo}else{Eo=Eu=Infinity;e=Et=-Infinity;while(++Eq<Ep){En=Ev[Eq];if(En.x<Eo){Eo=En.x}if(En.y<Eu){Eu=En.y}if(En.x>e){e=En.x}if(En.y>Et){Et=En.y}}var Ey=e-Eo,Ex=Et-Eu;if(Ey>Ex){Et=Eu+Ey}else{e=Eo+Ex}}}function Ew(E5,E4,E1,E3,E0,E2){if(isNaN(E4.x)||isNaN(E4.y)){return}if(E5.leaf){var Ez=E5.point;if(Ez){if((Math.abs(Ez.x-E4.x)+Math.abs(Ez.y-E4.y))<0.01){Er(E5,E4,E1,E3,E0,E2)}else{E5.point=null;Er(E5,Ez,E1,E3,E0,E2);Er(E5,E4,E1,E3,E0,E2)}}else{E5.point=E4}}else{Er(E5,E4,E1,E3,E0,E2)}}function Er(E3,E1,E2,E8,E0,E6){var E7=(E2+E0)*0.5,E5=(E8+E6)*0.5,E9=E1.x>=E7,Ez=E1.y>=E5,E4=(Ez<<1)+E9;E3.leaf=false;E3=E3.nodes[E4]||(E3.nodes[E4]=DH());if(E9){E2=E7}else{E0=E7}if(Ez){E8=E5}else{E6=E5}Ew(E3,E1,E2,E8,E0,E6)}var Es=DH();Es.add=function(Ez){Ew(Es,Ez,Eo,Eu,e,Et)};Es.visit=function(Ez){BK(Ez,Es,Eo,Eu,e,Et)};Ev.forEach(Es.add);return Es};function DH(){return{leaf:true,nodes:[],point:null}}function BK(Eq,Ep,En,Eu,e,Es){if(!Eq(Ep,En,Eu,e,Es)){var Et=(En+e)*0.5,Er=(Eu+Es)*0.5,Eo=Ep.nodes;if(Eo[0]){BK(Eq,Eo[0],En,Eu,Et,Er)}if(Eo[1]){BK(Eq,Eo[1],Et,Eu,e,Er)}if(Eo[2]){BK(Eq,Eo[2],En,Er,Et,Es)}if(Eo[3]){BK(Eq,Eo[3],Et,Er,e,Es)}}}function h(e){return{x:e[0],y:e[1]}}d3.time={};var DG=Date;function D8(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}D8.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){DR.setUTCDate.apply(this._,arguments)},setDay:function(){DR.setUTCDay.apply(this._,arguments)},setFullYear:function(){DR.setUTCFullYear.apply(this._,arguments)},setHours:function(){DR.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){DR.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){DR.setUTCMinutes.apply(this._,arguments)},setMonth:function(){DR.setUTCMonth.apply(this._,arguments)},setSeconds:function(){DR.setUTCSeconds.apply(this._,arguments)},setTime:function(){DR.setTime.apply(this._,arguments)}};var DR=Date.prototype;d3.time.format=function(e){var Eo=e.length;function En(Er){var Eq=[],Es=-1,Ep=0,Eu,Et;while(++Es<Eo){if(e.charCodeAt(Es)==37){Eq.push(e.substring(Ep,Es),(Et=Dl[Eu=e.charAt(++Es)])?Et(Er):Eu);Ep=Es+1}}Eq.push(e.substring(Ep,Es));return Eq.join("")}En.parse=function(Eq){var Es={y:1900,m:0,d:1,H:0,M:0,S:0,L:0},Er=B8(Es,e,Eq,0);if(Er!=Eq.length){return null}if("p" in Es){Es.H=Es.H%12+Es.p*12}var Ep=new DG();Ep.setFullYear(Es.y,Es.m,Es.d);Ep.setHours(Es.H,Es.M,Es.S,Es.L);return Ep};En.toString=function(){return e};return En};function B8(Ep,Eu,Es,Eq){var Et,e,Er=0,En=Eu.length,Eo=Es.length;while(Er<En){if(Eq>=Eo){return -1}Et=Eu.charCodeAt(Er++);if(Et==37){e=Eb[Eu.charAt(Er++)];if(!e||((Eq=e(Ep,Es,Eq))<0)){return -1}}else{if(Et!=Es.charCodeAt(Eq++)){return -1}}}return Eq}var Ak=d3.format("02d"),Aj=d3.format("03d"),Ai=d3.format("04d"),Ag=d3.format("2d");var Dl={a:function(e){return d3_time_weekdays[e.getDay()].substring(0,3)},A:function(e){return d3_time_weekdays[e.getDay()]},b:function(e){return A5[e.getMonth()].substring(0,3)},B:function(e){return A5[e.getMonth()]},c:d3.time.format("%a %b %e %H:%M:%S %Y"),d:function(e){return Ak(e.getDate())},e:function(e){return Ag(e.getDate())},H:function(e){return Ak(e.getHours())},I:function(e){return Ak(e.getHours()%12||12)},j:function(e){return Aj(1+d3.time.dayOfYear(e))},L:function(e){return Aj(e.getMilliseconds())},m:function(e){return Ak(e.getMonth()+1)},M:function(e){return Ak(e.getMinutes())},p:function(e){return e.getHours()>=12?"PM":"AM"},S:function(e){return Ak(e.getSeconds())},U:function(e){return Ak(d3.time.sundayOfYear(e))},w:function(e){return e.getDay()},W:function(e){return Ak(d3.time.mondayOfYear(e))},x:d3.time.format("%m/%d/%y"),X:d3.time.format("%H:%M:%S"),y:function(e){return Ak(e.getFullYear()%100)},Y:function(e){return Ai(e.getFullYear()%10000)},Z:DO,"%":function(e){return"%"}};var Eb={a:D7,A:BG,b:AN,B:Cd,c:CK,d:Av,e:Av,H:AF,I:AF,L:D3,m:Du,M:BQ,p:ES,S:B0,x:El,X:Dr,y:c,Y:Ae};function D7(En,e,Eo){return Cw.test(e.substring(Eo,Eo+=3))?Eo:-1}function BG(En,e,Eo){Aq.lastIndex=0;var Ep=Aq.exec(e.substring(Eo,Eo+10));return Ep?Eo+=Ep[0].length:-1}var Cw=/^(?:sun|mon|tue|wed|thu|fri|sat)/i,Aq=/^(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)/i;d3_time_weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function AN(En,e,Eo){var Ep=Ch.get(e.substring(Eo,Eo+=3).toLowerCase());return Ep==null?-1:(En.m=Ep,Eo)}var Ch=d3.map({jan:0,feb:1,mar:2,apr:3,may:4,jun:5,jul:6,aug:7,sep:8,oct:9,nov:10,dec:11});function Cd(En,e,Eo){EA.lastIndex=0;var Ep=EA.exec(e.substring(Eo,Eo+12));return Ep?(En.m=C8.get(Ep[0].toLowerCase()),Eo+=Ep[0].length):-1}var EA=/^(?:January|February|March|April|May|June|July|August|September|October|November|December)/ig;var C8=d3.map({january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11});var A5=["January","February","March","April","May","June","July","August","September","October","November","December"];function CK(En,e,Eo){return B8(En,Dl.c.toString(),e,Eo)}function El(En,e,Eo){return B8(En,Dl.x.toString(),e,Eo)}function Dr(En,e,Eo){return B8(En,Dl.X.toString(),e,Eo)}function Ae(En,e,Eo){DS.lastIndex=0;var Ep=DS.exec(e.substring(Eo,Eo+4));return Ep?(En.y=+Ep[0],Eo+=Ep[0].length):-1}function c(En,e,Eo){DS.lastIndex=0;var Ep=DS.exec(e.substring(Eo,Eo+2));return Ep?(En.y=Ab()+ +Ep[0],Eo+=Ep[0].length):-1}function Ab(){return ~~(new Date().getFullYear()/1000)*1000}function Du(En,e,Eo){DS.lastIndex=0;var Ep=DS.exec(e.substring(Eo,Eo+2));return Ep?(En.m=Ep[0]-1,Eo+=Ep[0].length):-1}function Av(En,e,Eo){DS.lastIndex=0;var Ep=DS.exec(e.substring(Eo,Eo+2));return Ep?(En.d=+Ep[0],Eo+=Ep[0].length):-1}function AF(En,e,Eo){DS.lastIndex=0;var Ep=DS.exec(e.substring(Eo,Eo+2));return Ep?(En.H=+Ep[0],Eo+=Ep[0].length):-1}function BQ(En,e,Eo){DS.lastIndex=0;var Ep=DS.exec(e.substring(Eo,Eo+2));return Ep?(En.M=+Ep[0],Eo+=Ep[0].length):-1}function B0(En,e,Eo){DS.lastIndex=0;var Ep=DS.exec(e.substring(Eo,Eo+2));return Ep?(En.S=+Ep[0],Eo+=Ep[0].length):-1}function D3(En,e,Eo){DS.lastIndex=0;var Ep=DS.exec(e.substring(Eo,Eo+3));return Ep?(En.L=+Ep[0],Eo+=Ep[0].length):-1}var DS=/\s*\d+/;function ES(En,e,Eo){var Ep=C.get(e.substring(Eo,Eo+=2).toLowerCase());return Ep==null?-1:(En.p=Ep,Eo)}var C=d3.map({am:0,pm:1});function DO(Eq){var Ep=Eq.getTimezoneOffset(),Eo=Ep>0?"-":"+",En=~~(Math.abs(Ep)/60),e=Math.abs(Ep)%60;return Eo+Ak(En)+Ak(e)}d3.time.format.utc=function(En){var e=d3.time.format(En);function Eo(Ep){try{DG=D8;var Eq=new DG();Eq._=Ep;return e(Eq)}finally{DG=Date}}Eo.parse=function(Eq){try{DG=D8;var Ep=e.parse(Eq);return Ep&&Ep._}finally{DG=Date}};Eo.toString=e.toString;return Eo};var Bw=d3.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ");d3.time.format.iso=Date.prototype.toISOString?Bl:Bw;function Bl(e){return e.toISOString()}Bl.parse=function(e){return new Date(e)};Bl.toString=Bw.toString;function BS(Er,e,En){function Eu(Ev){var Ex=Er(Ev),Ew=Ep(Ex,1);return Ev-Ex<Ew-Ev?Ex:Ew}function Et(Ev){e(Ev=Er(new DG(Ev-1)),1);return Ev}function Ep(Ew,Ev){e(Ew=new DG(+Ew),Ev);return Ew}function Eq(Ex,Ew,Ev){var Ey=Et(Ex),Ez=[];if(Ev>1){while(Ey<Ew){if(!(En(Ey)%Ev)){Ez.push(new Date(+Ey))}e(Ey,1)}}else{while(Ey<Ew){Ez.push(new Date(+Ey)),e(Ey,1)}}return Ez}function Eo(Ey,Ex,Ew){try{DG=D8;var Ev=new D8();Ev._=Ey;return Eq(Ev,Ex,Ew)}finally{DG=Date}}Er.floor=Er;Er.round=Eu;Er.ceil=Et;Er.offset=Ep;Er.range=Eq;var Es=Er.utc=By(Er);Es.floor=Es;Es.round=By(Eu);Es.ceil=By(Et);Es.offset=By(Ep);Es.range=Eo;return Er}function By(e){return function(Eo,En){try{DG=D8;var Ep=new D8();Ep._=Eo;return e(Ep,En)._}finally{DG=Date}}}d3.time.second=BS(function(e){return new DG(Math.floor(e/1000)*1000)},function(e,En){e.setTime(e.getTime()+Math.floor(En)*1000)},function(e){return e.getSeconds()});d3.time.seconds=d3.time.second.range;d3.time.seconds.utc=d3.time.second.utc.range;d3.time.minute=BS(function(e){return new DG(Math.floor(e/60000)*60000)},function(e,En){e.setTime(e.getTime()+Math.floor(En)*60000)},function(e){return e.getMinutes()});d3.time.minutes=d3.time.minute.range;d3.time.minutes.utc=d3.time.minute.utc.range;d3.time.hour=BS(function(e){var En=e.getTimezoneOffset()/60;return new DG((Math.floor(e/3600000-En)+En)*3600000)},function(e,En){e.setTime(e.getTime()+Math.floor(En)*3600000)},function(e){return e.getHours()});d3.time.hours=d3.time.hour.range;d3.time.hours.utc=d3.time.hour.utc.range;d3.time.day=BS(function(e){return new DG(e.getFullYear(),e.getMonth(),e.getDate())},function(e,En){e.setDate(e.getDate()+En)},function(e){return e.getDate()-1});d3.time.days=d3.time.day.range;d3.time.days.utc=d3.time.day.utc.range;d3.time.dayOfYear=function(e){var En=d3.time.year(e);return Math.floor((e-En)/86400000-(e.getTimezoneOffset()-En.getTimezoneOffset())/1440)};d3_time_weekdays.forEach(function(En,Eo){En=En.toLowerCase();Eo=7-Eo;var e=d3.time[En]=BS(function(Ep){(Ep=d3.time.day(Ep)).setDate(Ep.getDate()-(Ep.getDay()+Eo)%7);return Ep},function(Ep,Eq){Ep.setDate(Ep.getDate()+Math.floor(Eq)*7)},function(Eq){var Ep=d3.time.year(Eq).getDay();return Math.floor((d3.time.dayOfYear(Eq)+(Ep+Eo)%7)/7)-(Ep!==Eo)});d3.time[En+"s"]=e.range;d3.time[En+"s"].utc=e.utc.range;d3.time[En+"OfYear"]=function(Eq){var Ep=d3.time.year(Eq).getDay();return Math.floor((d3.time.dayOfYear(Eq)+(Ep+Eo)%7)/7)}});d3.time.week=d3.time.sunday;d3.time.weeks=d3.time.sunday.range;d3.time.weeks.utc=d3.time.sunday.utc.range;d3.time.weekOfYear=d3.time.sundayOfYear;d3.time.month=BS(function(e){return new DG(e.getFullYear(),e.getMonth(),1)},function(e,En){e.setMonth(e.getMonth()+En)},function(e){return e.getMonth()});d3.time.months=d3.time.month.range;d3.time.months.utc=d3.time.month.utc.range;d3.time.year=BS(function(e){return new DG(e.getFullYear(),0,1)},function(e,En){e.setFullYear(e.getFullYear()+En)},function(e){return e.getFullYear()});d3.time.years=d3.time.year.range;d3.time.years.utc=d3.time.year.utc.range;function Aa(e,En,Eo){function Ep(Eq){return e(Eq)}Ep.invert=function(Eq){return DQ(e.invert(Eq))};Ep.domain=function(Eq){if(!arguments.length){return e.domain().map(DQ)}e.domain(Eq);return Ep};Ep.nice=function(Eq){var Er=DL(Ep.domain());return Ep.domain([Eq.floor(Er[0]),Eq.ceil(Er[1])])};Ep.ticks=function(Eq,Er){var Eu=DL(Ep.domain());if(typeof Eq!=="function"){var Et=Eu[1]-Eu[0],Ev=Et/Eq,Es=d3.bisect(Cp,Ev);if(Es==Cp.length){return En.year(Eu,Eq)}if(!Es){return e.ticks(Eq).map(DQ)}if(Math.log(Ev/Cp[Es-1])<Math.log(Cp[Es]/Ev)){--Es}Eq=En[Es];Er=Eq[1];Eq=Eq[0].range}return Eq(Eu[0],new Date(+Eu[1]+1),Er)};Ep.tickFormat=function(){return Eo};Ep.copy=function(){return Aa(e.copy(),En,Eo)};return d3.rebind(Ep,e,"range","rangeRound","interpolate","clamp")}function DL(En){var Eo=En[0],e=En[En.length-1];return Eo<e?[Eo,e]:[e,Eo]}function DQ(e){return new Date(e)}function BP(e){return function(En){var Eo=e.length-1,Ep=e[Eo];while(!Ep[1](En)){Ep=e[--Eo]}return Ep[0](En)}}function B3(En){var e=new Date(En,0,1);e.setFullYear(En);return e}function D9(Eo){var Ep=Eo.getFullYear(),En=B3(Ep),e=B3(Ep+1);return Ep+(Eo-En)/(e-En)}var Cp=[1000,5000,15000,30000,60000,300000,900000,1800000,3600000,10800000,21600000,43200000,86400000,172800000,604800000,2592000000,7776000000,31536000000];var BF=[[d3.time.second,1],[d3.time.second,5],[d3.time.second,15],[d3.time.second,30],[d3.time.minute,1],[d3.time.minute,5],[d3.time.minute,15],[d3.time.minute,30],[d3.time.hour,1],[d3.time.hour,3],[d3.time.hour,6],[d3.time.hour,12],[d3.time.day,1],[d3.time.day,2],[d3.time.week,1],[d3.time.month,1],[d3.time.month,3],[d3.time.year,1]];var C9=[[d3.time.format("%Y"),function(e){return true}],[d3.time.format("%B"),function(e){return e.getMonth()}],[d3.time.format("%b %d"),function(e){return e.getDate()!=1}],[d3.time.format("%a %d"),function(e){return e.getDay()&&e.getDate()!=1}],[d3.time.format("%I %p"),function(e){return e.getHours()}],[d3.time.format("%I:%M"),function(e){return e.getMinutes()}],[d3.time.format(":%S"),function(e){return e.getSeconds()}],[d3.time.format(".%L"),function(e){return e.getMilliseconds()}]];var BD=d3.scale.linear(),i=BP(C9);BF.year=function(En,e){return BD.domain(En.map(D9)).ticks(e).map(B3)};d3.time.scale=function(){return Aa(d3.scale.linear(),BF,i)};var Ed=BF.map(function(e){return[e[0].utc,e[1]]});var A1=[[d3.time.format.utc("%Y"),function(e){return true}],[d3.time.format.utc("%B"),function(e){return e.getUTCMonth()}],[d3.time.format.utc("%b %d"),function(e){return e.getUTCDate()!=1}],[d3.time.format.utc("%a %d"),function(e){return e.getUTCDay()&&e.getUTCDate()!=1}],[d3.time.format.utc("%I %p"),function(e){return e.getUTCHours()}],[d3.time.format.utc("%I:%M"),function(e){return e.getUTCMinutes()}],[d3.time.format.utc(":%S"),function(e){return e.getUTCSeconds()}],[d3.time.format.utc(".%L"),function(e){return e.getUTCMilliseconds()}]];var Cg=BP(A1);function BW(En){var e=new Date(Date.UTC(En,0,1));e.setUTCFullYear(En);return e}function Da(Eo){var Ep=Eo.getUTCFullYear(),En=BW(Ep),e=BW(Ep+1);return Ep+(Eo-En)/(e-En)}Ed.year=function(En,e){return BD.domain(En.map(Da)).ticks(e).map(BW)};d3.time.scale.utc=function(){return Aa(d3.scale.linear(),Ed,Cg)}})();
-/*
- * Including Box2DWeb
- * http://www.gphysics.com
- * Copyright 2006, Erin Catto 
- * Released under zlib License.
- * 
- */
+/*! jQuery v2.0.0 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
+//@ sourceMappingURL=jquery.min.map
+*/
+(function(e,undefined){var t,n,r=typeof undefined,i=e.location,o=e.document,s=o.documentElement,a=e.jQuery,u=e.$,l={},c=[],f="2.0.0",p=c.concat,h=c.push,d=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=f.trim,x=function(e,n){return new x.fn.init(e,n,t)},b=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^-ms-/,N=/-([\da-z])/gi,E=function(e,t){return t.toUpperCase()},S=function(){o.removeEventListener("DOMContentLoaded",S,!1),e.removeEventListener("load",S,!1),x.ready()};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,t,n){var r,i;if(!e)return this;if("string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:T.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof x?t[0]:t,x.merge(this,x.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:o,!0)),C.test(r[1])&&x.isPlainObject(t))for(r in t)x.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=o.getElementById(r[2]),i&&i.parentNode&&(this.length=1,this[0]=i),this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?n.ready(e):(e.selector!==undefined&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return d.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,t,n,r,i,o,s=arguments[0]||{},a=1,u=arguments.length,l=!1;for("boolean"==typeof s&&(l=s,s=arguments[1]||{},a=2),"object"==typeof s||x.isFunction(s)||(s={}),u===a&&(s=this,--a);u>a;a++)if(null!=(e=arguments[a]))for(t in e)n=s[t],r=e[t],s!==r&&(l&&r&&(x.isPlainObject(r)||(i=x.isArray(r)))?(i?(i=!1,o=n&&x.isArray(n)?n:[]):o=n&&x.isPlainObject(n)?n:{},s[t]=x.extend(l,o,r)):r!==undefined&&(s[t]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=a),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){(e===!0?--x.readyWait:x.isReady)||(x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(o,[x]),x.fn.trigger&&x(o).trigger("ready").off("ready")))},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if("object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:JSON.parse,parseXML:function(e){var t,n;if(!e||"string"!=typeof e)return null;try{n=new DOMParser,t=n.parseFromString(e,"text/xml")}catch(r){t=undefined}return(!t||t.getElementsByTagName("parsererror").length)&&x.error("Invalid XML: "+e),t},noop:function(){},globalEval:function(e){var t,n=eval;e=x.trim(e),e&&(1===e.indexOf("use strict")?(t=o.createElement("script"),t.text=e,o.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(k,"ms-").replace(N,E)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,s=j(e);if(n){if(s){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(s){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:function(e){return null==e?"":v.call(e)},makeArray:function(e,t){var n=t||[];return null!=e&&(j(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:g.call(t,e,n)},merge:function(e,t){var n=t.length,r=e.length,i=0;if("number"==typeof n)for(;n>i;i++)e[r++]=t[i];else while(t[i]!==undefined)e[r++]=t[i++];return e.length=r,e},grep:function(e,t,n){var r,i=[],o=0,s=e.length;for(n=!!n;s>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,s=j(e),a=[];if(s)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(a[a.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(a[a.length]=r);return p.apply([],a)},guid:1,proxy:function(e,t){var n,r,i;return"string"==typeof t&&(n=e[t],t=e,e=n),x.isFunction(e)?(r=d.call(arguments,2),i=function(){return e.apply(t||this,r.concat(d.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):undefined},access:function(e,t,n,r,i,o,s){var a=0,u=e.length,l=null==n;if("object"===x.type(n)){i=!0;for(a in n)x.access(e,t,a,n[a],!0,o,s)}else if(r!==undefined&&(i=!0,x.isFunction(r)||(s=!0),l&&(s?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(x(e),n)})),t))for(;u>a;a++)t(e[a],n,s?r:r.call(e[a],a,t(e[a],n)));return i?e:l?t.call(e):u?t(e[0],n):o},now:Date.now,swap:function(e,t,n,r){var i,o,s={};for(o in t)s[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=s[o];return i}}),x.ready.promise=function(t){return n||(n=x.Deferred(),"complete"===o.readyState?setTimeout(x.ready):(o.addEventListener("DOMContentLoaded",S,!1),e.addEventListener("load",S,!1))),n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function j(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}t=x(o),function(e,undefined){var t,n,r,i,o,s,a,u,l,c,f,p,h,d,g,m,y="sizzle"+-new Date,v=e.document,b={},w=0,T=0,C=ot(),k=ot(),N=ot(),E=!1,S=function(){return 0},j=typeof undefined,D=1<<31,A=[],L=A.pop,q=A.push,H=A.push,O=A.slice,F=A.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",R="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=M.replace("w","w#"),$="\\["+R+"*("+M+")"+R+"*(?:([*^$|!~]?=)"+R+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+R+"*\\]",B=":("+M+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",I=RegExp("^"+R+"+|((?:^|[^\\\\])(?:\\\\.)*)"+R+"+$","g"),z=RegExp("^"+R+"*,"+R+"*"),_=RegExp("^"+R+"*([>+~]|"+R+")"+R+"*"),X=RegExp(R+"*[+~]"),U=RegExp("="+R+"*([^\\]'\"]*)"+R+"*\\]","g"),Y=RegExp(B),V=RegExp("^"+W+"$"),G={ID:RegExp("^#("+M+")"),CLASS:RegExp("^\\.("+M+")"),TAG:RegExp("^("+M.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+B),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+R+"*(even|odd|(([+-]|)(\\d*)n|)"+R+"*(?:([+-]|)"+R+"*(\\d+)|))"+R+"*\\)|)","i"),"boolean":RegExp("^(?:"+P+")$","i"),needsContext:RegExp("^"+R+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+R+"*((?:-\\d)?\\d*)"+R+"*\\)|)(?=[^-]|$)","i")},J=/^[^{]+\{\s*\[native \w/,Q=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,et=/'|\\/g,tt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,nt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{H.apply(A=O.call(v.childNodes),v.childNodes),A[v.childNodes.length].nodeType}catch(rt){H={apply:A.length?function(e,t){q.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function it(e){return J.test(e+"")}function ot(){var e,t=[];return e=function(n,i){return t.push(n+=" ")>r.cacheLength&&delete e[t.shift()],e[n]=i}}function st(e){return e[y]=!0,e}function at(e){var t=c.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ut(e,t,n,r){var i,o,s,a,u,f,d,g,x,w;if((t?t.ownerDocument||t:v)!==c&&l(t),t=t||c,n=n||[],!e||"string"!=typeof e)return n;if(1!==(a=t.nodeType)&&9!==a)return[];if(p&&!r){if(i=Q.exec(e))if(s=i[1]){if(9===a){if(o=t.getElementById(s),!o||!o.parentNode)return n;if(o.id===s)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(s))&&m(t,o)&&o.id===s)return n.push(o),n}else{if(i[2])return H.apply(n,t.getElementsByTagName(e)),n;if((s=i[3])&&b.getElementsByClassName&&t.getElementsByClassName)return H.apply(n,t.getElementsByClassName(s)),n}if(b.qsa&&(!h||!h.test(e))){if(g=d=y,x=t,w=9===a&&e,1===a&&"object"!==t.nodeName.toLowerCase()){f=gt(e),(d=t.getAttribute("id"))?g=d.replace(et,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=f.length;while(u--)f[u]=g+mt(f[u]);x=X.test(e)&&t.parentNode||t,w=f.join(",")}if(w)try{return H.apply(n,x.querySelectorAll(w)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(I,"$1"),t,n,r)}o=ut.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},l=ut.setDocument=function(e){var t=e?e.ownerDocument||e:v;return t!==c&&9===t.nodeType&&t.documentElement?(c=t,f=t.documentElement,p=!o(t),b.getElementsByTagName=at(function(e){return e.appendChild(t.createComment("")),!e.getElementsByTagName("*").length}),b.attributes=at(function(e){return e.className="i",!e.getAttribute("className")}),b.getElementsByClassName=at(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),b.sortDetached=at(function(e){return 1&e.compareDocumentPosition(c.createElement("div"))}),b.getById=at(function(e){return f.appendChild(e).id=y,!t.getElementsByName||!t.getElementsByName(y).length}),b.getById?(r.find.ID=function(e,t){if(typeof t.getElementById!==j&&p){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},r.filter.ID=function(e){var t=e.replace(tt,nt);return function(e){return e.getAttribute("id")===t}}):(r.find.ID=function(e,t){if(typeof t.getElementById!==j&&p){var n=t.getElementById(e);return n?n.id===e||typeof n.getAttributeNode!==j&&n.getAttributeNode("id").value===e?[n]:undefined:[]}},r.filter.ID=function(e){var t=e.replace(tt,nt);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),r.find.TAG=b.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==j?t.getElementsByTagName(e):undefined}: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},r.find.CLASS=b.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==j&&p?t.getElementsByClassName(e):undefined},d=[],h=[],(b.qsa=it(t.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+R+"*(?:value|"+P+")"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){var t=c.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&h.push("[*^$]="+R+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(b.matchesSelector=it(g=f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){b.disconnectedMatch=g.call(e,"div"),g.call(e,"[s!='']:x"),d.push("!=",B)}),h=h.length&&RegExp(h.join("|")),d=d.length&&RegExp(d.join("|")),m=it(f.contains)||f.compareDocumentPosition?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},S=f.compareDocumentPosition?function(e,n){if(e===n)return E=!0,0;var r=n.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(n);return r?1&r||!b.sortDetached&&n.compareDocumentPosition(e)===r?e===t||m(v,e)?-1:n===t||m(v,n)?1:u?F.call(u,e)-F.call(u,n):0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,n){var r,i=0,o=e.parentNode,s=n.parentNode,a=[e],l=[n];if(e===n)return E=!0,0;if(!o||!s)return e===t?-1:n===t?1:o?-1:s?1:u?F.call(u,e)-F.call(u,n):0;if(o===s)return lt(e,n);r=e;while(r=r.parentNode)a.unshift(r);r=n;while(r=r.parentNode)l.unshift(r);while(a[i]===l[i])i++;return i?lt(a[i],l[i]):a[i]===v?-1:l[i]===v?1:0},c):c},ut.matches=function(e,t){return ut(e,null,null,t)},ut.matchesSelector=function(e,t){if((e.ownerDocument||e)!==c&&l(e),t=t.replace(U,"='$1']"),!(!b.matchesSelector||!p||d&&d.test(t)||h&&h.test(t)))try{var n=g.call(e,t);if(n||b.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return ut(t,c,null,[e]).length>0},ut.contains=function(e,t){return(e.ownerDocument||e)!==c&&l(e),m(e,t)},ut.attr=function(e,t){(e.ownerDocument||e)!==c&&l(e);var n=r.attrHandle[t.toLowerCase()],i=n&&n(e,t,!p);return i===undefined?b.attributes||!p?e.getAttribute(t):(i=e.getAttributeNode(t))&&i.specified?i.value:null:i},ut.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},ut.uniqueSort=function(e){var t,n=[],r=0,i=0;if(E=!b.detectDuplicates,u=!b.sortStable&&e.slice(0),e.sort(S),E){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return e};function lt(e,t){var n=t&&e,r=n&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ct(e,t,n){var r;return n?undefined:(r=e.getAttributeNode(t))&&r.specified?r.value:e[t]===!0?t.toLowerCase():null}function ft(e,t,n){var r;return n?undefined:r=e.getAttribute(t,"type"===t.toLowerCase()?1:2)}function pt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ht(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function dt(e){return st(function(t){return t=+t,st(function(n,r){var i,o=e([],n.length,t),s=o.length;while(s--)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}i=ut.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[r];r++)n+=i(t);return n},r=ut.selectors={cacheLength:50,createPseudo:st,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(tt,nt),e[3]=(e[4]||e[5]||"").replace(tt,nt),"~="===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]||ut.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]&&ut.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return G.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&Y.test(n)&&(t=gt(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(tt,nt).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=C[e+" "];return t||(t=RegExp("(^|"+R+")"+e+"("+R+"|$)"))&&C(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ut.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,h,d,g=o!==s?"nextSibling":"previousSibling",m=t.parentNode,v=a&&t.nodeName.toLowerCase(),x=!u&&!a;if(m){if(o){while(g){f=t;while(f=f[g])if(a?f.nodeName.toLowerCase()===v:1===f.nodeType)return!1;d=g="only"===e&&!d&&"nextSibling"}return!0}if(d=[s?m.firstChild:m.lastChild],s&&x){c=m[y]||(m[y]={}),l=c[e]||[],h=l[0]===w&&l[1],p=l[0]===w&&l[2],f=h&&m.childNodes[h];while(f=++h&&f&&f[g]||(p=h=0)||d.pop())if(1===f.nodeType&&++p&&f===t){c[e]=[w,h,p];break}}else if(x&&(l=(t[y]||(t[y]={}))[e])&&l[0]===w)p=l[1];else while(f=++h&&f&&f[g]||(p=h=0)||d.pop())if((a?f.nodeName.toLowerCase()===v:1===f.nodeType)&&++p&&(x&&((f[y]||(f[y]={}))[e]=[w,p]),f===t))break;return p-=i,p===r||0===p%r&&p/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||ut.error("unsupported pseudo: "+e);return i[y]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?st(function(e,n){var r,o=i(e,t),s=o.length;while(s--)r=F.call(e,o[s]),e[r]=!(n[r]=o[s])}):function(e){return i(e,0,n)}):i}},pseudos:{not:st(function(e){var t=[],n=[],r=s(e.replace(I,"$1"));return r[y]?st(function(e,t,n,i){var o,s=r(e,null,i,[]),a=e.length;while(a--)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:st(function(e){return function(t){return ut(e,t).length>0}}),contains:st(function(e){return function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:st(function(e){return V.test(e||"")||ut.error("unsupported lang: "+e),e=e.replace(tt,nt).toLowerCase(),function(t){var n;do if(n=p?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===c.activeElement&&(!c.hasFocus||c.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!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,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Z.test(e.nodeName)},input:function(e){return K.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"))||t.toLowerCase()===e.type)},first:dt(function(){return[0]}),last:dt(function(e,t){return[t-1]}),eq:dt(function(e,t,n){return[0>n?n+t:n]}),even:dt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:dt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:dt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:dt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=pt(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=ht(t);function gt(e,t){var n,i,o,s,a,u,l,c=k[e+" "];if(c)return t?0:c.slice(0);a=e,u=[],l=r.preFilter;while(a){(!n||(i=z.exec(a)))&&(i&&(a=a.slice(i[0].length)||a),u.push(o=[])),n=!1,(i=_.exec(a))&&(n=i.shift(),o.push({value:n,type:i[0].replace(I," ")}),a=a.slice(n.length));for(s in r.filter)!(i=G[s].exec(a))||l[s]&&!(i=l[s](i))||(n=i.shift(),o.push({value:n,type:s,matches:i}),a=a.slice(n.length));if(!n)break}return t?a.length:a?ut.error(e):k(e,u).slice(0)}function mt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function yt(e,t,r){var i=t.dir,o=r&&"parentNode"===i,s=T++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,r,a){var u,l,c,f=w+" "+s;if(a){while(t=t[i])if((1===t.nodeType||o)&&e(t,r,a))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[y]||(t[y]={}),(l=c[i])&&l[0]===f){if((u=l[1])===!0||u===n)return u===!0}else if(l=c[i]=[f],l[1]=e(t,r,a)||n,l[1]===!0)return!0}}function vt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,s=[],a=0,u=e.length,l=null!=t;for(;u>a;a++)(o=e[a])&&(!n||n(o,r,i))&&(s.push(o),l&&t.push(a));return s}function bt(e,t,n,r,i,o){return r&&!r[y]&&(r=bt(r)),i&&!i[y]&&(i=bt(i,o)),st(function(o,s,a,u){var l,c,f,p=[],h=[],d=s.length,g=o||Ct(t||"*",a.nodeType?[a]:a,[]),m=!e||!o&&t?g:xt(g,p,e,a,u),y=n?i||(o?e:d||r)?[]:s:m;if(n&&n(m,y,a,u),r){l=xt(y,h),r(l,[],a,u),c=l.length;while(c--)(f=l[c])&&(y[h[c]]=!(m[h[c]]=f))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(f=y[c])&&l.push(m[c]=f);i(null,y=[],l,u)}c=y.length;while(c--)(f=y[c])&&(l=i?F.call(o,f):p[c])>-1&&(o[l]=!(s[l]=f))}}else y=xt(y===s?y.splice(d,y.length):y),i?i(null,s,y,u):H.apply(s,y)})}function wt(e){var t,n,i,o=e.length,s=r.relative[e[0].type],u=s||r.relative[" "],l=s?1:0,c=yt(function(e){return e===t},u,!0),f=yt(function(e){return F.call(t,e)>-1},u,!0),p=[function(e,n,r){return!s&&(r||n!==a)||((t=n).nodeType?c(e,n,r):f(e,n,r))}];for(;o>l;l++)if(n=r.relative[e[l].type])p=[yt(vt(p),n)];else{if(n=r.filter[e[l].type].apply(null,e[l].matches),n[y]){for(i=++l;o>i;i++)if(r.relative[e[i].type])break;return bt(l>1&&vt(p),l>1&&mt(e.slice(0,l-1)).replace(I,"$1"),n,i>l&&wt(e.slice(l,i)),o>i&&wt(e=e.slice(i)),o>i&&mt(e))}p.push(n)}return vt(p)}function Tt(e,t){var i=0,o=t.length>0,s=e.length>0,u=function(u,l,f,p,h){var d,g,m,y=[],v=0,x="0",b=u&&[],T=null!=h,C=a,k=u||s&&r.find.TAG("*",h&&l.parentNode||l),N=w+=null==C?1:Math.random()||.1;for(T&&(a=l!==c&&l,n=i);null!=(d=k[x]);x++){if(s&&d){g=0;while(m=e[g++])if(m(d,l,f)){p.push(d);break}T&&(w=N,n=++i)}o&&((d=!m&&d)&&v--,u&&b.push(d))}if(v+=x,o&&x!==v){g=0;while(m=t[g++])m(b,y,l,f);if(u){if(v>0)while(x--)b[x]||y[x]||(y[x]=L.call(p));y=xt(y)}H.apply(p,y),T&&!u&&y.length>0&&v+t.length>1&&ut.uniqueSort(p)}return T&&(w=N,a=C),b};return o?st(u):u}s=ut.compile=function(e,t){var n,r=[],i=[],o=N[e+" "];if(!o){t||(t=gt(e)),n=t.length;while(n--)o=wt(t[n]),o[y]?r.push(o):i.push(o);o=N(e,Tt(i,r))}return o};function Ct(e,t,n){var r=0,i=t.length;for(;i>r;r++)ut(e,t[r],n);return n}function kt(e,t,n,i){var o,a,u,l,c,f=gt(e);if(!i&&1===f.length){if(a=f[0]=f[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&p&&r.relative[a[1].type]){if(t=(r.find.ID(u.matches[0].replace(tt,nt),t)||[])[0],!t)return n;e=e.slice(a.shift().value.length)}o=G.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],r.relative[l=u.type])break;if((c=r.find[l])&&(i=c(u.matches[0].replace(tt,nt),X.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=i.length&&mt(a),!e)return H.apply(n,i),n;break}}}return s(e,f)(i,t,!p,n,X.test(e)),n}r.pseudos.nth=r.pseudos.eq;function Nt(){}Nt.prototype=r.filters=r.pseudos,r.setFilters=new Nt,b.sortStable=y.split("").sort(S).join("")===y,l(),[0,0].sort(S),b.detectDuplicates=E,at(function(e){if(e.innerHTML="<a href='#'></a>","#"!==e.firstChild.getAttribute("href")){var t="type|href|height|width".split("|"),n=t.length;while(n--)r.attrHandle[t[n]]=ft}}),at(function(e){if(null!=e.getAttribute("disabled")){var t=P.split("|"),n=t.length;while(n--)r.attrHandle[t[n]]=ct}}),x.find=ut,x.expr=ut.selectors,x.expr[":"]=x.expr.pseudos,x.unique=ut.uniqueSort,x.text=ut.getText,x.isXMLDoc=ut.isXML,x.contains=ut.contains}(e);var D={};function A(e){var t=D[e]={};return x.each(e.match(w)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?D[e]||A(e):x.extend({},e);var t,n,r,i,o,s,a=[],u=!e.once&&[],l=function(f){for(t=e.memory&&f,n=!0,s=i||0,i=0,o=a.length,r=!0;a&&o>s;s++)if(a[s].apply(f[0],f[1])===!1&&e.stopOnFalse){t=!1;break}r=!1,a&&(u?u.length&&l(u.shift()):t?a=[]:c.disable())},c={add:function(){if(a){var n=a.length;(function s(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&c.has(n)||a.push(n):n&&n.length&&"string"!==r&&s(n)})})(arguments),r?o=a.length:t&&(i=n,l(t))}return this},remove:function(){return a&&x.each(arguments,function(e,t){var n;while((n=x.inArray(t,a,n))>-1)a.splice(n,1),r&&(o>=n&&o--,s>=n&&s--)}),this},has:function(e){return e?x.inArray(e,a)>-1:!(!a||!a.length)},empty:function(){return a=[],o=0,this},disable:function(){return a=u=t=undefined,this},disabled:function(){return!a},lock:function(){return u=undefined,t||c.disable(),this},locked:function(){return!u},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!a||n&&!u||(r?u.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!n}};return c},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var s=o[0],a=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var s=o[2],a=o[3];r[o[1]]=s.add,a&&s.add(function(){n=a},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=s.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=d.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),s=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?d.call(arguments):r,n===a?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},a,u,l;if(r>1)for(a=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(s(t,l,n)).fail(o.reject).progress(s(t,u,a)):--i;return i||o.resolveWith(l,n),o.promise()}}),x.support=function(t){var n=o.createElement("input"),r=o.createDocumentFragment(),i=o.createElement("div"),s=o.createElement("select"),a=s.appendChild(o.createElement("option"));return n.type?(n.type="checkbox",t.checkOn=""!==n.value,t.optSelected=a.selected,t.reliableMarginRight=!0,t.boxSizingReliable=!0,t.pixelPosition=!1,n.checked=!0,t.noCloneChecked=n.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!a.disabled,n=o.createElement("input"),n.value="t",n.type="radio",t.radioValue="t"===n.value,n.setAttribute("checked","t"),n.setAttribute("name","t"),r.appendChild(n),t.checkClone=r.cloneNode(!0).cloneNode(!0).lastChild.checked,t.focusinBubbles="onfocusin"in e,i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===i.style.backgroundClip,x(function(){var n,r,s="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",a=o.getElementsByTagName("body")[0];a&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(n).appendChild(i),i.innerHTML="",i.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",x.swap(a,null!=a.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===i.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(i,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(i,null)||{width:"4px"}).width,r=i.appendChild(o.createElement("div")),r.style.cssText=i.style.cssText=s,r.style.marginRight=r.style.width="0",i.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),a.removeChild(n))}),t):t}({});var L,q,H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,O=/([A-Z])/g;function F(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=x.expando+Math.random()}F.uid=1,F.accepts=function(e){return e.nodeType?1===e.nodeType||9===e.nodeType:!0},F.prototype={key:function(e){if(!F.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=F.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(r){t[this.expando]=n,x.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var r,i=this.key(e),o=this.cache[i];if("string"==typeof t)o[t]=n;else if(x.isEmptyObject(o))this.cache[i]=t;else for(r in t)o[r]=t[r]},get:function(e,t){var n=this.cache[this.key(e)];return t===undefined?n:n[t]},access:function(e,t,n){return t===undefined||t&&"string"==typeof t&&n===undefined?this.get(e,t):(this.set(e,t,n),n!==undefined?n:t)},remove:function(e,t){var n,r,i=this.key(e),o=this.cache[i];if(t===undefined)this.cache[i]={};else{x.isArray(t)?r=t.concat(t.map(x.camelCase)):t in o?r=[t]:(r=x.camelCase(t),r=r in o?[r]:r.match(w)||[]),n=r.length;while(n--)delete o[r[n]]}},hasData:function(e){return!x.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){delete this.cache[this.key(e)]}},L=new F,q=new F,x.extend({acceptData:F.accepts,hasData:function(e){return L.hasData(e)||q.hasData(e)},data:function(e,t,n){return L.access(e,t,n)},removeData:function(e,t){L.remove(e,t)},_data:function(e,t,n){return q.access(e,t,n)},_removeData:function(e,t){q.remove(e,t)}}),x.fn.extend({data:function(e,t){var n,r,i=this[0],o=0,s=null;if(e===undefined){if(this.length&&(s=L.get(i),1===i.nodeType&&!q.get(i,"hasDataAttrs"))){for(n=i.attributes;n.length>o;o++)r=n[o].name,0===r.indexOf("data-")&&(r=x.camelCase(r.substring(5)),P(i,r,s[r]));q.set(i,"hasDataAttrs",!0)}return s}return"object"==typeof e?this.each(function(){L.set(this,e)}):x.access(this,function(t){var n,r=x.camelCase(e);if(i&&t===undefined){if(n=L.get(i,e),n!==undefined)return n;if(n=L.get(i,r),n!==undefined)return n;if(n=P(i,r,undefined),n!==undefined)return n}else this.each(function(){var n=L.get(this,r);L.set(this,r,t),-1!==e.indexOf("-")&&n!==undefined&&L.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){L.remove(this,e)})}});function P(e,t,n){var r;if(n===undefined&&1===e.nodeType)if(r="data-"+t.replace(O,"-$1").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:H.test(n)?JSON.parse(n):n}catch(i){}L.set(e,t,n)}else n=undefined;return n}x.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=q.get(e,t),n&&(!r||x.isArray(n)?r=q.access(e,t,x.makeArray(n)):r.push(n)),r||[]):undefined},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),s=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,s,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return q.get(e,n)||q.access(e,n,{empty:x.Callbacks("once memory").add(function(){q.remove(e,[t+"queue",n])})})}}),x.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),n>arguments.length?x.queue(this[0],e):t===undefined?this:this.each(function(){var n=x.queue(this,e,t);
+x._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=x.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=undefined),e=e||"fx";while(s--)n=q.get(o[s],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(t)}});var R,M,W=/[\t\r\n]/g,$=/\r/g,B=/^(?:input|select|textarea|button)$/i;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[x.propFix[e]||e]})},addClass:function(e){var t,n,r,i,o,s=0,a=this.length,u="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];a>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(W," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,s=0,a=this.length,u=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];a>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(W," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,i="boolean"==typeof t;return x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,s=0,a=x(this),u=t,l=e.match(w)||[];while(o=l[s++])u=i?u:!a.hasClass(o),a[u?"addClass":"removeClass"](o)}else(n===r||"boolean"===n)&&(this.className&&q.set(this,"__className__",this.className),this.className=this.className||e===!1?"":q.get(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(W," ").indexOf(t)>=0)return!0;return!1},val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=x.isFunction(e),this.each(function(n){var i,o=x(this);1===this.nodeType&&(i=r?e.call(this,n,o.val()):e,null==i?i="":"number"==typeof i?i+="":x.isArray(i)&&(i=x.map(i,function(e){return null==e?"":e+""})),t=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&t.set(this,i,"value")!==undefined||(this.value=i))});if(i)return t=x.valHooks[i.type]||x.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&(n=t.get(i,"value"))!==undefined?n:(n=i.value,"string"==typeof n?n.replace($,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,s=o?null:[],a=o?i+1:r.length,u=0>i?a:o?i:0;for(;a>u;u++)if(n=r[u],!(!n.selected&&u!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),s=i.length;while(s--)r=i[s],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,t,n){var i,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===r?x.prop(e,t,n):(1===s&&x.isXMLDoc(e)||(t=t.toLowerCase(),i=x.attrHooks[t]||(x.expr.match.boolean.test(t)?M:R)),n===undefined?i&&"get"in i&&null!==(o=i.get(e,t))?o:(o=x.find.attr(e,t),null==o?undefined:o):null!==n?i&&"set"in i&&(o=i.set(e,n,t))!==undefined?o:(e.setAttribute(t,n+""),n):(x.removeAttr(e,t),undefined))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.boolean.test(n)&&(e[r]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return o=1!==s||!x.isXMLDoc(e),o&&(t=x.propFix[t]||t,i=x.propHooks[t]),n!==undefined?i&&"set"in i&&(r=i.set(e,n,t))!==undefined?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||B.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),M={set:function(e,t,n){return t===!1?x.removeAttr(e,n):e.setAttribute(n,n),n}},x.each(x.expr.match.boolean.source.match(/\w+/g),function(e,t){var n=x.expr.attrHandle[t]||x.find.attr;x.expr.attrHandle[t]=function(e,t,r){var i=x.expr.attrHandle[t],o=r?undefined:(x.expr.attrHandle[t]=undefined)!=n(e,t,r)?t.toLowerCase():null;return x.expr.attrHandle[t]=i,o}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,t){return x.isArray(t)?e.checked=x.inArray(x(e).val(),t)>=0:undefined}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var I=/^key/,z=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,X=/^([^.]*)(?:\.(.+)|)$/;function U(){return!0}function Y(){return!1}function V(){try{return o.activeElement}catch(e){}}x.event={global:{},add:function(e,t,n,i,o){var s,a,u,l,c,f,p,h,d,g,m,y=q.get(e);if(y){n.handler&&(s=n,n=s.handler,o=s.selector),n.guid||(n.guid=x.guid++),(l=y.events)||(l=y.events={}),(a=y.handle)||(a=y.handle=function(e){return typeof x===r||e&&x.event.triggered===e.type?undefined:x.event.dispatch.apply(a.elem,arguments)},a.elem=e),t=(t||"").match(w)||[""],c=t.length;while(c--)u=X.exec(t[c])||[],d=m=u[1],g=(u[2]||"").split(".").sort(),d&&(p=x.event.special[d]||{},d=(o?p.delegateType:p.bindType)||d,p=x.event.special[d]||{},f=x.extend({type:d,origType:m,data:i,handler:n,guid:n.guid,selector:o,needsContext:o&&x.expr.match.needsContext.test(o),namespace:g.join(".")},s),(h=l[d])||(h=l[d]=[],h.delegateCount=0,p.setup&&p.setup.call(e,i,g,a)!==!1||e.addEventListener&&e.addEventListener(d,a,!1)),p.add&&(p.add.call(e,f),f.handler.guid||(f.handler.guid=n.guid)),o?h.splice(h.delegateCount++,0,f):h.push(f),x.event.global[d]=!0);e=null}},remove:function(e,t,n,r,i){var o,s,a,u,l,c,f,p,h,d,g,m=q.hasData(e)&&q.get(e);if(m&&(u=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(a=X.exec(t[l])||[],h=g=a[1],d=(a[2]||"").split(".").sort(),h){f=x.event.special[h]||{},h=(r?f.delegateType:f.bindType)||h,p=u[h]||[],a=a[2]&&RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.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));s&&!p.length&&(f.teardown&&f.teardown.call(e,d,m.handle)!==!1||x.removeEvent(e,h,m.handle),delete u[h])}else for(h in u)x.event.remove(e,h+t[l],n,r,!0);x.isEmptyObject(u)&&(delete m.handle,q.remove(e,"events"))}},trigger:function(t,n,r,i){var s,a,u,l,c,f,p,h=[r||o],d=y.call(t,"type")?t.type:t,g=y.call(t,"namespace")?t.namespace.split("."):[];if(a=u=r=r||o,3!==r.nodeType&&8!==r.nodeType&&!_.test(d+x.event.triggered)&&(d.indexOf(".")>=0&&(g=d.split("."),d=g.shift(),g.sort()),c=0>d.indexOf(":")&&"on"+d,t=t[x.expando]?t:new x.Event(d,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=g.join("."),t.namespace_re=t.namespace?RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=undefined,t.target||(t.target=r),n=null==n?[t]:x.makeArray(n,[t]),p=x.event.special[d]||{},i||!p.trigger||p.trigger.apply(r,n)!==!1)){if(!i&&!p.noBubble&&!x.isWindow(r)){for(l=p.delegateType||d,_.test(l+d)||(a=a.parentNode);a;a=a.parentNode)h.push(a),u=a;u===(r.ownerDocument||o)&&h.push(u.defaultView||u.parentWindow||e)}s=0;while((a=h[s++])&&!t.isPropagationStopped())t.type=s>1?l:p.bindType||d,f=(q.get(a,"events")||{})[t.type]&&q.get(a,"handle"),f&&f.apply(a,n),f=c&&a[c],f&&x.acceptData(a)&&f.apply&&f.apply(a,n)===!1&&t.preventDefault();return t.type=d,i||t.isDefaultPrevented()||p._default&&p._default.apply(h.pop(),n)!==!1||!x.acceptData(r)||c&&x.isFunction(r[d])&&!x.isWindow(r)&&(u=r[c],u&&(r[c]=null),x.event.triggered=d,r[d](),x.event.triggered=undefined,u&&(r[c]=u)),t.result}},dispatch:function(e){e=x.event.fix(e);var t,n,r,i,o,s=[],a=d.call(arguments),u=(q.get(this,"events")||{})[e.type]||[],l=x.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),t=0;while((i=s[t++])&&!e.isPropagationStopped()){e.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(o.namespace))&&(e.handleObj=o,e.data=o.data,r=((x.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a),r!==undefined&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,s=[],a=t.delegateCount,u=e.target;if(a&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!==this;u=u.parentNode||this)if(u.disabled!==!0||"click"!==e.type){for(r=[],n=0;a>n;n++)o=t[n],i=o.selector+" ",r[i]===undefined&&(r[i]=o.needsContext?x(i,this).index(u)>=0:x.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&s.push({elem:u,handlers:r})}return t.length>a&&s.push({elem:this,handlers:t.slice(a)}),s},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,s=t.button;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||o,r=n.documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||s===undefined||(e.which=1&s?1:2&s?3:4&s?2:0),e}},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=z.test(i)?this.mouseHooks:I.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return 3===e.target.nodeType&&(e.target=e.target.parentNode),s.filter?s.filter(e,o):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==V()&&this.focus?(this.focus(),!1):undefined},delegateType:"focusin"},blur:{trigger:function(){return this===V()&&this.blur?(this.blur(),!1):undefined},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&x.nodeName(this,"input")?(this.click(),!1):undefined},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==undefined&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},x.Event=function(e,t){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.getPreventDefault&&e.getPreventDefault()?U:Y):this.type=e,t&&x.extend(this,t),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,undefined):new x.Event(e,t)},x.Event.prototype={isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=U,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=U,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=U,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,t,n,r,i){var o,s;if("object"==typeof e){"string"!=typeof t&&(n=n||t,t=undefined);for(s in e)this.on(s,t,n,e[s],i);return this}if(null==n&&null==r?(r=t,n=t=undefined):null==r&&("string"==typeof t?(r=n,n=undefined):(r=n,n=t,t=undefined)),r===!1)r=Y;else if(!r)return this;return 1===i&&(o=r,r=function(e){return x().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=x.guid++)),this.each(function(){x.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,x(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(t===!1||"function"==typeof t)&&(n=t,t=undefined),n===!1&&(n=Y),this.each(function(){x.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?x.event.trigger(e,t,n,!0):undefined}});var G=/^.[^:#\[\.,]*$/,J=x.expr.match.needsContext,Q={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return t=this,this.pushStack(x(e).filter(function(){for(r=0;i>r;r++)if(x.contains(t[r],this))return!0}));for(n=[],r=0;i>r;r++)x.find(e,this[r],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t=x(e,this),n=t.length;return this.filter(function(){var e=0;for(;n>e;e++)if(x.contains(this,t[e]))return!0})},not:function(e){return this.pushStack(Z(this,e||[],!0))},filter:function(e){return this.pushStack(Z(this,e||[],!1))},is:function(e){return!!e&&("string"==typeof e?J.test(e)?x(e,this.context).index(this[0])>=0:x.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],s=J.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(s?s.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?g.call(x(e),this[0]):g.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function K(e,t){while((e=e[t])&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return K(e,"nextSibling")},prev:function(e){return K(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(Q[e]||x.unique(i),"p"===e[0]&&i.reverse()),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,t,n){var r=[],i=n!==undefined;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&x(e).is(n))break;r.push(e)}return r},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function Z(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(G.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return g.call(t,e)>=0!==n})}var et=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,tt=/<([\w:]+)/,nt=/<|&#?\w+;/,rt=/<(?:script|style|link)/i,it=/^(?:checkbox|radio)$/i,ot=/checked\s*(?:[^=]|=\s*.checked.)/i,st=/^$|\/(?:java|ecma)script/i,at=/^true\/(.*)/,ut=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,lt={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};lt.optgroup=lt.option,lt.tbody=lt.tfoot=lt.colgroup=lt.caption=lt.col=lt.thead,lt.th=lt.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===undefined?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ct(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=ct(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(gt(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&ht(gt(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++)1===e.nodeType&&(x.cleanData(gt(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var t=this[0]||{},n=0,r=this.length;if(e===undefined&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!rt.test(e)&&!lt[(tt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(et,"<$1></$2>");try{for(;r>n;n++)t=this[n]||{},1===t.nodeType&&(x.cleanData(gt(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=p.apply([],e);var r,i,o,s,a,u,l=0,c=this.length,f=this,h=c-1,d=e[0],g=x.isFunction(d);if(g||!(1>=c||"string"!=typeof d||x.support.checkClone)&&ot.test(d))return this.each(function(r){var i=f.eq(r);g&&(e[0]=d.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(r=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),i=r.firstChild,1===r.childNodes.length&&(r=i),i)){for(o=x.map(gt(r,"script"),ft),s=o.length;c>l;l++)a=r,l!==h&&(a=x.clone(a,!0,!0),s&&x.merge(o,gt(a,"script"))),t.call(this[l],a,l);if(s)for(u=o[o.length-1].ownerDocument,x.map(o,pt),l=0;s>l;l++)a=o[l],st.test(a.type||"")&&!q.access(a,"globalEval")&&x.contains(u,a)&&(a.src?x._evalUrl(a.src):x.globalEval(a.textContent.replace(ut,"")))}return this}}),x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=[],i=x(e),o=i.length-1,s=0;for(;o>=s;s++)n=s===o?this:this.clone(!0),x(i[s])[t](n),h.apply(r,n.get());return this.pushStack(r)}}),x.extend({clone:function(e,t,n){var r,i,o,s,a=e.cloneNode(!0),u=x.contains(e.ownerDocument,e);if(!(x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(s=gt(a),o=gt(e),r=0,i=o.length;i>r;r++)mt(o[r],s[r]);if(t)if(n)for(o=o||gt(e),s=s||gt(a),r=0,i=o.length;i>r;r++)dt(o[r],s[r]);else dt(e,a);return s=gt(a,"script"),s.length>0&&ht(s,!u&&gt(e,"script")),a},buildFragment:function(e,t,n,r){var i,o,s,a,u,l,c=0,f=e.length,p=t.createDocumentFragment(),h=[];for(;f>c;c++)if(i=e[c],i||0===i)if("object"===x.type(i))x.merge(h,i.nodeType?[i]:i);else if(nt.test(i)){o=o||p.appendChild(t.createElement("div")),s=(tt.exec(i)||["",""])[1].toLowerCase(),a=lt[s]||lt._default,o.innerHTML=a[1]+i.replace(et,"<$1></$2>")+a[2],l=a[0];while(l--)o=o.firstChild;x.merge(h,o.childNodes),o=p.firstChild,o.textContent=""}else h.push(t.createTextNode(i));p.textContent="",c=0;while(i=h[c++])if((!r||-1===x.inArray(i,r))&&(u=x.contains(i.ownerDocument,i),o=gt(p.appendChild(i),"script"),u&&ht(o),n)){l=0;while(i=o[l++])st.test(i.type||"")&&n.push(i)}return p},cleanData:function(e){var t,n,r,i=e.length,o=0,s=x.event.special;for(;i>o;o++){if(n=e[o],x.acceptData(n)&&(t=q.access(n)))for(r in t.events)s[r]?x.event.remove(n,r):x.removeEvent(n,r,t.handle);L.discard(n),q.discard(n)}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"text",async:!1,global:!1,success:x.globalEval})}});function ct(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ft(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function pt(e){var t=at.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function ht(e,t){var n=e.length,r=0;for(;n>r;r++)q.set(e[r],"globalEval",!t||q.get(t[r],"globalEval"))}function dt(e,t){var n,r,i,o,s,a,u,l;if(1===t.nodeType){if(q.hasData(e)&&(o=q.access(e),s=x.extend({},o),l=o.events,q.set(t,s),l)){delete s.handle,s.events={};for(i in l)for(n=0,r=l[i].length;r>n;n++)x.event.add(t,i,l[i][n])}L.hasData(e)&&(a=L.access(e),u=x.extend({},a),L.set(t,u))}}function gt(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return t===undefined||t&&x.nodeName(e,t)?x.merge([e],n):n}function mt(e,t){var n=t.nodeName.toLowerCase();"input"===n&&it.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}x.fn.extend({wrapAll:function(e){var t;return x.isFunction(e)?this.each(function(t){x(this).wrapAll(e.call(this,t))}):(this[0]&&(t=x(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(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var yt,vt,xt=/^(none|table(?!-c[ea]).+)/,bt=/^margin/,wt=RegExp("^("+b+")(.*)$","i"),Tt=RegExp("^("+b+")(?!px)[a-z%]+$","i"),Ct=RegExp("^([+-])=("+b+")","i"),kt={BODY:"block"},Nt={position:"absolute",visibility:"hidden",display:"block"},Et={letterSpacing:0,fontWeight:400},St=["Top","Right","Bottom","Left"],jt=["Webkit","O","Moz","ms"];function Dt(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=jt.length;while(i--)if(t=jt[i]+n,t in e)return t;return r}function At(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function Lt(t){return e.getComputedStyle(t,null)}function qt(e,t){var n,r,i,o=[],s=0,a=e.length;for(;a>s;s++)r=e[s],r.style&&(o[s]=q.get(r,"olddisplay"),n=r.style.display,t?(o[s]||"none"!==n||(r.style.display=""),""===r.style.display&&At(r)&&(o[s]=q.access(r,"olddisplay",Pt(r.nodeName)))):o[s]||(i=At(r),(n&&"none"!==n||!i)&&q.set(r,"olddisplay",i?n:x.css(r,"display"))));for(s=0;a>s;s++)r=e[s],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[s]||"":"none"));return e}x.fn.extend({css:function(e,t){return x.access(this,function(e,t,n){var r,i,o={},s=0;if(x.isArray(t)){for(r=Lt(e),i=t.length;i>s;s++)o[t[s]]=x.css(e,t[s],!1,r);return o}return n!==undefined?x.style(e,t,n):x.css(e,t)},e,t,arguments.length>1)},show:function(){return qt(this,!0)},hide:function(){return qt(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:At(this))?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=yt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,s,a=x.camelCase(t),u=e.style;return t=x.cssProps[a]||(x.cssProps[a]=Dt(u,a)),s=x.cssHooks[t]||x.cssHooks[a],n===undefined?s&&"get"in s&&(i=s.get(e,!1,r))!==undefined?i:u[t]:(o=typeof n,"string"===o&&(i=Ct.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(x.css(e,t)),o="number"),null==n||"number"===o&&isNaN(n)||("number"!==o||x.cssNumber[a]||(n+="px"),x.support.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),s&&"set"in s&&(n=s.set(e,n,r))===undefined||(u[t]=n)),undefined)}},css:function(e,t,n,r){var i,o,s,a=x.camelCase(t);return t=x.cssProps[a]||(x.cssProps[a]=Dt(e.style,a)),s=x.cssHooks[t]||x.cssHooks[a],s&&"get"in s&&(i=s.get(e,!0,n)),i===undefined&&(i=yt(e,t,r)),"normal"===i&&t in Et&&(i=Et[t]),""===n||n?(o=parseFloat(i),n===!0||x.isNumeric(o)?o||0:i):i}}),yt=function(e,t,n){var r,i,o,s=n||Lt(e),a=s?s.getPropertyValue(t)||s[t]:undefined,u=e.style;return s&&(""!==a||x.contains(e.ownerDocument,e)||(a=x.style(e,t)),Tt.test(a)&&bt.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=s.width,u.width=r,u.minWidth=i,u.maxWidth=o)),a};function Ht(e,t,n){var r=wt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function Ot(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,s=0;for(;4>o;o+=2)"margin"===n&&(s+=x.css(e,n+St[o],!0,i)),r?("content"===n&&(s-=x.css(e,"padding"+St[o],!0,i)),"margin"!==n&&(s-=x.css(e,"border"+St[o]+"Width",!0,i))):(s+=x.css(e,"padding"+St[o],!0,i),"padding"!==n&&(s+=x.css(e,"border"+St[o]+"Width",!0,i)));return s}function Ft(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Lt(e),s=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=yt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Tt.test(i))return i;r=s&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+Ot(e,t,n||(s?"border":"content"),r,o)+"px"}function Pt(e){var t=o,n=kt[e];return n||(n=Rt(e,t),"none"!==n&&n||(vt=(vt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(vt[0].contentWindow||vt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=Rt(e,t),vt.detach()),kt[e]=n),n}function Rt(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,t){x.cssHooks[t]={get:function(e,n,r){return n?0===e.offsetWidth&&xt.test(x.css(e,"display"))?x.swap(e,Nt,function(){return Ft(e,t,r)}):Ft(e,t,r):undefined},set:function(e,n,r){var i=r&&Lt(e);return Ht(e,n,r?Ot(e,t,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,t){return t?x.swap(e,{display:"inline-block"},yt,[e,"marginRight"]):undefined}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,t){x.cssHooks[t]={get:function(e,n){return n?(n=yt(e,t),Tt.test(n)?x(e).position()[t]+"px":n):undefined}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+St[r]+t]=o[r]||o[r-2]||o[0];return i}},bt.test(e)||(x.cssHooks[e+t].set=Ht)});var Mt=/%20/g,Wt=/\[\]$/,$t=/\r?\n/g,Bt=/^(?:submit|button|image|reset|file)$/i,It=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&It.test(this.nodeName)&&!Bt.test(e)&&(this.checked||!it.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace($t,"\r\n")}}):{name:t.name,value:n.replace($t,"\r\n")}}).get()}}),x.param=function(e,t){var n,r=[],i=function(e,t){t=x.isFunction(t)?t():null==t?"":t,r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(t===undefined&&(t=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){i(this.name,this.value)});else for(n in e)zt(n,e[n],t,i);return r.join("&").replace(Mt,"+")};function zt(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||Wt.test(e)?r(e,i):zt(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)zt(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},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)}});var _t,Xt,Ut=x.now(),Yt=/\?/,Vt=/#.*$/,Gt=/([?&])_=[^&]*/,Jt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Qt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Kt=/^(?:GET|HEAD)$/,Zt=/^\/\//,en=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,tn=x.fn.load,nn={},rn={},on="*/".concat("*");try{Xt=i.href}catch(sn){Xt=o.createElement("a"),Xt.href="",Xt=Xt.href}_t=en.exec(Xt.toLowerCase())||[];function an(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];
+if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function un(e,t,n,r){var i={},o=e===rn;function s(a){var u;return i[a]=!0,x.each(e[a]||[],function(e,a){var l=a(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):undefined:(t.dataTypes.unshift(l),s(l),!1)}),u}return s(t.dataTypes[0])||!i["*"]&&s("*")}function ln(e,t){var n,r,i=x.ajaxSettings.flatOptions||{};for(n in t)t[n]!==undefined&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,t,n){if("string"!=typeof e&&tn)return tn.apply(this,arguments);var r,i,o,s=this,a=e.indexOf(" ");return a>=0&&(r=e.slice(a),e=e.slice(0,a)),x.isFunction(t)?(n=t,t=undefined):t&&"object"==typeof t&&(i="POST"),s.length>0&&x.ajax({url:e,type:i,dataType:"html",data:t}).done(function(e){o=arguments,s.html(r?x("<div>").append(x.parseHTML(e)).find(r):e)}).complete(n&&function(e,t){s.each(n,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Xt,type:"GET",isLocal:Qt.test(_t[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":on,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?ln(ln(e,x.ajaxSettings),t):ln(x.ajaxSettings,e)},ajaxPrefilter:an(nn),ajaxTransport:an(rn),ajax:function(e,t){"object"==typeof e&&(t=e,e=undefined),t=t||{};var n,r,i,o,s,a,u,l,c=x.ajaxSetup({},t),f=c.context||c,p=c.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),d=x.Callbacks("once memory"),g=c.statusCode||{},m={},y={},v=0,b="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(2===v){if(!o){o={};while(t=Jt.exec(i))o[t[1].toLowerCase()]=t[2]}t=o[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===v?i:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return v||(e=y[n]=y[n]||e,m[e]=t),this},overrideMimeType:function(e){return v||(c.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>v)for(t in e)g[t]=[g[t],e[t]];else T.always(e[T.status]);return this},abort:function(e){var t=e||b;return n&&n.abort(t),k(0,t),this}};if(h.promise(T).complete=d.add,T.success=T.done,T.error=T.fail,c.url=((e||c.url||Xt)+"").replace(Vt,"").replace(Zt,_t[1]+"//"),c.type=t.method||t.type||c.method||c.type,c.dataTypes=x.trim(c.dataType||"*").toLowerCase().match(w)||[""],null==c.crossDomain&&(a=en.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===_t[1]&&a[2]===_t[2]&&(a[3]||("http:"===a[1]?"80":"443"))===(_t[3]||("http:"===_t[1]?"80":"443")))),c.data&&c.processData&&"string"!=typeof c.data&&(c.data=x.param(c.data,c.traditional)),un(nn,c,t,T),2===v)return T;u=c.global,u&&0===x.active++&&x.event.trigger("ajaxStart"),c.type=c.type.toUpperCase(),c.hasContent=!Kt.test(c.type),r=c.url,c.hasContent||(c.data&&(r=c.url+=(Yt.test(r)?"&":"?")+c.data,delete c.data),c.cache===!1&&(c.url=Gt.test(r)?r.replace(Gt,"$1_="+Ut++):r+(Yt.test(r)?"&":"?")+"_="+Ut++)),c.ifModified&&(x.lastModified[r]&&T.setRequestHeader("If-Modified-Since",x.lastModified[r]),x.etag[r]&&T.setRequestHeader("If-None-Match",x.etag[r])),(c.data&&c.hasContent&&c.contentType!==!1||t.contentType)&&T.setRequestHeader("Content-Type",c.contentType),T.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+("*"!==c.dataTypes[0]?", "+on+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)T.setRequestHeader(l,c.headers[l]);if(c.beforeSend&&(c.beforeSend.call(f,T,c)===!1||2===v))return T.abort();b="abort";for(l in{success:1,error:1,complete:1})T[l](c[l]);if(n=un(rn,c,t,T)){T.readyState=1,u&&p.trigger("ajaxSend",[T,c]),c.async&&c.timeout>0&&(s=setTimeout(function(){T.abort("timeout")},c.timeout));try{v=1,n.send(m,k)}catch(C){if(!(2>v))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,t,o,a){var l,m,y,b,w,C=t;2!==v&&(v=2,s&&clearTimeout(s),n=undefined,i=a||"",T.readyState=e>0?4:0,l=e>=200&&300>e||304===e,o&&(b=cn(c,T,o)),b=fn(c,b,T,l),l?(c.ifModified&&(w=T.getResponseHeader("Last-Modified"),w&&(x.lastModified[r]=w),w=T.getResponseHeader("etag"),w&&(x.etag[r]=w)),204===e?C="nocontent":304===e?C="notmodified":(C=b.state,m=b.data,y=b.error,l=!y)):(y=C,(e||!C)&&(C="error",0>e&&(e=0))),T.status=e,T.statusText=(t||C)+"",l?h.resolveWith(f,[m,C,T]):h.rejectWith(f,[T,C,y]),T.statusCode(g),g=undefined,u&&p.trigger(l?"ajaxSuccess":"ajaxError",[T,c,l?m:y]),d.fireWith(f,[T,C]),u&&(p.trigger("ajaxComplete",[T,c]),--x.active||x.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,t){return x.get(e,undefined,t,"script")}}),x.each(["get","post"],function(e,t){x[t]=function(e,n,r,i){return x.isFunction(n)&&(i=i||r,r=n,n=undefined),x.ajax({url:e,type:t,dataType:i,data:n,success:r})}});function cn(e,t,n){var r,i,o,s,a=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),r===undefined&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in a)if(a[i]&&a[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}s||(s=i)}o=o||s}return o?(o!==u[0]&&u.unshift(o),n[o]):undefined}function fn(e,t,n,r){var i,o,s,a,u,l={},c=e.dataTypes.slice();if(c[1])for(s in e.converters)l[s.toLowerCase()]=e.converters[s];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(s=l[u+" "+o]||l["* "+o],!s)for(i in l)if(a=i.split(" "),a[1]===o&&(s=l[u+" "+a[0]]||l["* "+a[0]])){s===!0?s=l[i]:l[i]!==!0&&(o=a[0],c.unshift(a[1]));break}if(s!==!0)if(s&&e["throws"])t=s(t);else try{t=s(t)}catch(f){return{state:"parsererror",error:s?f:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===undefined&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),x.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=x("<script>").prop({async:!0,charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),o.head.appendChild(t[0])},abort:function(){n&&n()}}}});var pn=[],hn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=pn.pop()||x.expando+"_"+Ut++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,s,a=t.jsonp!==!1&&(hn.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&hn.test(t.data)&&"data");return a||"jsonp"===t.dataTypes[0]?(i=t.jsonpCallback=x.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(hn,"$1"+i):t.jsonp!==!1&&(t.url+=(Yt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return s||x.error(i+" was not called"),s[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){s=arguments},r.always(function(){e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,pn.push(i)),s&&x.isFunction(o)&&o(s[0]),s=o=undefined}),"script"):undefined}),x.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(e){}};var dn=x.ajaxSettings.xhr(),gn={0:200,1223:204},mn=0,yn={};e.ActiveXObject&&x(e).on("unload",function(){for(var e in yn)yn[e]();yn=undefined}),x.support.cors=!!dn&&"withCredentials"in dn,x.support.ajax=dn=!!dn,x.ajaxTransport(function(e){var t;return x.support.cors||dn&&!e.crossDomain?{send:function(n,r){var i,o,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(i in e.xhrFields)s[i]=e.xhrFields[i];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest");for(i in n)s.setRequestHeader(i,n[i]);t=function(e){return function(){t&&(delete yn[o],t=s.onload=s.onerror=null,"abort"===e?s.abort():"error"===e?r(s.status||404,s.statusText):r(gn[s.status]||s.status,s.statusText,"string"==typeof s.responseText?{text:s.responseText}:undefined,s.getAllResponseHeaders()))}},s.onload=t(),s.onerror=t("error"),t=yn[o=mn++]=t("abort"),s.send(e.hasContent&&e.data||null)},abort:function(){t&&t()}}:undefined});var vn,xn,bn=/^(?:toggle|show|hide)$/,wn=RegExp("^(?:([+-])=|)("+b+")([a-z%]*)$","i"),Tn=/queueHooks$/,Cn=[Dn],kn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=wn.exec(t),s=i.cur(),a=+s||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(x.cssNumber[e]?"":"px"),"px"!==r&&a){a=x.css(i.elem,e,!0)||n||1;do u=u||".5",a/=u,x.style(i.elem,e,a+r);while(u!==(u=i.cur()/s)&&1!==u&&--l)}i.unit=r,i.start=a,i.end=o[1]?a+(o[1]+1)*n:n}return i}]};function Nn(){return setTimeout(function(){vn=undefined}),vn=x.now()}function En(e,t){x.each(t,function(t,n){var r=(kn[t]||[]).concat(kn["*"]),i=0,o=r.length;for(;o>i;i++)if(r[i].call(e,t,n))return})}function Sn(e,t,n){var r,i,o=0,s=Cn.length,a=x.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=vn||Nn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,s=0,u=l.tweens.length;for(;u>s;s++)l.tweens[s].run(o);return a.notifyWith(e,[l,o,n]),1>o&&u?n:(a.resolveWith(e,[l]),!1)},l=a.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:vn||Nn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?a.resolveWith(e,[l,t]):a.rejectWith(e,[l,t]),this}}),c=l.props;for(jn(c,l.opts.specialEasing);s>o;o++)if(r=Cn[o].call(l,e,c,l.opts))return r;return En(l,c),x.isFunction(l.opts.start)&&l.opts.start.call(e,l),x.fx.timer(x.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function jn(e,t){var n,r,i,o,s;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),s=x.cssHooks[r],s&&"expand"in s){o=s.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(Sn,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],kn[n]=kn[n]||[],kn[n].unshift(t)},prefilter:function(e,t){t?Cn.unshift(e):Cn.push(e)}});function Dn(e,t,n){var r,i,o,s,a,u,l,c,f,p=this,h=e.style,d={},g=[],m=e.nodeType&&At(e);n.queue||(c=x._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,f=c.empty.fire,c.empty.fire=function(){c.unqueued||f()}),c.unqueued++,p.always(function(){p.always(function(){c.unqueued--,x.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(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]})),a=q.get(e,"fxshow");for(r in t)if(o=t[r],bn.exec(o)){if(delete t[r],u=u||"toggle"===o,o===(m?"hide":"show")){if("show"!==o||a===undefined||a[r]===undefined)continue;m=!0}g.push(r)}if(s=g.length){a=q.get(e,"fxshow")||q.access(e,"fxshow",{}),"hidden"in a&&(m=a.hidden),u&&(a.hidden=!m),m?x(e).show():p.done(function(){x(e).hide()}),p.done(function(){var t;q.remove(e,"fxshow");for(t in d)x.style(e,t,d[t])});for(r=0;s>r;r++)i=g[r],l=p.createTween(i,m?a[i]:0),d[i]=a[i]||x.style(e,i),i in a||(a[i]=l.start,m&&(l.end=l.start,l.start="width"===i||"height"===i?1:0))}}function An(e,t,n,r,i){return new An.prototype.init(e,t,n,r,i)}x.Tween=An,An.prototype={constructor:An,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=An.propHooks[this.prop];return e&&e.get?e.get(this):An.propHooks._default.get(this)},run:function(e){var t,n=An.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):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):An.propHooks._default.set(this),this}},An.prototype.init.prototype=An.prototype,An.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},An.propHooks.scrollTop=An.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(Ln(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(At).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),s=function(){var t=Sn(this,x.extend({},e),o);s.finish=function(){t.stop(!0)},(i||q.get(this,"finish"))&&t.stop(!0)};return s.finish=s,i||o.queue===!1?this.each(s):this.queue(o.queue,s)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=undefined),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=x.timers,s=q.get(this);if(i)s[i]&&s[i].stop&&r(s[i]);else for(i in s)s[i]&&s[i].stop&&Tn.test(i)&&r(s[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));(t||!n)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=q.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,s=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;s>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function Ln(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=St[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:Ln("show"),slideUp:Ln("hide"),slideToggle:Ln("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=An.prototype.init,x.fx.tick=function(){var e,t=x.timers,n=0;for(vn=x.now();t.length>n;n++)e=t[n],e()||t[n]!==e||t.splice(n--,1);t.length||x.fx.stop(),vn=undefined},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){xn||(xn=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(xn),xn=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===undefined?this:this.each(function(t){x.offset.setOffset(this,e,t)});var t,n,i=this[0],o={top:0,left:0},s=i&&i.ownerDocument;if(s)return t=s.documentElement,x.contains(t,i)?(typeof i.getBoundingClientRect!==r&&(o=i.getBoundingClientRect()),n=qn(s),{top:o.top+n.pageYOffset-t.clientTop,left:o.left+n.pageXOffset-t.clientLeft}):o},x.offset={setOffset:function(e,t,n){var r,i,o,s,a,u,l,c=x.css(e,"position"),f=x(e),p={};"static"===c&&(e.style.position="relative"),a=f.offset(),o=x.css(e,"top"),u=x.css(e,"left"),l=("absolute"===c||"fixed"===c)&&(o+u).indexOf("auto")>-1,l?(r=f.position(),s=r.top,i=r.left):(s=parseFloat(o)||0,i=parseFloat(u)||0),x.isFunction(t)&&(t=t.call(e,n,a)),null!=t.top&&(p.top=t.top-a.top+s),null!=t.left&&(p.left=t.left-a.left+i),"using"in t?t.using.call(e,p):f.css(p)}},x.fn.extend({position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===x.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(r=e.offset()),r.top+=x.css(e[0],"borderTopWidth",!0),r.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-r.top-x.css(n,"marginTop",!0),left:t.left-r.left-x.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,n){var r="pageYOffset"===n;x.fn[t]=function(i){return x.access(this,function(t,i,o){var s=qn(t);return o===undefined?s?s[n]:t[i]:(s?s.scrollTo(r?e.pageXOffset:o,r?o:e.pageYOffset):t[i]=o,undefined)},t,i,arguments.length,null)}});function qn(e){return x.isWindow(e)?e:9===e.nodeType&&e.defaultView}x.each({Height:"height",Width:"width"},function(e,t){x.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){x.fn[r]=function(r,i){var o=arguments.length&&(n||"boolean"!=typeof r),s=n||(r===!0||i===!0?"margin":"border");return x.access(this,function(t,n,r){var i;return x.isWindow(t)?t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):r===undefined?x.css(t,n,s):x.style(t,n,r,s)},t,o?r:undefined,o,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&"object"==typeof module.exports?module.exports=x:"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}),"object"==typeof e&&"object"==typeof e.document&&(e.jQuery=e.$=x)})(window);
+}
+
+/*
+ * Including d3.js
+ * http://d3js.org/
+ * Copyright 2012, Michael Bostock
+ * Released under BSD licenses.
+ */ 
+
+(function(){if(!Date.now){Date.now=function(){return +new Date}}try{document.createElement("div").style.setProperty("opacity",0,"")}catch(C7){var Bn=CSSStyleDeclaration.prototype,Dw=Bn.setProperty;Bn.setProperty=function(e,Eo,En){Dw.call(this,e,Eo+"",En)}}d3={version:"2.8.1"};function Eh(Ep,Eo){try{for(var En in Eo){Object.defineProperty(Ep.prototype,En,{value:Eo[En],enumerable:false})}}catch(Eq){Ep.prototype=Eo}}var Bu=Al;function Ef(En){var e=-1,Ep=En.length,Eo=[];while(++e<Ep){Eo.push(En[e])}return Eo}function Al(e){return Array.prototype.slice.call(e)}try{Bu(document.documentElement.childNodes)[0].nodeType}catch(EE){Bu=Ef}var Ca=[].__proto__?function(En,e){En.__proto__=e}:function(Eo,e){for(var En in e){Eo[En]=e[En]}};d3.map=function(e){var Eo=new AC;for(var En in e){Eo.set(En,e[En])}return Eo};function AC(){}Eh(AC,{has:function(e){return Ej+e in this},get:function(e){return this[Ej+e]},set:function(e,En){return this[Ej+e]=En},remove:function(e){e=Ej+e;return e in this&&delete this[e]},keys:function(){var e=[];this.forEach(function(En){e.push(En)});return e},values:function(){var e=[];this.forEach(function(En,Eo){e.push(Eo)});return e},entries:function(){var e=[];this.forEach(function(En,Eo){e.push({key:En,value:Eo})});return e},forEach:function(En){for(var e in this){if(e.charCodeAt(0)===Bp){En.call(this,e.substring(1),this[e])}}}});var Ej="\0",Bp=Ej.charCodeAt(0);function m(){return this}d3.functor=function(e){return typeof e==="function"?e:function(){return e}};d3.rebind=function(Eo,En){var e=1,Eq=arguments.length,Ep;while(++e<Eq){Eo[Ep=arguments[e]]=CL(Eo,En,En[Ep])}return Eo};function CL(En,e,Eo){return function(){var Ep=Eo.apply(e,arguments);return arguments.length?En:Ep}}d3.ascending=function(En,e){return En<e?-1:En>e?1:En>=e?0:NaN};d3.descending=function(En,e){return e<En?-1:e>En?1:e>=En?0:NaN};d3.mean=function(Es,Eq){var Er=Es.length,En,e=0,Ep=-1,Eo=0;if(arguments.length===1){while(++Ep<Er){if(EL(En=Es[Ep])){e+=(En-e)/++Eo}}}else{while(++Ep<Er){if(EL(En=Eq.call(Es,Es[Ep],Ep))){e+=(En-e)/++Eo}}}return Eo?e:undefined};d3.median=function(En,e){if(arguments.length>1){En=En.map(e)}En=En.filter(EL);return En.length?d3.quantile(En.sort(d3.ascending),0.5):undefined};d3.min=function(Er,Ep){var Eo=-1,Eq=Er.length,En,e;if(arguments.length===1){while(++Eo<Eq&&((En=Er[Eo])==null||En!=En)){En=undefined}while(++Eo<Eq){if((e=Er[Eo])!=null&&En>e){En=e}}}else{while(++Eo<Eq&&((En=Ep.call(Er,Er[Eo],Eo))==null||En!=En)){En=undefined}while(++Eo<Eq){if((e=Ep.call(Er,Er[Eo],Eo))!=null&&En>e){En=e}}}return En};d3.max=function(Er,Ep){var Eo=-1,Eq=Er.length,En,e;if(arguments.length===1){while(++Eo<Eq&&((En=Er[Eo])==null||En!=En)){En=undefined}while(++Eo<Eq){if((e=Er[Eo])!=null&&e>En){En=e}}}else{while(++Eo<Eq&&((En=Ep.call(Er,Er[Eo],Eo))==null||En!=En)){En=undefined}while(++Eo<Eq){if((e=Ep.call(Er,Er[Eo],Eo))!=null&&e>En){En=e}}}return En};d3.extent=function(Es,Ep){var Eo=-1,Er=Es.length,En,e,Eq;if(arguments.length===1){while(++Eo<Er&&((En=Eq=Es[Eo])==null||En!=En)){En=Eq=undefined}while(++Eo<Er){if((e=Es[Eo])!=null){if(En>e){En=e}if(Eq<e){Eq=e}}}}else{while(++Eo<Er&&((En=Eq=Ep.call(Es,Es[Eo],Eo))==null||En!=En)){En=undefined}while(++Eo<Er){if((e=Ep.call(Es,Es[Eo],Eo))!=null){if(En>e){En=e}if(Eq<e){Eq=e}}}}return[En,Eq]};d3.random={normal:function(e,En){if(arguments.length<2){En=1}if(arguments.length<1){e=0}return function(){var Eo,Eq,Ep;do{Eo=Math.random()*2-1;Eq=Math.random()*2-1;Ep=Eo*Eo+Eq*Eq}while(!Ep||Ep>1);return e+En*Eo*Math.sqrt(-2*Math.log(Ep)/Ep)}}};function EL(e){return e!=null&&!isNaN(e)}d3.sum=function(Er,Ep){var Eo=0,Eq=Er.length,e,En=-1;if(arguments.length===1){while(++En<Eq){if(!isNaN(e=+Er[En])){Eo+=e}}}else{while(++En<Eq){if(!isNaN(e=+Ep.call(Er,Er[En],En))){Eo+=e}}}return Eo};d3.quantile=function(Eo,Es){var Ep=(Eo.length-1)*Es+1,Eq=Math.floor(Ep),En=Eo[Eq-1],Er=Ep-Eq;return Er?En+Er*(Eo[Eq]-En):En};d3.transpose=function(e){return d3.zip.apply(d3,e)};d3.zip=function(){if(!(Er=arguments.length)){return[]}for(var Ep=-1,e=d3.min(arguments,Cr),Eo=new Array(e);++Ep<e;){for(var En=-1,Er,Eq=Eo[Ep]=new Array(Er);++En<Er;){Eq[En]=arguments[En][Ep]}}return Eo};function Cr(e){return e.length}d3.bisector=function(e){return{left:function(Eo,En,Er,Eq){if(arguments.length<3){Er=0}if(arguments.length<4){Eq=Eo.length}while(Er<Eq){var Ep=Er+Eq>>1;if(e.call(Eo,Eo[Ep],Ep)<En){Er=Ep+1}else{Eq=Ep}}return Er},right:function(Eo,En,Er,Eq){if(arguments.length<3){Er=0}if(arguments.length<4){Eq=Eo.length}while(Er<Eq){var Ep=Er+Eq>>1;if(En<e.call(Eo,Eo[Ep],Ep)){Eq=Ep}else{Er=Ep+1}}return Er}}};var Dg=d3.bisector(function(e){return e});d3.bisectLeft=Dg.left;d3.bisect=d3.bisectRight=Dg.right;d3.first=function(Er,Ep){var Eo=0,Eq=Er.length,En=Er[0],e;if(arguments.length===1){Ep=d3.ascending}while(++Eo<Eq){if(Ep.call(Er,En,e=Er[Eo])>0){En=e}}return En};d3.last=function(Er,Ep){var Eo=0,Eq=Er.length,En=Er[0],e;if(arguments.length===1){Ep=d3.ascending}while(++Eo<Eq){if(Ep.call(Er,En,e=Er[Eo])<=0){En=e}}return En};d3.nest=function(){var Ep={},Eo=[],Es=[],En,Eq;function Er(E0,Ey){if(Ey>=Eo.length){return Eq?Eq.call(Ep,E0):(En?E0.sort(En):E0)}var Ez=-1,Eu=E0.length,E2=Eo[Ey++],Ex,Ew,Ev=new AC,E1,Et={};while(++Ez<Eu){if(E1=Ev.get(Ex=E2(Ew=E0[Ez]))){E1.push(Ew)}else{Ev.set(Ex,[Ew])}}Ev.forEach(function(E3){Et[E3]=Er(Ev.get(E3),Ey)});return Et}function e(Ew,Ex){if(Ex>=Eo.length){return Ew}var Et=[],Eu=Es[Ex++],Ev;for(Ev in Ew){Et.push({key:Ev,values:e(Ew[Ev],Ex)})}if(Eu){Et.sort(function(Ez,Ey){return Eu(Ez.key,Ey.key)})}return Et}Ep.map=function(Et){return Er(Et,0)};Ep.entries=function(Et){return e(Er(Et,0),0)};Ep.key=function(Et){Eo.push(Et);return Ep};Ep.sortKeys=function(Et){Es[Eo.length-1]=Et;return Ep};Ep.sortValues=function(Et){En=Et;return Ep};Ep.rollup=function(Et){Eq=Et;return Ep};return Ep};d3.keys=function(Eo){var En=[];for(var e in Eo){En.push(e)}return En};d3.values=function(Eo){var e=[];for(var En in Eo){e.push(Eo[En])}return e};d3.entries=function(Eo){var e=[];for(var En in Eo){e.push({key:En,value:Eo[En]})}return e};d3.permute=function(Eq,En){var e=[],Eo=-1,Ep=En.length;while(++Eo<Ep){e[Eo]=Eq[En[Eo]]}return e};d3.merge=function(e){return Array.prototype.concat.apply([],e)};d3.split=function(Es,Eq){var Ep=[],e=[],Eo,En=-1,Er=Es.length;if(arguments.length<2){Eq=CY}while(++En<Er){if(Eq.call(e,Eo=Es[En],En)){e=[]}else{if(!e.length){Ep.push(e)}e.push(Eo)}}return Ep};function CY(e){return e==null}function BJ(e){return e.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}d3.range=function(Es,Eq,Er){if(arguments.length<3){Er=1;if(arguments.length<2){Eq=Es;Es=0}}if((Eq-Es)/Er===Infinity){throw new Error("infinite range")}var En=[],e=Dd(Math.abs(Er)),Ep=-1,Eo;Es*=e,Eq*=e,Er*=e;if(Er<0){while((Eo=Es+Er*++Ep)>Eq){En.push(Eo/e)}}else{while((Eo=Es+Er*++Ep)<Eq){En.push(Eo/e)}}return En};function Dd(e){var En=1;while(e*En%1){En*=10}return En}d3.requote=function(e){return e.replace(BY,"\\$&")};var BY=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(e,En){return En?Math.round(e*(En=Math.pow(10,En)))/En:Math.round(e)};d3.xhr=function(e,Eo,Ep){var En=new XMLHttpRequest;if(arguments.length<3){Ep=Eo,Eo=null}else{if(Eo&&En.overrideMimeType){En.overrideMimeType(Eo)}}En.open("GET",e,true);if(Eo){En.setRequestHeader("Accept",Eo)}En.onreadystatechange=function(){if(En.readyState===4){Ep(En.status<300?En:null)}};En.send(null)};d3.text=function(e,Eo,Ep){function En(Eq){Ep(Eq&&Eq.responseText)}if(arguments.length<3){Ep=Eo;Eo=null}d3.xhr(e,Eo,En)};d3.json=function(e,En){d3.text(e,"application/json",function(Eo){En(Eo?JSON.parse(Eo):null)})};d3.html=function(e,En){d3.text(e,"text/html",function(Ep){if(Ep!=null){var Eo=document.createRange();Eo.selectNode(document.body);Ep=Eo.createContextualFragment(Ep)}En(Ep)})};d3.xml=function(e,Eo,Ep){function En(Eq){Ep(Eq&&Eq.responseXML)}if(arguments.length<3){Ep=Eo;Eo=null}d3.xhr(e,Eo,En)};var CB={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};d3.ns={prefix:CB,qualify:function(e){var En=e.indexOf(":"),Eo=e;if(En>=0){Eo=e.substring(0,En);e=e.substring(En+1)}return CB.hasOwnProperty(Eo)?{space:CB[Eo],local:e}:e}};d3.dispatch=function(){var e=new CW,En=-1,Eo=arguments.length;while(++En<Eo){e[arguments[En]]=Cu(e)}return e};function CW(){}CW.prototype.on=function(Eo,Ep){var En=Eo.indexOf("."),e="";if(En>0){e=Eo.substring(En+1);Eo=Eo.substring(0,En)}return arguments.length<2?this[Eo].on(e):this[Eo].on(e,Ep)};function Cu(e){var Eo=[],En=new AC;function Ep(){var Es=Eo,Er=-1,Et=Es.length,Eq;while(++Er<Et){if(Eq=Es[Er].on){Eq.apply(this,arguments)}}return e}Ep.on=function(Er,Et){var Eq=En.get(Er),Es;if(arguments.length<2){return Eq&&Eq.on}if(Eq){Eq.on=null;Eo=Eo.slice(0,Es=Eo.indexOf(Eq)).concat(Eo.slice(Es+1));En.remove(Er)}if(Et){Eo.push(En.set(Er,{on:Et}))}return e};return Ep}d3.format=function(Eu){var Er=BC.exec(Eu),Ew=Er[1]||" ",En=Er[3]||"",Ep=Er[5],e=+Er[6],Ex=Er[7],Es=Er[8],Et=Er[9],Eo=1,Ev="",Eq=false;if(Es){Es=+Es.substring(1)}if(Ep){Ew="0";if(Ex){e-=Math.floor((e-1)/4)}}switch(Et){case"n":Ex=true;Et="g";break;case"%":Eo=100;Ev="%";Et="f";break;case"p":Eo=100;Ev="%";Et="r";break;case"d":Eq=true;Es=0;break;case"s":Eo=-1;Et="r";break}if(Et=="r"&&!Es){Et="g"}Et=R.get(Et)||AY;return function(E1){if(Eq&&(E1%1)){return""}var Ey=(E1<0)&&(E1=-E1)?"\u2212":En;if(Eo<0){var E0=d3.formatPrefix(E1,Es);E1*=E0.scale;Ev=E0.symbol}else{E1*=Eo}E1=Et(E1,Es);if(Ep){var Ez=E1.length+Ey.length;if(Ez<e){E1=new Array(e-Ez+1).join(Ew)+E1}if(Ex){E1=Bb(E1)}E1=Ey+E1}else{if(Ex){E1=Bb(E1)}E1=Ey+E1;var Ez=E1.length;if(Ez<e){E1=new Array(e-Ez+1).join(Ew)+E1}}return E1+Ev}};var BC=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/;var R=d3.map({g:function(e,En){return e.toPrecision(En)},e:function(e,En){return e.toExponential(En)},f:function(e,En){return e.toFixed(En)},r:function(e,En){return d3.round(e,En=CD(e,En)).toFixed(Math.max(0,Math.min(20,En)))}});function CD(e,En){return En-(e?1+Math.floor(Math.log(e+Math.pow(10,1+Math.floor(Math.log(e)/Math.LN10)-En))/Math.LN10):1)}function AY(e){return e+""}function Bb(Ep){var En=Ep.lastIndexOf("."),Eo=En>=0?Ep.substring(En):(En=Ep.length,""),e=[];while(En>0){e.push(Ep.substring(En-=3,En+3))}return e.reverse().join(",")+Eo}var A9=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(Bt);d3.formatPrefix=function(Eo,e){var En=0;if(Eo){if(Eo<0){Eo*=-1}if(e){Eo=d3.round(Eo,CD(Eo,e))}En=1+Math.floor(1e-12+Math.log(Eo)/Math.LN10);En=Math.max(-24,Math.min(24,Math.floor((En<=0?En+1:En-1)/3)*3))}return A9[8+En/3]};function Bt(En,e){return{scale:Math.pow(10,(8-e)*3),symbol:En}}var Au=AH(2),Y=AH(3),EG=function(){return Ba};var l=d3.map({linear:EG,poly:AH,quad:function(){return Au},cubic:function(){return Y},sin:function(){return DX},exp:function(){return C4},circle:function(){return B9},elastic:k,back:D5,bounce:function(){return A3}});var I=d3.map({"in":Ba,out:U,"in-out":AO,"out-in":function(e){return AO(U(e))}});d3.ease=function(En){var Ep=En.indexOf("-"),Eo=Ep>=0?En.substring(0,Ep):En,e=Ep>=0?En.substring(Ep+1):"in";Eo=l.get(Eo)||EG;e=I.get(e)||Ba;return DB(e(Eo.apply(null,Array.prototype.slice.call(arguments,1))))};function DB(e){return function(En){return En<=0?0:En>=1?1:e(En)}}function U(e){return function(En){return 1-e(1-En)}}function AO(e){return function(En){return 0.5*(En<0.5?e(2*En):(2-e(2-2*En)))}}function Ba(e){return e}function AH(En){return function(e){return Math.pow(e,En)}}function DX(e){return 1-Math.cos(e*Math.PI/2)}function C4(e){return Math.pow(2,10*(e-1))}function B9(e){return 1-Math.sqrt(1-e*e)}function k(e,Eo){var En;if(arguments.length<2){Eo=0.45}if(arguments.length<1){e=1;En=Eo/4}else{En=Eo/(2*Math.PI)*Math.asin(1/e)}return function(Ep){return 1+e*Math.pow(2,10*-Ep)*Math.sin((Ep-En)*2*Math.PI/Eo)}}function D5(e){if(!e){e=1.70158}return function(En){return En*En*((e+1)*En-e)}}function A3(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+0.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+0.9375:7.5625*(e-=2.625/2.75)*e+0.984375}d3.event=null;function EW(){d3.event.stopPropagation();d3.event.preventDefault()}function n(){var Eo=d3.event,En;while(En=Eo.sourceEvent){Eo=En}return Eo}function EF(Eo){var e=new CW,En=0,Ep=arguments.length;while(++En<Ep){e[arguments[En]]=Cu(e)}e.of=function(Er,Eq){return function(Es){try{var Et=Es.sourceEvent=d3.event;Es.target=Eo;d3.event=Es;e[Es.type].apply(Er,Eq)}finally{d3.event=Et}}};return e}d3.interpolate=function(En,e){var Eo=d3.interpolators.length,Ep;while(--Eo>=0&&!(Ep=d3.interpolators[Eo](En,e))){}return Ep};d3.interpolateNumber=function(En,e){e-=En;return function(Eo){return En+e*Eo}};d3.interpolateRound=function(En,e){e-=En;return function(Eo){return Math.round(En+e*Eo)}};d3.interpolateString=function(Et,Es){var Ep,Er,Eq,Ev=0,Eu=0,Ew=[],e=[],Eo,En;DK.lastIndex=0;for(Er=0;Ep=DK.exec(Es);++Er){if(Ep.index){Ew.push(Es.substring(Ev,Eu=Ep.index))}e.push({i:Ew.length,x:Ep[0]});Ew.push(null);Ev=DK.lastIndex}if(Ev<Es.length){Ew.push(Es.substring(Ev))}for(Er=0,Eo=e.length;(Ep=DK.exec(Et))&&Er<Eo;++Er){En=e[Er];if(En.x==Ep[0]){if(En.i){if(Ew[En.i+1]==null){Ew[En.i-1]+=En.x;Ew.splice(En.i,1);for(Eq=Er+1;Eq<Eo;++Eq){e[Eq].i--}}else{Ew[En.i-1]+=En.x+Ew[En.i+1];Ew.splice(En.i,2);for(Eq=Er+1;Eq<Eo;++Eq){e[Eq].i-=2}}}else{if(Ew[En.i+1]==null){Ew[En.i]=En.x}else{Ew[En.i]=En.x+Ew[En.i+1];Ew.splice(En.i+1,1);for(Eq=Er+1;Eq<Eo;++Eq){e[Eq].i--}}}e.splice(Er,1);Eo--;Er--}else{En.x=d3.interpolateNumber(parseFloat(Ep[0]),parseFloat(En.x))}}while(Er<Eo){En=e.pop();if(Ew[En.i+1]==null){Ew[En.i]=En.x}else{Ew[En.i]=En.x+Ew[En.i+1];Ew.splice(En.i+1,1)}Eo--}if(Ew.length===1){return Ew[0]==null?e[0].x:function(){return Es}}return function(Ex){for(Er=0;Er<Eo;++Er){Ew[(En=e[Er]).i]=En.x(Ex)}return Ew.join("")}};d3.interpolateTransform=function(Ez,Ey){var E0=[],En=[],Er,Eq=d3.transform(Ez),Ep=d3.transform(Ey),Ev=Eq.translate,Eu=Ep.translate,Eo=Eq.rotate,e=Ep.rotate,Et=Eq.skew,Es=Ep.skew,Ex=Eq.scale,Ew=Ep.scale;if(Ev[0]!=Eu[0]||Ev[1]!=Eu[1]){E0.push("translate(",null,",",null,")");En.push({i:1,x:d3.interpolateNumber(Ev[0],Eu[0])},{i:3,x:d3.interpolateNumber(Ev[1],Eu[1])})}else{if(Eu[0]||Eu[1]){E0.push("translate("+Eu+")")}else{E0.push("")}}if(Eo!=e){En.push({i:E0.push(E0.pop()+"rotate(",null,")")-2,x:d3.interpolateNumber(Eo,e)})}else{if(e){E0.push(E0.pop()+"rotate("+e+")")}}if(Et!=Es){En.push({i:E0.push(E0.pop()+"skewX(",null,")")-2,x:d3.interpolateNumber(Et,Es)})}else{if(Es){E0.push(E0.pop()+"skewX("+Es+")")}}if(Ex[0]!=Ew[0]||Ex[1]!=Ew[1]){Er=E0.push(E0.pop()+"scale(",null,",",null,")");En.push({i:Er-4,x:d3.interpolateNumber(Ex[0],Ew[0])},{i:Er-2,x:d3.interpolateNumber(Ex[1],Ew[1])})}else{if(Ew[0]!=1||Ew[1]!=1){E0.push(E0.pop()+"scale("+Ew+")")}}Er=En.length;return function(E2){var E1=-1,E3;while(++E1<Er){E0[(E3=En[E1]).i]=E3.x(E2)}return E0.join("")}};d3.interpolateRgb=function(En,e){En=d3.rgb(En);e=d3.rgb(e);var Ep=En.r,Eo=En.g,Es=En.b,Er=e.r-Ep,Eq=e.g-Eo,Et=e.b-Es;return function(Eu){return"#"+BA(Math.round(Ep+Er*Eu))+BA(Math.round(Eo+Eq*Eu))+BA(Math.round(Es+Et*Eu))}};d3.interpolateHsl=function(Eo,e){Eo=d3.hsl(Eo);e=d3.hsl(e);var Et=Eo.h,Es=Eo.s,Ep=Eo.l,Er=e.h-Et,Eq=e.s-Es,En=e.l-Ep;return function(Eu){return AU(Et+Er*Eu,Es+Eq*Eu,Ep+En*Eu).toString()}};d3.interpolateArray=function(Eq,Eo){var En=[],Et=[],Ep=Eq.length,e=Eo.length,Es=Math.min(Eq.length,Eo.length),Er;for(Er=0;Er<Es;++Er){En.push(d3.interpolate(Eq[Er],Eo[Er]))}for(;Er<Ep;++Er){Et[Er]=Eq[Er]}for(;Er<e;++Er){Et[Er]=Eo[Er]}return function(Eu){for(Er=0;Er<Es;++Er){Et[Er]=En[Er](Eu)}return Et}};d3.interpolateObject=function(En,e){var Ep={},Eq={},Eo;for(Eo in En){if(Eo in e){Ep[Eo]=C5(Eo)(En[Eo],e[Eo])}else{Eq[Eo]=En[Eo]}}for(Eo in e){if(!(Eo in En)){Eq[Eo]=e[Eo]}}return function(Er){for(Eo in Ep){Eq[Eo]=Ep[Eo](Er)}return Eq}};var DK=/[-+]?(?:\d*\.?\d+)(?:[eE][-+]?\d+)?/g;function C5(e){return e=="transform"?d3.interpolateTransform:d3.interpolate}d3.interpolators=[d3.interpolateObject,function(En,e){return(e instanceof Array)&&d3.interpolateArray(En,e)},function(En,e){return(typeof En==="string"||typeof e==="string")&&d3.interpolateString(En+"",e+"")},function(En,e){return(typeof e==="string"?p.has(e)||/^(#|rgb\(|hsl\()/.test(e):e instanceof Cl||e instanceof C3)&&d3.interpolateRgb(En,e)},function(En,e){return !isNaN(En=+En)&&!isNaN(e=+e)&&d3.interpolateNumber(En,e)}];function EO(En,e){e=e-(En=+En)?1/(e-En):0;return function(Eo){return(Eo-En)*e}}function x(En,e){e=e-(En=+En)?1/(e-En):0;return function(Eo){return Math.max(0,Math.min(1,(Eo-En)*e))}}d3.rgb=function(Eo,En,e){return arguments.length===1?(Eo instanceof Cl?CG(Eo.r,Eo.g,Eo.b):AJ(""+Eo,CG,AU)):CG(~~Eo,~~En,~~e)};function CG(Eo,En,e){return new Cl(Eo,En,e)}function Cl(Eo,En,e){this.r=Eo;this.g=En;this.b=e}Cl.prototype.brighter=function(En){En=Math.pow(0.7,arguments.length?En:1);var Eq=this.r,Ep=this.g,e=this.b,Eo=30;if(!Eq&&!Ep&&!e){return CG(Eo,Eo,Eo)}if(Eq&&Eq<Eo){Eq=Eo}if(Ep&&Ep<Eo){Ep=Eo}if(e&&e<Eo){e=Eo}return CG(Math.min(255,Math.floor(Eq/En)),Math.min(255,Math.floor(Ep/En)),Math.min(255,Math.floor(e/En)))};Cl.prototype.darker=function(e){e=Math.pow(0.7,arguments.length?e:1);return CG(Math.floor(e*this.r),Math.floor(e*this.g),Math.floor(e*this.b))};Cl.prototype.hsl=function(){return Dk(this.r,this.g,this.b)};Cl.prototype.toString=function(){return"#"+BA(this.r)+BA(this.g)+BA(this.b)};function BA(e){return e<16?"0"+Math.max(0,e).toString(16):Math.min(255,e).toString(16)}function AJ(Er,Ep,Es){var e=0,Eo=0,Eq=0,Eu,Et,En;Eu=/([a-z]+)\((.*)\)/i.exec(Er);if(Eu){Et=Eu[2].split(",");switch(Eu[1]){case"hsl":return Es(parseFloat(Et[0]),parseFloat(Et[1])/100,parseFloat(Et[2])/100);case"rgb":return Ep(CZ(Et[0]),CZ(Et[1]),CZ(Et[2]))}}if(En=p.get(Er)){return Ep(En.r,En.g,En.b)}if(Er!=null&&Er.charAt(0)==="#"){if(Er.length===4){e=Er.charAt(1);e+=e;Eo=Er.charAt(2);Eo+=Eo;Eq=Er.charAt(3);Eq+=Eq}else{if(Er.length===7){e=Er.substring(1,3);Eo=Er.substring(3,5);Eq=Er.substring(5,7)}}e=parseInt(e,16);Eo=parseInt(Eo,16);Eq=parseInt(Eq,16)}return Ep(e,Eo,Eq)}function Dk(e,Eq,Es){var Eo=Math.min(e/=255,Eq/=255,Es/=255),Et=Math.max(e,Eq,Es),Er=Et-Eo,Ep,Eu,En=(Et+Eo)/2;if(Er){Eu=En<0.5?Er/(Et+Eo):Er/(2-Et-Eo);if(e==Et){Ep=(Eq-Es)/Er+(Eq<Es?6:0)}else{if(Eq==Et){Ep=(Es-e)/Er+2}else{Ep=(e-Eq)/Er+4}}Ep*=60}else{Eu=Ep=0}return CP(Ep,Eu,En)}function CZ(En){var e=parseFloat(En);return En.charAt(En.length-1)==="%"?Math.round(e*2.55):e}var p=d3.map({aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"});p.forEach(function(e,En){p.set(e,AJ(En,CG,AU))});d3.hsl=function(Eo,En,e){return arguments.length===1?(Eo instanceof C3?CP(Eo.h,Eo.s,Eo.l):AJ(""+Eo,Dk,CP)):CP(+Eo,+En,+e)};function CP(Eo,En,e){return new C3(Eo,En,e)}function C3(Eo,En,e){this.h=Eo;this.s=En;this.l=e}C3.prototype.brighter=function(e){e=Math.pow(0.7,arguments.length?e:1);return CP(this.h,this.s,this.l/e)};C3.prototype.darker=function(e){e=Math.pow(0.7,arguments.length?e:1);return CP(this.h,this.s,e*this.l)};C3.prototype.rgb=function(){return AU(this.h,this.s,this.l)};C3.prototype.toString=function(){return this.rgb().toString()};function AU(Er,Eq,e){var Ep,Eo;Er=Er%360;if(Er<0){Er+=360}Eq=Eq<0?0:Eq>1?1:Eq;e=e<0?0:e>1?1:e;Eo=e<=0.5?e*(1+Eq):e+Eq-e*Eq;Ep=2*e-Eo;function En(Et){if(Et>360){Et-=360}else{if(Et<0){Et+=360}}if(Et<60){return Ep+(Eo-Ep)*Et/60}if(Et<180){return Eo}if(Et<240){return Ep+(Eo-Ep)*(240-Et)/60}return Ep}function Es(Et){return Math.round(En(Et)*255)}return CG(Es(Er+120),Es(Er),Es(Er-120))}function B2(e){Ca(e,B1);return e}var Bf=function(e,En){return En.querySelector(e)},DT=function(e,En){return En.querySelectorAll(e)},CO=document.documentElement,B=CO.matchesSelector||CO.webkitMatchesSelector||CO.mozMatchesSelector||CO.msMatchesSelector||CO.oMatchesSelector,A=function(En,e){return B.call(En,e)};if(typeof Sizzle==="function"){Bf=function(e,En){return Sizzle(e,En)[0]};DT=function(e,En){return Sizzle.uniqueSort(Sizzle(e,En))};A=Sizzle.matchesSelector}var B1=[];d3.selection=function(){return Dz};d3.selection.prototype=B1;B1.select=function(Er){var Eo=[],Ev,e,Eu,Ep;if(typeof Er!=="function"){Er=S(Er)}for(var Es=-1,Eq=this.length;++Es<Eq;){Eo.push(Ev=[]);Ev.parentNode=(Eu=this[Es]).parentNode;for(var Et=-1,En=Eu.length;++Et<En;){if(Ep=Eu[Et]){Ev.push(e=Er.call(Ep,Ep.__data__,Et));if(e&&"__data__" in Ep){e.__data__=Ep.__data__}}else{Ev.push(null)}}}return B2(Eo)};function S(e){return function(){return Bf(e,this)}}B1.selectAll=function(Eq){var En=[],Eu,Eo;if(typeof Eq!=="function"){Eq=BU(Eq)}for(var Er=-1,Ep=this.length;++Er<Ep;){for(var Et=this[Er],Es=-1,e=Et.length;++Es<e;){if(Eo=Et[Es]){En.push(Eu=Bu(Eq.call(Eo,Eo.__data__,Es)));Eu.parentNode=Eo}}}return B2(En)};function BU(e){return function(){return DT(e,this)}}B1.attr=function(En,Et){En=d3.ns.qualify(En);if(arguments.length<2){var Er=this.node();return En.local?Er.getAttributeNS(En.space,En.local):Er.getAttribute(En)}function Eo(){this.removeAttribute(En)}function Eq(){this.removeAttributeNS(En.space,En.local)}function Eu(){this.setAttribute(En,Et)}function Ep(){this.setAttributeNS(En.space,En.local,Et)}function Es(){var Ev=Et.apply(this,arguments);if(Ev==null){this.removeAttribute(En)}else{this.setAttribute(En,Ev)}}function e(){var Ev=Et.apply(this,arguments);if(Ev==null){this.removeAttributeNS(En.space,En.local)}else{this.setAttributeNS(En.space,En.local,Ev)}}return this.each(Et==null?(En.local?Eq:Eo):(typeof Et==="function"?(En.local?e:Es):(En.local?Ep:Eu)))};B1.classed=function(e,Eo){var Ep=e.split(G),Eq=Ep.length,En=-1;if(arguments.length>1){while(++En<Eq){Dq.call(this,Ep[En],Eo)}return this}else{while(++En<Eq){if(!Dq.call(this,Ep[En])){return false}}return true}};var G=/\s+/g;function Dq(e,Eq){var En=new RegExp("(^|\\s+)"+d3.requote(e)+"(\\s+|$)","g");if(arguments.length<2){var Ep=this.node();if(Et=Ep.classList){return Et.contains(e)}var Et=Ep.className;En.lastIndex=0;return En.test(Et.baseVal!=null?Et.baseVal:Et)}function Es(){if(Ew=this.classList){return Ew.add(e)}var Ew=this.className,Eu=Ew.baseVal!=null,Ev=Eu?Ew.baseVal:Ew;En.lastIndex=0;if(!En.test(Ev)){Ev=BJ(Ev+" "+e);if(Eu){Ew.baseVal=Ev}else{this.className=Ev}}}function Er(){if(Ew=this.classList){return Ew.remove(e)}var Ew=this.className,Eu=Ew.baseVal!=null,Ev=Eu?Ew.baseVal:Ew;Ev=BJ(Ev.replace(En," "));if(Eu){Ew.baseVal=Ev}else{this.className=Ev}}function Eo(){(Eq.apply(this,arguments)?Es:Er).call(this)}return this.each(typeof Eq==="function"?Eo:Eq?Es:Er)}B1.style=function(Eo,Er,Ep){if(arguments.length<3){Ep=""}if(arguments.length<2){return window.getComputedStyle(this.node(),null).getPropertyValue(Eo)}function En(){this.style.removeProperty(Eo)}function Eq(){this.style.setProperty(Eo,Er,Ep)}function e(){var Es=Er.apply(this,arguments);if(Es==null){this.style.removeProperty(Eo)}else{this.style.setProperty(Eo,Es,Ep)}}return this.each(Er==null?En:(typeof Er==="function"?e:Eq))};B1.property=function(En,Ep){if(arguments.length<2){return this.node()[En]}function e(){delete this[En]}function Eo(){this[En]=Ep}function Eq(){var Er=Ep.apply(this,arguments);if(Er==null){delete this[En]}else{this[En]=Er}}return this.each(Ep==null?e:(typeof Ep==="function"?Eq:Eo))};B1.text=function(e){return arguments.length<1?this.node().textContent:this.each(typeof e==="function"?function(){var En=e.apply(this,arguments);this.textContent=En==null?"":En}:e==null?function(){this.textContent=""}:function(){this.textContent=e})};B1.html=function(e){return arguments.length<1?this.node().innerHTML:this.each(typeof e==="function"?function(){var En=e.apply(this,arguments);this.innerHTML=En==null?"":En}:e==null?function(){this.innerHTML=""}:function(){this.innerHTML=e})};B1.append=function(En){En=d3.ns.qualify(En);function e(){return this.appendChild(document.createElementNS(this.namespaceURI,En))}function Eo(){return this.appendChild(document.createElementNS(En.space,En.local))}return this.select(En.local?Eo:e)};B1.insert=function(e,Eo){e=d3.ns.qualify(e);function En(){return this.insertBefore(document.createElementNS(this.namespaceURI,e),Bf(Eo,this))}function Ep(){return this.insertBefore(document.createElementNS(e.space,e.local),Bf(Eo,this))}return this.select(e.local?Ep:En)};B1.remove=function(){return this.each(function(){var e=this.parentNode;if(e){e.removeChild(this)}})};B1.data=function(Et,Ev){var Eq=-1,En=this.length,Eu,Eo;if(!arguments.length){Et=new Array(En=(Eu=this[0]).length);while(++Eq<En){if(Eo=Eu[Eq]){Et[Eq]=Eo.__data__}}return Et}function Er(E8,E0){var E3,Ex=E8.length,Ez=E0.length,E6=Math.min(Ex,Ez),E5=Math.max(Ex,Ez),FA=[],E7=[],E4=[],Ey,Ew;if(Ev){var FB=new AC,E9=[],E2,E1=E0.length;for(E3=-1;++E3<Ex;){E2=Ev.call(Ey=E8[E3],Ey.__data__,E3);if(FB.has(E2)){E4[E1++]=Ey}else{FB.set(E2,Ey)}E9.push(E2)}for(E3=-1;++E3<Ez;){E2=Ev.call(E0,Ew=E0[E3],E3);if(FB.has(E2)){FA[E3]=Ey=FB.get(E2);Ey.__data__=Ew;E7[E3]=E4[E3]=null}else{E7[E3]=a(Ew);FA[E3]=E4[E3]=null}FB.remove(E2)}for(E3=-1;++E3<Ex;){if(FB.has(E9[E3])){E4[E3]=E8[E3]}}}else{for(E3=-1;++E3<E6;){Ey=E8[E3];Ew=E0[E3];if(Ey){Ey.__data__=Ew;FA[E3]=Ey;E7[E3]=E4[E3]=null}else{E7[E3]=a(Ew);FA[E3]=E4[E3]=null}}for(;E3<Ez;++E3){E7[E3]=a(E0[E3]);FA[E3]=E4[E3]=null}for(;E3<E5;++E3){E4[E3]=E8[E3];E7[E3]=FA[E3]=null}}E7.update=FA;E7.parentNode=FA.parentNode=E4.parentNode=E8.parentNode;Es.push(E7);Ep.push(FA);e.push(E4)}var Es=Ar([]),Ep=B2([]),e=B2([]);if(typeof Et==="function"){while(++Eq<En){Er(Eu=this[Eq],Et.call(Eu,Eu.parentNode.__data__,Eq))}}else{while(++Eq<En){Er(Eu=this[Eq],Et)}}Ep.enter=function(){return Es};Ep.exit=function(){return e};return Ep};function a(e){return{__data__:e}}B1.datum=B1.map=function(e){return arguments.length<1?this.property("__data__"):this.property("__data__",e)};B1.filter=function(e){var Eo=[],Eu,Et,Ep;if(typeof e!=="function"){e=AQ(e)}for(var Er=0,Eq=this.length;Er<Eq;Er++){Eo.push(Eu=[]);Eu.parentNode=(Et=this[Er]).parentNode;for(var Es=0,En=Et.length;Es<En;Es++){if((Ep=Et[Es])&&e.call(Ep,Ep.__data__,Es)){Eu.push(Ep)}}}return B2(Eo)};function AQ(e){return function(){return A(this,e)}}B1.order=function(){for(var En=-1,e=this.length;++En<e;){for(var Er=this[En],Eo=Er.length-1,Ep=Er[Eo],Eq;--Eo>=0;){if(Eq=Er[Eo]){if(Ep&&Ep!==Eq.nextSibling){Ep.parentNode.insertBefore(Eq,Ep)}Ep=Eq}}}return this};B1.sort=function(En){En=Dv.apply(this,arguments);for(var Eo=-1,e=this.length;++Eo<e;){this[Eo].sort(En)}return this.order()};function Dv(e){if(!arguments.length){e=d3.ascending}return function(Eo,En){return e(Eo&&Eo.__data__,En&&En.__data__)}}B1.on=function(Ep,Eq,e){if(arguments.length<3){e=false}var En="__on"+Ep,Eo=Ep.indexOf(".");if(Eo>0){Ep=Ep.substring(0,Eo)}if(arguments.length<2){return(Eo=this.node()[En])&&Eo._}return this.each(function(Ev,Es){var Et=this,Eu=Et[En];if(Eu){Et.removeEventListener(Ep,Eu,Eu.$);delete Et[En]}if(Eq){Et.addEventListener(Ep,Et[En]=Er,Er.$=e);Er._=Eq}function Er(Ew){var Ex=d3.event;d3.event=Ew;try{Eq.call(Et,Et.__data__,Es)}finally{d3.event=Ex}}})};B1.each=function(Es){for(var En=-1,e=this.length;++En<e;){for(var Eq=this[En],Eo=-1,Er=Eq.length;++Eo<Er;){var Ep=Eq[Eo];if(Ep){Es.call(Ep,Ep.__data__,Eo,En)}}}return this};B1.call=function(e){e.apply(this,(arguments[0]=this,arguments));return this};B1.empty=function(){return !this.node()};B1.node=function(Es){for(var En=0,e=this.length;En<e;En++){for(var Eq=this[En],Eo=0,Er=Eq.length;Eo<Er;Eo++){var Ep=Eq[Eo];if(Ep){return Ep}}}return null};B1.transition=function(){var En=[],Eo,Er;for(var Ep=-1,e=this.length;++Ep<e;){En.push(Eo=[]);for(var Es=this[Ep],Eq=-1,Et=Es.length;++Eq<Et;){Eo.push((Er=Es[Eq])?{node:Er,delay:Cf,duration:D6}:null)}}return Dx(En,ED||++ER,Date.now())};var Dz=B2([[document]]);Dz[0].parentNode=CO;d3.select=function(e){return typeof e==="string"?Dz.select(e):B2([[e]])};d3.selectAll=function(e){return typeof e==="string"?Dz.selectAll(e):B2([Bu(e)])};function Ar(e){Ca(e,Ci);return e}var Ci=[];d3.selection.enter=Ar;d3.selection.enter.prototype=Ci;Ci.append=B1.append;Ci.insert=B1.insert;Ci.empty=B1.empty;Ci.node=B1.node;Ci.select=function(Er){var Eo=[],Ew,e,Eu,Ev,Eq;for(var Es=-1,Ep=this.length;++Es<Ep;){Eu=(Ev=this[Es]).update;Eo.push(Ew=[]);Ew.parentNode=Ev.parentNode;for(var Et=-1,En=Ev.length;++Et<En;){if(Eq=Ev[Et]){Ew.push(Eu[Et]=e=Er.call(Ev.parentNode,Eq.__data__,Et));e.__data__=Eq.__data__}else{Ew.push(null)}}}return B2(Eo)};function Dx(e,Er,Ep){Ca(e,CJ);var Eo=new AC,En=d3.dispatch("start","end"),Eq=AV;e.id=Er;e.time=Ep;e.tween=function(Es,Et){if(arguments.length<2){return Eo.get(Es)}if(Et==null){Eo.remove(Es)}else{Eo.set(Es,Et)}return e};e.ease=function(Es){if(!arguments.length){return Eq}Eq=typeof Es==="function"?Es:d3.ease.apply(d3,arguments);return e};e.each=function(Es,Et){if(arguments.length<2){return Bv.call(e,Es)}En.on(Es,Et);return e};d3.timer(function(Es){e.each(function(E0,Ex,Ew){var E2=[],Eu=this,Ey=e[Ew][Ex].delay,Ev=e[Ew][Ex].duration,E3=Eu.__transition__||(Eu.__transition__={active:0,count:0});++E3.count;Ey<=Es?Et(Es):d3.timer(Et,Ey,Ep);function Et(E4){if(E3.active>Er){return E1()}E3.active=Er;Eo.forEach(function(E5,E6){if(tween=E6.call(Eu,E0,Ex)){E2.push(tween)}});En.start.call(Eu,E0,Ex);if(!Ez(E4)){d3.timer(Ez,0,Ep)}return 1}function Ez(E4){if(E3.active!==Er){return E1()}var E5=(E4-Ey)/Ev,E6=Eq(E5),E7=E2.length;while(E7>0){E2[--E7].call(Eu,E6)}if(E5>=1){E1();ED=Er;En.end.call(Eu,E0,Ex);ED=0;return 1}}function E1(){if(!--E3.count){delete Eu.__transition__}return 1}});return 1},0,Ep);return e}var Q={};function D4(Eo,En,e){return e!=""&&Q}function E(Ep,e){var Eo=C5(Ep);function En(Eu,Et,Er){var Es=e.call(this,Eu,Et);return Es==null?Er!=""&&Q:Er!=Es&&Eo(Er,Es)}function Eq(Et,Es,Er){return Er!=e&&Eo(Er,e)}return typeof e==="function"?En:e==null?D4:(e+="",Eq)}var CJ=[],ER=0,ED=0,D=0,D2=250,Cv=d3.ease("cubic-in-out"),Cf=D,D6=D2,AV=Cv;CJ.call=B1.call;d3.transition=function(e){return arguments.length?(ED?e.transition():e):Dz.transition()};d3.transition.prototype=CJ;CJ.select=function(Er){var Eo=[],Ev,e,Ep;if(typeof Er!=="function"){Er=S(Er)}for(var Es=-1,Eq=this.length;++Es<Eq;){Eo.push(Ev=[]);for(var Eu=this[Es],Et=-1,En=Eu.length;++Et<En;){if((Ep=Eu[Et])&&(e=Er.call(Ep.node,Ep.node.__data__,Et))){if("__data__" in Ep.node){e.__data__=Ep.node.__data__}Ev.push({node:e,delay:Ep.delay,duration:Ep.duration})}else{Ev.push(null)}}}return Dx(Eo,this.id,this.time).ease(this.ease())};CJ.selectAll=function(Es){var Ep=[],Ex,e,Eq;if(typeof Es!=="function"){Es=BU(Es)}for(var Eu=-1,Er=this.length;++Eu<Er;){for(var Ew=this[Eu],Ev=-1,Eo=Ew.length;++Ev<Eo;){if(Eq=Ew[Ev]){e=Es.call(Eq.node,Eq.node.__data__,Ev);Ep.push(Ex=[]);for(var Et=-1,En=e.length;++Et<En;){Ex.push({node:e[Et],delay:Eq.delay,duration:Eq.duration})}}}}return Dx(Ep,this.id,this.time).ease(this.ease())};CJ.attr=function(e,En){return this.attrTween(e,E(e,En))};CJ.attrTween=function(e,Eo){var En=d3.ns.qualify(e);function Ep(Et,Er){var Es=Eo.call(this,Et,Er,this.getAttribute(En));return Es===Q?(this.removeAttribute(En),null):Es&&function(Eu){this.setAttribute(En,Es(Eu))}}function Eq(Et,Er){var Es=Eo.call(this,Et,Er,this.getAttributeNS(En.space,En.local));return Es===Q?(this.removeAttributeNS(En.space,En.local),null):Es&&function(Eu){this.setAttributeNS(En.space,En.local,Es(Eu))}}return this.tween("attr."+e,En.local?Eq:Ep)};CJ.style=function(e,Eo,En){if(arguments.length<3){En=""}return this.styleTween(e,E(e,Eo),En)};CJ.styleTween=function(e,Eo,En){if(arguments.length<3){En=""}return this.tween("style."+e,function(Er,Ep){var Eq=Eo.call(this,Er,Ep,window.getComputedStyle(this,null).getPropertyValue(e));return Eq===Q?(this.style.removeProperty(e),null):Eq&&function(Es){this.style.setProperty(e,Eq(Es),En)}})};CJ.text=function(e){return this.tween("text",function(Eo,En){this.textContent=typeof e==="function"?e.call(this,Eo,En):e})};CJ.remove=function(){return this.each("end.transition",function(){var e;if(!this.__transition__&&(e=this.parentNode)){e.removeChild(this)}})};CJ.delay=function(En){var e=this;return e.each(typeof En==="function"?function(Eq,Ep,Eo){e[Eo][Ep].delay=En.apply(this,arguments)|0}:(En=En|0,function(Eq,Ep,Eo){e[Eo][Ep].delay=En}))};CJ.duration=function(En){var e=this;return e.each(typeof En==="function"?function(Eq,Ep,Eo){e[Eo][Ep].duration=Math.max(1,En.apply(this,arguments)|0)}:(En=Math.max(1,En|0),function(Eq,Ep,Eo){e[Eo][Ep].duration=En}))};function Bv(Ew){var e=ED,Eq=AV,Eu=Cf,Er=D6;ED=this.id;AV=this.ease();for(var Es=0,Ep=this.length;Es<Ep;Es++){for(var Ev=this[Es],Et=0,En=Ev.length;Et<En;Et++){var Eo=Ev[Et];if(Eo){Cf=this[Es][Et].delay;D6=this[Es][Et].duration;Ew.call(Eo=Eo.node,Eo.__data__,Et,Es)}}}ED=e;AV=Eq;Cf=Eu;D6=Er;return this}CJ.transition=function(){return this.select(m)};var Ay=null,A6,Ct;d3.timer=function(Er,e,Eq){var Ep=false,Eo,En=Ay;if(arguments.length<3){if(arguments.length<2){e=0}else{if(!isFinite(e)){return}}Eq=Date.now()}while(En){if(En.callback===Er){En.then=Eq;En.delay=e;Ep=true;break}Eo=En;En=En.next}if(!Ep){Ay={callback:Er,then:Eq,delay:e,next:Ay}}if(!A6){Ct=clearTimeout(Ct);A6=1;EM(EN)}};function EN(){var e,Eo=Date.now(),Ep=Ay;while(Ep){e=Eo-Ep.then;if(e>=Ep.delay){Ep.flush=Ep.callback(e)}Ep=Ep.next}var En=Ck()-Eo;if(En>24){if(isFinite(En)){clearTimeout(Ct);Ct=setTimeout(EN,En)}A6=0}else{A6=1;EM(EN)}}d3.timer.flush=function(){var e,En=Date.now(),Eo=Ay;while(Eo){e=En-Eo.then;if(!Eo.delay){Eo.flush=Eo.callback(e)}Eo=Eo.next}Ck()};function Ck(){var En=null,e=Ay,Eo=Infinity;while(e){if(e.flush){e=En?En.next=e.next:Ay=e.next}else{Eo=Math.min(Eo,e.then+e.delay);e=(En=e).next}}return Eo}var EM=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,17)};d3.transform=function(En){var Eo=document.createElementNS(d3.ns.prefix.svg,"g"),e={a:1,b:0,c:0,d:1,e:0,f:0};return(d3.transform=function(Ep){Eo.setAttribute("transform",Ep);var Eq=Eo.transform.baseVal.consolidate();return new N(Eq?Eq.matrix:e)})(En)};function N(e){var Ep=[e.a,e.b],En=[e.c,e.d],Er=C2(Ep),Eo=Cb(Ep,En),Eq=C2(Ap(En,Ep,-Eo))||0;if(Ep[0]*En[1]<En[0]*Ep[1]){Ep[0]*=-1;Ep[1]*=-1;Er*=-1;Eo*=-1}this.rotate=(Er?Math.atan2(Ep[1],Ep[0]):Math.atan2(-En[0],En[1]))*CQ;this.translate=[e.e,e.f];this.scale=[Er,Eq];this.skew=Eq?Math.atan2(Eo,Eq)*CQ:0}N.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};function Cb(En,e){return En[0]*e[0]+En[1]*e[1]}function C2(e){var En=Math.sqrt(Cb(e,e));if(En){e[0]/=En;e[1]/=En}return En}function Ap(En,e,Eo){En[0]+=Eo*e[0];En[1]+=Eo*e[1];return En}var CQ=180/Math.PI;d3.mouse=function(e){return AK(e,n())};var BH=/WebKit/.test(navigator.userAgent)?-1:0;function AK(Ep,Es){var Eq=Ep.ownerSVGElement||Ep;if(Eq.createSVGPoint){var En=Eq.createSVGPoint();if((BH<0)&&(window.scrollX||window.scrollY)){Eq=d3.select(document.body).append("svg").style("position","absolute").style("top",0).style("left",0);var Eo=Eq[0][0].getScreenCTM();BH=!(Eo.f||Eo.e);Eq.remove()}if(BH){En.x=Es.pageX;En.y=Es.pageY}else{En.x=Es.clientX;En.y=Es.clientY}En=En.matrixTransform(Ep.getScreenCTM().inverse());return[En.x,En.y]}var Er=Ep.getBoundingClientRect();return[Es.clientX-Er.left-Ep.clientLeft,Es.clientY-Er.top-Ep.clientTop]}d3.touches=function(e,En){if(arguments.length<2){En=n().touches}return En?Bu(En).map(function(Ep){var Eo=AK(e,Ep);Eo.identifier=Ep.identifier;return Eo}):[]};function AB(){}d3.scale={};function CH(En){var Eo=En[0],e=En[En.length-1];return Eo<e?[Eo,e]:[e,Eo]}function AL(e){return e.rangeExtent?e.rangeExtent():CH(e.range())}function Dc(Es,Eq){var Er=0,Ep=Es.length-1,Eo=Es[Er],En=Es[Ep],e;if(En<Eo){e=Er;Er=Ep;Ep=e;e=Eo;Eo=En;En=e}if(e=En-Eo){Eq=Eq(e);Es[Er]=Eq.floor(Eo);Es[Ep]=Eq.ceil(En)}return Es}function CU(){return Math}d3.scale.linear=function(){return CE([0,1],[0,1],d3.interpolate,false)};function CE(Er,Ep,Eq,Et){var Eo,En;function e(){var Eu=Math.min(Er.length,Ep.length)>2?b:AA,Ev=Et?x:EO;Eo=Eu(Er,Ep,Ev,Eq);En=Eu(Ep,Er,Ev,d3.interpolate);return Es}function Es(Eu){return Eo(Eu)}Es.invert=function(Eu){return En(Eu)};Es.domain=function(Eu){if(!arguments.length){return Er}Er=Eu.map(Number);return e()};Es.range=function(Eu){if(!arguments.length){return Ep}Ep=Eu;return e()};Es.rangeRound=function(Eu){return Es.range(Eu).interpolate(d3.interpolateRound)};Es.clamp=function(Eu){if(!arguments.length){return Et}Et=Eu;return e()};Es.interpolate=function(Eu){if(!arguments.length){return Eq}Eq=Eu;return e()};Es.ticks=function(Eu){return Ce(Er,Eu)};Es.tickFormat=function(Eu){return Co(Er,Eu)};Es.nice=function(){Dc(Er,AE);return e()};Es.copy=function(){return CE(Er,Ep,Eq,Et)};return e()}function DU(En,e){return d3.rebind(En,e,"range","rangeRound","interpolate","clamp")}function AE(e){e=Math.pow(10,Math.round(Math.log(e)/Math.LN10)-1);return{floor:function(En){return Math.floor(En/e)*e},ceil:function(En){return Math.ceil(En/e)*e}}}function O(Er,e){var Eo=CH(Er),En=Eo[1]-Eo[0],Eq=Math.pow(10,Math.floor(Math.log(En/e)/Math.LN10)),Ep=e/En*Eq;if(Ep<=0.15){Eq*=10}else{if(Ep<=0.35){Eq*=5}else{if(Ep<=0.75){Eq*=2}}}Eo[0]=Math.ceil(Eo[0]/Eq)*Eq;Eo[1]=Math.floor(Eo[1]/Eq)*Eq+Eq*0.5;Eo[2]=Eq;return Eo}function Ce(En,e){return d3.range.apply(d3,O(En,e))}function Co(En,e){return d3.format(",."+Math.max(0,-Math.floor(Math.log(O(En,e)[2])/Math.LN10+0.01))+"f")}function AA(Eq,e,Er,Eo){var En=Er(Eq[0],Eq[1]),Ep=Eo(e[0],e[1]);return function(Es){return Ep(En(Es))}}function b(Es,En,Et,Eq){var Ep=[],Er=[],Eo=0,e=Math.min(Es.length,En.length)-1;if(Es[e]<Es[0]){Es=Es.slice().reverse();En=En.slice().reverse()}while(++Eo<=e){Ep.push(Et(Es[Eo-1],Es[Eo]));Er.push(Eq(En[Eo-1],En[Eo]))}return function(Eu){var Ev=d3.bisect(Es,Eu,1,e)-1;return Er[Ev](Ep[Ev](Eu))}}d3.scale.log=function(){return Dt(d3.scale.linear(),DV)};function Dt(e,En){var Eo=En.pow;function Ep(Eq){return e(En(Eq))}Ep.invert=function(Eq){return Eo(e.invert(Eq))};Ep.domain=function(Eq){if(!arguments.length){return e.domain().map(Eo)}En=Eq[0]<0?DY:DV;Eo=En.pow;e.domain(Eq.map(En));return Ep};Ep.nice=function(){e.domain(Dc(e.domain(),CU));return Ep};Ep.ticks=function(){var Ev=CH(e.domain()),Ew=[];if(Ev.every(isFinite)){var Eu=Math.floor(Ev[0]),Et=Math.ceil(Ev[1]),Es=Eo(Ev[0]),Er=Eo(Ev[1]);if(En===DY){Ew.push(Eo(Eu));for(;Eu++<Et;){for(var Eq=9;Eq>0;Eq--){Ew.push(Eo(Eu)*Eq)}}}else{for(;Eu<Et;Eu++){for(var Eq=1;Eq<10;Eq++){Ew.push(Eo(Eu)*Eq)}}Ew.push(Eo(Eu))}for(Eu=0;Ew[Eu]<Es;Eu++){}for(Et=Ew.length;Ew[Et-1]>Er;Et--){}Ew=Ew.slice(Eu,Et)}return Ew};Ep.tickFormat=function(Eu,Et){if(arguments.length<2){Et=Bg}if(arguments.length<1){return Et}var Eq=Eu/Ep.ticks().length,Er=En===DY?(Es=-1e-12,Math.floor):(Es=1e-12,Math.ceil),Es;return function(Ev){return Ev/Eo(Er(En(Ev)+Es))<Eq?Et(Ev):""}};Ep.copy=function(){return Dt(e.copy(),En)};return DU(Ep,e)}var Bg=d3.format(".0e");function DV(e){return Math.log(e<0?0:e)/Math.LN10}function DY(e){return -Math.log(e>0?0:-e)/Math.LN10}DV.pow=function(e){return Math.pow(10,e)};DY.pow=function(e){return -Math.pow(10,-e)};d3.scale.pow=function(){return Dh(d3.scale.linear(),1)};function Dh(e,Eo){var En=DM(Eo),Ep=DM(1/Eo);function Eq(Er){return e(En(Er))}Eq.invert=function(Er){return Ep(e.invert(Er))};Eq.domain=function(Er){if(!arguments.length){return e.domain().map(Ep)}e.domain(Er.map(En));return Eq};Eq.ticks=function(Er){return Ce(Eq.domain(),Er)};Eq.tickFormat=function(Er){return Co(Eq.domain(),Er)};Eq.nice=function(){return Eq.domain(Dc(Eq.domain(),AE))};Eq.exponent=function(Er){if(!arguments.length){return Eo}var Es=Eq.domain();En=DM(Eo=Er);Ep=DM(1/Eo);return Eq.domain(Es)};Eq.copy=function(){return Dh(e.copy(),Eo)};return DU(Eq,e)}function DM(En){return function(e){return e<0?-Math.pow(-e,En):Math.pow(e,En)}}d3.scale.sqrt=function(){return d3.scale.pow().exponent(0.5)};d3.scale.ordinal=function(){return A7([],{t:"range",x:[]})};function A7(Er,Eo){var Eq,En,Ep;function Es(Et){return En[((Eq.get(Et)||Eq.set(Et,Er.push(Et)))-1)%En.length]}function e(Eu,Et){return d3.range(Er.length).map(function(Ev){return Eu+Et*Ev})}Es.domain=function(Et){if(!arguments.length){return Er}Er=[];Eq=new AC;var Ev=-1,Ew=Et.length,Eu;while(++Ev<Ew){if(!Eq.has(Eu=Et[Ev])){Eq.set(Eu,Er.push(Eu))}}return Es[Eo.t](Eo.x,Eo.p)};Es.range=function(Et){if(!arguments.length){return En}En=Et;Ep=0;Eo={t:"range",x:Et};return Es};Es.rangePoints=function(Et,Ew){if(arguments.length<2){Ew=0}var Ex=Et[0],Eu=Et[1],Ev=(Eu-Ex)/(Er.length-1+Ew);En=e(Er.length<2?(Ex+Eu)/2:Ex+Ev*Ew/2,Ev);Ep=0;Eo={t:"rangePoints",x:Et,p:Ew};return Es};Es.rangeBands=function(Et,Ex){if(arguments.length<2){Ex=0}var Eu=Et[1]<Et[0],Ey=Et[Eu-0],Ev=Et[1-Eu],Ew=(Ev-Ey)/(Er.length+Ex);En=e(Ey+Ew*Ex,Ew);if(Eu){En.reverse()}Ep=Ew*(1-Ex);Eo={t:"rangeBands",x:Et,p:Ex};return Es};Es.rangeRoundBands=function(Et,Ey){if(arguments.length<2){Ey=0}var Ev=Et[1]<Et[0],Ez=Et[Ev-0],Ew=Et[1-Ev],Ex=Math.floor((Ew-Ez)/(Er.length+Ey)),Eu=Ew-Ez-(Er.length-Ey)*Ex;En=e(Ez+Math.round(Eu/2),Ex);if(Ev){En.reverse()}Ep=Math.round(Ex*(1-Ey));Eo={t:"rangeRoundBands",x:Et,p:Ey};return Es};Es.rangeBand=function(){return Ep};Es.rangeExtent=function(){return CH(Eo.x)};Es.copy=function(){return A7(Er,Eo)};return Es.domain(Er)}d3.scale.category10=function(){return d3.scale.ordinal().range(BE)};d3.scale.category20=function(){return d3.scale.ordinal().range(A2)};d3.scale.category20b=function(){return d3.scale.ordinal().range(EC)};d3.scale.category20c=function(){return d3.scale.ordinal().range(EB)};var BE=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"];var A2=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"];var EC=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"];var EB=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return V([],[])};function V(Eo,En){var Ep;function e(){var Er=0,Et=Eo.length,Es=En.length;Ep=[];while(++Er<Es){Ep[Er-1]=d3.quantile(Eo,Er/Es)}return Eq}function Eq(Er){if(isNaN(Er=+Er)){return NaN}return En[d3.bisect(Ep,Er)]}Eq.domain=function(Er){if(!arguments.length){return Eo}Eo=Er.filter(function(Es){return !isNaN(Es)}).sort(d3.ascending);return e()};Eq.range=function(Er){if(!arguments.length){return En}En=Er;return e()};Eq.quantiles=function(){return Ep};Eq.copy=function(){return V(Eo,En)};return e()}d3.scale.quantize=function(){return Bq(0,1,[0,1])};function Bq(Eq,Eo,En){var Er,Ep;function Es(Et){return En[Math.max(0,Math.min(Ep,Math.floor(Er*(Et-Eq))))]}function e(){Er=En.length/(Eo-Eq);Ep=En.length-1;return Es}Es.domain=function(Et){if(!arguments.length){return[Eq,Eo]}Eq=+Et[0];Eo=+Et[Et.length-1];return e()};Es.range=function(Et){if(!arguments.length){return En}En=Et;return e()};Es.copy=function(){return Bq(Eq,Eo,En)};return e()}d3.scale.identity=function(){return CV([0,1])};function CV(En){function e(Eo){return +Eo}e.invert=e;e.domain=e.range=function(Eo){if(!arguments.length){return En}En=Eo.map(e);return e};e.ticks=function(Eo){return Ce(En,Eo)};e.tickFormat=function(Eo){return Co(En,Eo)};e.copy=function(){return CV(En)};return e}d3.svg={};d3.svg.arc=function(){var Eq=Af,Ep=BN,Eo=DZ,e=s;function En(){var Eu=Eq.apply(this,arguments),Et=Ep.apply(this,arguments),Es=Eo.apply(this,arguments)+EU,Er=e.apply(this,arguments)+EU,E0=(Er<Es&&(E0=Es,Es=Er,Er=E0),Er-Es),Ex=E0<Math.PI?"0":"1",Ew=Math.cos(Es),Ez=Math.sin(Es),Ev=Math.cos(Er),Ey=Math.sin(Er);return E0>=EZ?(Eu?"M0,"+Et+"A"+Et+","+Et+" 0 1,1 0,"+(-Et)+"A"+Et+","+Et+" 0 1,1 0,"+Et+"M0,"+Eu+"A"+Eu+","+Eu+" 0 1,0 0,"+(-Eu)+"A"+Eu+","+Eu+" 0 1,0 0,"+Eu+"Z":"M0,"+Et+"A"+Et+","+Et+" 0 1,1 0,"+(-Et)+"A"+Et+","+Et+" 0 1,1 0,"+Et+"Z"):(Eu?"M"+Et*Ew+","+Et*Ez+"A"+Et+","+Et+" 0 "+Ex+",1 "+Et*Ev+","+Et*Ey+"L"+Eu*Ev+","+Eu*Ey+"A"+Eu+","+Eu+" 0 "+Ex+",0 "+Eu*Ew+","+Eu*Ez+"Z":"M"+Et*Ew+","+Et*Ez+"A"+Et+","+Et+" 0 "+Ex+",1 "+Et*Ev+","+Et*Ey+"L0,0Z")}En.innerRadius=function(Er){if(!arguments.length){return Eq}Eq=d3.functor(Er);return En};En.outerRadius=function(Er){if(!arguments.length){return Ep}Ep=d3.functor(Er);return En};En.startAngle=function(Er){if(!arguments.length){return Eo}Eo=d3.functor(Er);return En};En.endAngle=function(Er){if(!arguments.length){return e}e=d3.functor(Er);return En};En.centroid=function(){var Es=(Eq.apply(this,arguments)+Ep.apply(this,arguments))/2,Er=(Eo.apply(this,arguments)+e.apply(this,arguments))/2+EU;return[Math.cos(Er)*Es,Math.sin(Er)*Es]};return En};var EU=-Math.PI/2,EZ=2*Math.PI-0.000001;function Af(e){return e.innerRadius}function BN(e){return e.outerRadius}function DZ(e){return e.startAngle}function s(e){return e.endAngle}function Cn(En){var e=D1,Es=D0,Ep=B6,Er=Az.get(Ep),Eq=0.7;function Eo(Et){return Et.length<1?null:"M"+Er(En(z(this,Et,e,Es)),Eq)}Eo.x=function(Et){if(!arguments.length){return e}e=Et;return Eo};Eo.y=function(Et){if(!arguments.length){return Es}Es=Et;return Eo};Eo.interpolate=function(Et){if(!arguments.length){return Ep}if(!Az.has(Et+="")){Et=B6}Er=Az.get(Ep=Et);return Eo};Eo.tension=function(Et){if(!arguments.length){return Eq}Eq=Et;return Eo};return Eo}d3.svg.line=function(){return Cn(Object)};function z(Ev,Eq,Es,Er){var Eu=[],Ep=-1,e=Eq.length,Eo=typeof Es==="function",En=typeof Er==="function",Et;if(Eo&&En){while(++Ep<e){Eu.push([Es.call(Ev,Et=Eq[Ep],Ep),Er.call(Ev,Et,Ep)])}}else{if(Eo){while(++Ep<e){Eu.push([Es.call(Ev,Eq[Ep],Ep),Er])}}else{if(En){while(++Ep<e){Eu.push([Es,Er.call(Ev,Eq[Ep],Ep)])}}else{while(++Ep<e){Eu.push([Es,Er])}}}}return Eu}function D1(e){return e[0]}function D0(e){return e[1]}var B6="linear";var Az=d3.map({linear:Ec,"step-before":AZ,"step-after":EQ,basis:Cs,"basis-open":AW,"basis-closed":BL,bundle:BM,cardinal:Bz,"cardinal-open":Aw,"cardinal-closed":P,monotone:Bd});function Ec(En){var e=0,Eq=En.length,Ep=En[0],Eo=[Ep[0],",",Ep[1]];while(++e<Eq){Eo.push("L",(Ep=En[e])[0],",",Ep[1])}return Eo.join("")}function AZ(En){var e=0,Eq=En.length,Ep=En[0],Eo=[Ep[0],",",Ep[1]];while(++e<Eq){Eo.push("V",(Ep=En[e])[1],"H",Ep[0])}return Eo.join("")}function EQ(En){var e=0,Eq=En.length,Ep=En[0],Eo=[Ep[0],",",Ep[1]];while(++e<Eq){Eo.push("H",(Ep=En[e])[0],"V",Ep[1])}return Eo.join("")}function Aw(En,e){return En.length<4?Ec(En):En[1]+BR(En.slice(1,En.length-1),As(En,e))}function P(En,e){return En.length<3?Ec(En):En[0]+BR((En.push(En[0]),En),As([En[En.length-2]].concat(En,[En[1]]),e))}function Bz(Eo,En,e){return Eo.length<3?Ec(Eo):Eo[0]+BR(Eo,As(Eo,En))}function BR(Es,Er){if(Er.length<1||(Es.length!=Er.length&&Es.length!=Er.length+2)){return Ec(Es)}var Et=Es.length!=Er.length,Ew="",Eu=Es[0],e=Es[1],Eq=Er[0],Ev=Eq,Eo=1;if(Et){Ew+="Q"+(e[0]-Eq[0]*2/3)+","+(e[1]-Eq[1]*2/3)+","+e[0]+","+e[1];Eu=Es[1];Eo=2}if(Er.length>1){Ev=Er[1];e=Es[Eo];Eo++;Ew+="C"+(Eu[0]+Eq[0])+","+(Eu[1]+Eq[1])+","+(e[0]-Ev[0])+","+(e[1]-Ev[1])+","+e[0]+","+e[1];for(var En=2;En<Er.length;En++,Eo++){e=Es[Eo];Ev=Er[En];Ew+="S"+(e[0]-Ev[0])+","+(e[1]-Ev[1])+","+e[0]+","+e[1]}}if(Et){var Ep=Es[Eo];Ew+="Q"+(e[0]+Ev[0]*2/3)+","+(e[1]+Ev[1]*2/3)+","+Ep[0]+","+Ep[1]}return Ew}function As(Es,Eq){var Eo=[],Ep=(1-Eq)/2,Eu,Et=Es[0],Er=Es[1],En=1,e=Es.length;while(++En<e){Eu=Et;Et=Er;Er=Es[En];Eo.push([Ep*(Er[0]-Eu[0]),Ep*(Er[1]-Eu[1])])}return Eo}function Cs(Et){if(Et.length<3){return Ec(Et)}var Eo=1,En=Et.length,Ep=Et[0],e=Ep[0],Er=Ep[1],Es=[e,e,e,(Ep=Et[1])[0]],Eq=[Er,Er,Er,Ep[1]],Eu=[e,",",Er];Am(Eu,Es,Eq);while(++Eo<En){Ep=Et[Eo];Es.shift();Es.push(Ep[0]);Eq.shift();Eq.push(Ep[1]);Am(Eu,Es,Eq)}Eo=-1;while(++Eo<2){Es.shift();Es.push(Ep[0]);Eq.shift();Eq.push(Ep[1]);Am(Eu,Es,Eq)}return Eu.join("")}function AW(Ep){if(Ep.length<4){return Ec(Ep)}var Er=[],Eo=-1,Es=Ep.length,Eq,En=[0],e=[0];while(++Eo<3){Eq=Ep[Eo];En.push(Eq[0]);e.push(Eq[1])}Er.push(Df(EH,En)+","+Df(EH,e));--Eo;while(++Eo<Es){Eq=Ep[Eo];En.shift();En.push(Eq[0]);e.shift();e.push(Eq[1]);Am(Er,En,e)}return Er.join("")}function BL(Eq){var Es,Ep=-1,Et=Eq.length,e=Et+4,Er,Eo=[],En=[];while(++Ep<4){Er=Eq[Ep%Et];Eo.push(Er[0]);En.push(Er[1])}Es=[Df(EH,Eo),",",Df(EH,En)];--Ep;while(++Ep<e){Er=Eq[Ep%Et];Eo.shift();Eo.push(Er[0]);En.shift();En.push(Er[1]);Am(Es,Eo,En)}return Es.join("")}function BM(Es,Er){var Eo=Es.length-1,En=Es[0][0],Eq=Es[0][1],Ev=Es[Eo][0]-En,Eu=Es[Eo][1]-Eq,Ep=-1,e,Et;while(++Ep<=Eo){e=Es[Ep];Et=Ep/Eo;e[0]=Er*e[0]+(1-Er)*(En+Et*Ev);e[1]=Er*e[1]+(1-Er)*(Eq+Et*Eu)}return Cs(Es)}function Df(En,e){return En[0]*e[0]+En[1]*e[1]+En[2]*e[2]+En[3]*e[3]}var EK=[0,2/3,1/3,0],EI=[0,1/3,2/3,0],EH=[0,1/6,2/3,1/6];function Am(En,e,Eo){En.push("C",Df(EK,e),",",Df(EK,Eo),",",Df(EI,e),",",Df(EI,Eo),",",Df(EH,e),",",Df(EH,Eo))}function Ei(En,e){return(e[1]-En[1])/(e[0]-En[0])}function CA(Ep){var Eo=0,En=Ep.length-1,e=[],Es=Ep[0],Er=Ep[1],Eq=e[0]=Ei(Es,Er);while(++Eo<En){e[Eo]=Eq+(Eq=Ei(Es=Er,Er=Ep[Eo+1]))}e[Eo]=Eq;return e}function u(Et){var Eq=[],Ep,Es,Er,Eu,e=CA(Et),Eo=-1,En=Et.length-1;while(++Eo<En){Ep=Ei(Et[Eo],Et[Eo+1]);if(Math.abs(Ep)<0.000001){e[Eo]=e[Eo+1]=0}else{Es=e[Eo]/Ep;Er=e[Eo+1]/Ep;Eu=Es*Es+Er*Er;if(Eu>9){Eu=Ep*3/Math.sqrt(Eu);e[Eo]=Eu*Es;e[Eo+1]=Eu*Er}}}Eo=-1;while(++Eo<=En){Eu=(Et[Math.min(En,Eo+1)][0]-Et[Math.max(0,Eo-1)][0])/(6*(1+e[Eo]*e[Eo]));Eq.push([Eu||0,e[Eo]*Eu||0])}return Eq}function Bd(e){return e.length<3?Ec(e):e[0]+BR(e,u(e))}d3.svg.line.radial=function(){var e=Cn(f);e.radius=e.x,delete e.x;e.angle=e.y,delete e.y;return e};function f(Ep){var e,Eo=-1,Er=Ep.length,Eq,En;while(++Eo<Er){e=Ep[Eo];Eq=e[0];En=e[1]+EU;e[0]=Eq*Math.cos(En);e[1]=Eq*Math.sin(En)}return Ep}function Ek(Er){var Eo=D1,En=D1,Ev=0,Et=D0,Es,Eq,Ep,Eu=0.7;function e(Ey){if(Ey.length<1){return null}var Ex=z(this,Ey,Eo,Ev),Ew=z(this,Ey,Eo===En?Bi(Ex):En,Ev===Et?Bh(Ex):Et);return"M"+Eq(Er(Ew),Eu)+"L"+Ep(Er(Ex.reverse()),Eu)+"Z"}e.x=function(Ew){if(!arguments.length){return En}Eo=En=Ew;return e};e.x0=function(Ew){if(!arguments.length){return Eo}Eo=Ew;return e};e.x1=function(Ew){if(!arguments.length){return En}En=Ew;return e};e.y=function(Ew){if(!arguments.length){return Et}Ev=Et=Ew;return e};e.y0=function(Ew){if(!arguments.length){return Ev}Ev=Ew;return e};e.y1=function(Ew){if(!arguments.length){return Et}Et=Ew;return e};e.interpolate=function(Ew){if(!arguments.length){return Es}if(!Az.has(Ew+="")){Ew=B6}Eq=Az.get(Es=Ew);Ep=Eq.reverse||Eq;return e};e.tension=function(Ew){if(!arguments.length){return Eu}Eu=Ew;return e};return e.interpolate("linear")}AZ.reverse=EQ;EQ.reverse=AZ;d3.svg.area=function(){return Ek(Object)};function Bi(e){return function(Eo,En){return e[En][0]}}function Bh(e){return function(Eo,En){return e[En][1]}}d3.svg.area.radial=function(){var e=Ek(f);e.radius=e.x,delete e.x;e.innerRadius=e.x0,delete e.x0;e.outerRadius=e.x1,delete e.x1;e.angle=e.y,delete e.y;e.startAngle=e.y0,delete e.y0;e.endAngle=e.y1,delete e.y1;return e};d3.svg.chord=function(){var e=t,Et=AD,Es=X,Eu=DZ,Eq=s;function Er(Ez,Ex){var Ey=Ev(this,e,Ez,Ex),Ew=Ev(this,Et,Ez,Ex);return"M"+Ey.p0+En(Ey.r,Ey.p1,Ey.a1-Ey.a0)+(Eo(Ey,Ew)?Ep(Ey.r,Ey.p1,Ey.r,Ey.p0):Ep(Ey.r,Ey.p1,Ew.r,Ew.p0)+En(Ew.r,Ew.p1,Ew.a1-Ew.a0)+Ep(Ew.r,Ew.p1,Ey.r,Ey.p0))+"Z"}function Ev(Ez,E2,E3,E0){var Ey=E2.call(Ez,E3,E0),E1=Es.call(Ez,Ey,E0),Ex=Eu.call(Ez,Ey,E0)+EU,Ew=Eq.call(Ez,Ey,E0)+EU;return{r:E1,a0:Ex,a1:Ew,p0:[E1*Math.cos(Ex),E1*Math.sin(Ex)],p1:[E1*Math.cos(Ew),E1*Math.sin(Ew)]}}function Eo(Ex,Ew){return Ex.a0==Ew.a0&&Ex.a1==Ew.a1}function En(Ex,Ey,Ew){return"A"+Ex+","+Ex+" 0 "+ +(Ew>Math.PI)+",1 "+Ey}function Ep(Ex,Ez,Ew,Ey){return"Q 0,0 "+Ey}Er.radius=function(Ew){if(!arguments.length){return Es}Es=d3.functor(Ew);return Er};Er.source=function(Ew){if(!arguments.length){return e}e=d3.functor(Ew);return Er};Er.target=function(Ew){if(!arguments.length){return Et}Et=d3.functor(Ew);return Er};Er.startAngle=function(Ew){if(!arguments.length){return Eu}Eu=d3.functor(Ew);return Er};Er.endAngle=function(Ew){if(!arguments.length){return Eq}Eq=d3.functor(Ew);return Er};return Er};function t(e){return e.source}function AD(e){return e.target}function X(e){return e.radius}function Dp(e){return e.startAngle}function CI(e){return e.endAngle}d3.svg.diagonal=function(){var Eo=t,Ep=AD,e=L;function En(Eu,Er){var Ev=Eo.call(this,Eu,Er),Es=Ep.call(this,Eu,Er),Eq=(Ev.y+Es.y)/2,Et=[Ev,{x:Ev.x,y:Eq},{x:Es.x,y:Eq},Es];Et=Et.map(e);return"M"+Et[0]+"C"+Et[1]+" "+Et[2]+" "+Et[3]}En.source=function(Eq){if(!arguments.length){return Eo}Eo=d3.functor(Eq);return En};En.target=function(Eq){if(!arguments.length){return Ep}Ep=d3.functor(Eq);return En};En.projection=function(Eq){if(!arguments.length){return e}e=Eq;return En};return En};function L(e){return[e.x,e.y]}d3.svg.diagonal.radial=function(){var Eo=d3.svg.diagonal(),e=L,En=Eo.projection;Eo.projection=function(Ep){return arguments.length?En(M(e=Ep)):e};return Eo};function M(e){return function(){var Ep=e.apply(this,arguments),Eo=Ep[0],En=Ep[1]+EU;return[Eo*Math.cos(En),Eo*Math.sin(En)]}}d3.svg.mouse=d3.mouse;d3.svg.touches=d3.touches;d3.svg.symbol=function(){var En=AI,e=Cj;function Eo(Eq,Ep){return(Ea.get(En.call(this,Eq,Ep))||A0)(e.call(this,Eq,Ep))}Eo.type=function(Ep){if(!arguments.length){return En}En=d3.functor(Ep);return Eo};Eo.size=function(Ep){if(!arguments.length){return e}e=d3.functor(Ep);return Eo};return Eo};function Cj(){return 64}function AI(){return"circle"}function A0(e){var En=Math.sqrt(e/Math.PI);return"M0,"+En+"A"+En+","+En+" 0 1,1 0,"+(-En)+"A"+En+","+En+" 0 1,1 0,"+En+"Z"}var Ea=d3.map({circle:A0,cross:function(e){var En=Math.sqrt(e/5)/2;return"M"+-3*En+","+-En+"H"+-En+"V"+-3*En+"H"+En+"V"+-En+"H"+3*En+"V"+En+"H"+En+"V"+3*En+"H"+-En+"V"+En+"H"+-3*En+"Z"},diamond:function(e){var En=Math.sqrt(e/(2*A4)),Eo=En*A4;return"M0,"+-En+"L"+Eo+",0 0,"+En+" "+-Eo+",0Z"},square:function(e){var En=Math.sqrt(e)/2;return"M"+-En+","+-En+"L"+En+","+-En+" "+En+","+En+" "+-En+","+En+"Z"},"triangle-down":function(e){var Eo=Math.sqrt(e/Ax),En=Eo*Ax/2;return"M0,"+En+"L"+Eo+","+-En+" "+-Eo+","+-En+"Z"},"triangle-up":function(e){var Eo=Math.sqrt(e/Ax),En=Eo*Ax/2;return"M0,"+-En+"L"+Eo+","+En+" "+-Eo+","+En+"Z"}});d3.svg.symbolTypes=Ea.keys();var Ax=Math.sqrt(3),A4=Math.tan(30*Math.PI/180);d3.svg.axis=function(){var Ep=d3.scale.linear(),Es="bottom",Eq=6,e=6,En=6,Ew=3,Ev=[10],Er=null,Eu,Et=0;function Eo(Ex){Ex.each(function(){var FG=d3.select(this);var FH=Er==null?(Ep.ticks?Ep.ticks.apply(Ep,Ev):Ep.domain()):Er,FA=Eu==null?(Ep.tickFormat?Ep.tickFormat.apply(Ep,Ev):String):Eu;var E2=BO(Ep,FH,Et),E1=FG.selectAll(".minor").data(E2,String),FD=E1.enter().insert("line","g").attr("class","tick minor").style("opacity",0.000001),FB=d3.transition(E1.exit()).style("opacity",0.000001).remove(),Ez=d3.transition(E1).style("opacity",1);var FF=FG.selectAll("g").data(FH,String),E7=FF.enter().insert("g","path").style("opacity",0.000001),E9=d3.transition(FF.exit()).style("opacity",0.000001).remove(),E3=d3.transition(FF).style("opacity",1),Ey;var E6=AL(Ep),E8=FG.selectAll(".domain").data([0]),E0=E8.enter().append("path").attr("class","domain"),FI=d3.transition(E8);var FC=Ep.copy(),FE=this.__chart__||FC;this.__chart__=FC;E7.append("line").attr("class","tick");E7.append("text");E3.select("text").text(FA);switch(Es){case"bottom":Ey=Cz;FD.attr("y2",e);Ez.attr("x2",0).attr("y2",e);E7.select("line").attr("y2",Eq);E7.select("text").attr("y",Math.max(Eq,0)+Ew);E3.select("line").attr("x2",0).attr("y2",Eq);E3.select("text").attr("x",0).attr("y",Math.max(Eq,0)+Ew).attr("dy",".71em").attr("text-anchor","middle");FI.attr("d","M"+E6[0]+","+En+"V0H"+E6[1]+"V"+En);break;case"top":Ey=Cz;FD.attr("y2",-e);Ez.attr("x2",0).attr("y2",-e);E7.select("line").attr("y2",-Eq);E7.select("text").attr("y",-(Math.max(Eq,0)+Ew));E3.select("line").attr("x2",0).attr("y2",-Eq);E3.select("text").attr("x",0).attr("y",-(Math.max(Eq,0)+Ew)).attr("dy","0em").attr("text-anchor","middle");FI.attr("d","M"+E6[0]+","+-En+"V0H"+E6[1]+"V"+-En);break;case"left":Ey=Cx;FD.attr("x2",-e);Ez.attr("x2",-e).attr("y2",0);E7.select("line").attr("x2",-Eq);E7.select("text").attr("x",-(Math.max(Eq,0)+Ew));E3.select("line").attr("x2",-Eq).attr("y2",0);E3.select("text").attr("x",-(Math.max(Eq,0)+Ew)).attr("y",0).attr("dy",".32em").attr("text-anchor","end");FI.attr("d","M"+-En+","+E6[0]+"H0V"+E6[1]+"H"+-En);break;case"right":Ey=Cx;FD.attr("x2",e);Ez.attr("x2",e).attr("y2",0);E7.select("line").attr("x2",Eq);E7.select("text").attr("x",Math.max(Eq,0)+Ew);E3.select("line").attr("x2",Eq).attr("y2",0);E3.select("text").attr("x",Math.max(Eq,0)+Ew).attr("y",0).attr("dy",".32em").attr("text-anchor","start");FI.attr("d","M"+En+","+E6[0]+"H0V"+E6[1]+"H"+En);break}if(Ep.ticks){E7.call(Ey,FE);E3.call(Ey,FC);E9.call(Ey,FC);FD.call(Ey,FE);Ez.call(Ey,FC);FB.call(Ey,FC)}else{var E5=FC.rangeBand()/2,E4=function(FJ){return FC(FJ)+E5};E7.call(Ey,E4);E3.call(Ey,E4)}})}Eo.scale=function(Ex){if(!arguments.length){return Ep}Ep=Ex;return Eo};Eo.orient=function(Ex){if(!arguments.length){return Es}Es=Ex;return Eo};Eo.ticks=function(){if(!arguments.length){return Ev}Ev=arguments;return Eo};Eo.tickValues=function(Ex){if(!arguments.length){return Er}Er=Ex;return Eo};Eo.tickFormat=function(Ex){if(!arguments.length){return Eu}Eu=Ex;return Eo};Eo.tickSize=function(Ex,E0,Ey){if(!arguments.length){return Eq}var Ez=arguments.length-1;Eq=+Ex;e=Ez>1?+E0:Eq;En=Ez>0?+arguments[Ez]:Eq;return Eo};Eo.tickPadding=function(Ex){if(!arguments.length){return Ew}Ew=+Ex;return Eo};Eo.tickSubdivide=function(Ex){if(!arguments.length){return Et}Et=+Ex;return Eo};return Eo};function Cz(En,e){En.attr("transform",function(Eo){return"translate("+e(Eo)+",0)"})}function Cx(e,En){e.attr("transform",function(Eo){return"translate(0,"+En(Eo)+")"})}function BO(Eo,Es,En){Et=[];if(En&&Es.length>1){var Ev=CH(Eo.domain()),Et,Eq=-1,e=Es.length,Er=(Es[1]-Es[0])/++En,Ep,Eu;while(++Eq<e){for(Ep=En;--Ep>0;){if((Eu=+Es[Eq]-Ep*Er)>=Ev[0]){Et.push(Eu)}}}for(--Eq,Ep=0;++Ep<En&&(Eu=+Es[Eq]+Ep*Er)<Ev[1];){Et.push(Eu)}}return Et}d3.svg.brush=function(){var e=EF(Eq,"brushstart","brush","brushend"),Es=null,Er=null,Et=v[0],Ew=[[0,0],[0,0]],En;function Eq(Ex){Ex.each(function(){var E0=d3.select(this),Ez=E0.selectAll(".background").data([0]),Ey=E0.selectAll(".extent").data([0]),E2=E0.selectAll(".resize").data(Et,String),E1;E0.style("pointer-events","all").on("mousedown.brush",Eu).on("touchstart.brush",Eu);Ez.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair");Ey.enter().append("rect").attr("class","extent").style("cursor","move");E2.enter().append("g").attr("class",function(E3){return"resize "+E3}).style("cursor",function(E3){return CX[E3]}).append("rect").attr("x",function(E3){return/[ew]$/.test(E3)?-3:null}).attr("y",function(E3){return/^[ns]/.test(E3)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden");E2.style("display",Eq.empty()?"none":null);E2.exit().remove();if(Es){E1=AL(Es);Ez.attr("x",E1[0]).attr("width",E1[1]-E1[0]);Ep(E0)}if(Er){E1=AL(Er);Ez.attr("y",E1[0]).attr("height",E1[1]-E1[0]);Eo(E0)}Ev(E0)})}function Ev(Ex){Ex.selectAll(".resize").attr("transform",function(Ey){return"translate("+Ew[+/e$/.test(Ey)][0]+","+Ew[+/^s/.test(Ey)][1]+")"})}function Ep(Ex){Ex.select(".extent").attr("x",Ew[0][0]);Ex.selectAll(".extent,.n>rect,.s>rect").attr("width",Ew[1][0]-Ew[0][0])}function Eo(Ex){Ex.select(".extent").attr("y",Ew[0][1]);Ex.selectAll(".extent,.e>rect,.w>rect").attr("height",Ew[1][1]-Ew[0][1])}function Eu(){var FG=this,Ey=d3.select(d3.event.target),E4=e.of(FG,arguments),FB=d3.select(FG),FD=Ey.datum(),E9=!/^(n|s)$/.test(FD)&&Es,E7=!/^(e|w)$/.test(FD)&&Er,E8=Ey.classed("extent"),FE,FF=E5(),Ez;var E2=d3.select(window).on("mousemove.brush",E3).on("mouseup.brush",Ex).on("touchmove.brush",E3).on("touchend.brush",Ex).on("keydown.brush",E6).on("keyup.brush",E1);if(E8){FF[0]=Ew[0][0]-FF[0];FF[1]=Ew[0][1]-FF[1]}else{if(FD){var FC=+/w$/.test(FD),FA=+/^n/.test(FD);Ez=[Ew[1-FC][0]-FF[0],Ew[1-FA][1]-FF[1]];FF[0]=Ew[FC][0];FF[1]=Ew[FA][1]}else{if(d3.event.altKey){FE=FF.slice()}}}FB.style("pointer-events","none").selectAll(".resize").style("display",null);d3.select("body").style("cursor",Ey.style("cursor"));E4({type:"brushstart"});E3();EW();function E5(){var FH=d3.event.changedTouches;return FH?d3.touches(FG,FH)[0]:d3.mouse(FG)}function E6(){if(d3.event.keyCode==32){if(!E8){FE=null;FF[0]-=Ew[1][0];FF[1]-=Ew[1][1];E8=2}EW()}}function E1(){if(d3.event.keyCode==32&&E8==2){FF[0]+=Ew[1][0];FF[1]+=Ew[1][1];E8=0;EW()}}function E3(){var FH=E5(),FI=false;if(Ez){FH[0]+=Ez[0];FH[1]+=Ez[1]}if(!E8){if(d3.event.altKey){if(!FE){FE=[(Ew[0][0]+Ew[1][0])/2,(Ew[0][1]+Ew[1][1])/2]}FF[0]=Ew[+(FH[0]<FE[0])][0];FF[1]=Ew[+(FH[1]<FE[1])][1]}else{FE=null}}if(E9&&E0(FH,Es,0)){Ep(FB);FI=true}if(E7&&E0(FH,Er,1)){Eo(FB);FI=true}if(FI){Ev(FB);E4({type:"brush",mode:E8?"move":"resize"})}}function E0(FP,FJ,FL){var FM=AL(FJ),FI=FM[0],FH=FM[1],FN=FF[FL],FQ=Ew[1][FL]-Ew[0][FL],FK,FO;if(E8){FI-=FN;FH-=FQ+FN}FK=Math.max(FI,Math.min(FH,FP[FL]));if(E8){FO=(FK+=FN)+FQ}else{if(FE){FN=Math.max(FI,Math.min(FH,2*FE[FL]-FK))}if(FN<FK){FO=FK;FK=FN}else{FO=FN}}if(Ew[0][FL]!==FK||Ew[1][FL]!==FO){En=null;Ew[0][FL]=FK;Ew[1][FL]=FO;return true}}function Ex(){E3();FB.style("pointer-events","all").selectAll(".resize").style("display",Eq.empty()?"none":null);d3.select("body").style("cursor",null);E2.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null);E4({type:"brushend"});EW()}}Eq.x=function(Ex){if(!arguments.length){return Es}Es=Ex;Et=v[!Es<<1|!Er];return Eq};Eq.y=function(Ex){if(!arguments.length){return Er}Er=Ex;Et=v[!Es<<1|!Er];return Eq};Eq.extent=function(E2){var Ez,Ex,E1,E0,Ey;if(!arguments.length){E2=En||Ew;if(Es){Ez=E2[0][0],Ex=E2[1][0];if(!En){Ez=Ew[0][0],Ex=Ew[1][0];if(Es.invert){Ez=Es.invert(Ez),Ex=Es.invert(Ex)}if(Ex<Ez){Ey=Ez,Ez=Ex,Ex=Ey}}}if(Er){E1=E2[0][1],E0=E2[1][1];if(!En){E1=Ew[0][1],E0=Ew[1][1];if(Er.invert){E1=Er.invert(E1),E0=Er.invert(E0)}if(E0<E1){Ey=E1,E1=E0,E0=Ey}}}return Es&&Er?[[Ez,E1],[Ex,E0]]:Es?[Ez,Ex]:Er&&[E1,E0]}En=[[0,0],[0,0]];if(Es){Ez=E2[0],Ex=E2[1];if(Er){Ez=Ez[0],Ex=Ex[0]}En[0][0]=Ez,En[1][0]=Ex;if(Es.invert){Ez=Es(Ez),Ex=Es(Ex)}if(Ex<Ez){Ey=Ez,Ez=Ex,Ex=Ey}Ew[0][0]=Ez|0,Ew[1][0]=Ex|0}if(Er){E1=E2[0],E0=E2[1];if(Es){E1=E1[1],E0=E0[1]}En[0][1]=E1,En[1][1]=E0;if(Er.invert){E1=Er(E1),E0=Er(E0)}if(E0<E1){Ey=E1,E1=E0,E0=Ey}Ew[0][1]=E1|0,Ew[1][1]=E0|0}return Eq};Eq.clear=function(){En=null;Ew[0][0]=Ew[0][1]=Ew[1][0]=Ew[1][1]=0;return Eq};Eq.empty=function(){return(Es&&Ew[0][0]===Ew[1][0])||(Er&&Ew[0][1]===Ew[1][1])};return d3.rebind(Eq,e,"on")};var CX={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"};var v=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];d3.behavior={};d3.behavior.drag=function(){var Ep=EF(Eo,"drag","dragstart","dragend"),e=null;function Eo(){this.on("mousedown.drag",En).on("touchstart.drag",En)}function En(){var Es=this,Ew=Ep.of(Es,arguments),Ev=d3.event.target,Er,Et=Ey(),Eu=0;var Ex=d3.select(window).on("mousemove.drag",Ez).on("touchmove.drag",Ez).on("mouseup.drag",Eq,true).on("touchend.drag",Eq,true);if(e){Er=e.apply(Es,arguments);Er=[Er.x-Et[0],Er.y-Et[1]]}else{Er=[0,0]}Ew({type:"dragstart"});function Ey(){var E2=Es.parentNode,E1=d3.event.changedTouches;return E1?d3.touches(E2,E1)[0]:d3.mouse(E2)}function Ez(){if(!Es.parentNode){return Eq()}var E3=Ey(),E2=E3[0]-Et[0],E1=E3[1]-Et[1];Eu|=E2|E1;Et=E3;EW();Ew({type:"drag",x:E3[0]+Er[0],y:E3[1]+Er[1],dx:E2,dy:E1})}function Eq(){Ew({type:"dragend"});if(Eu){EW();if(d3.event.target===Ev){Ex.on("click.drag",E0,true)}}Ex.on("mousemove.drag",null).on("touchmove.drag",null).on("mouseup.drag",null).on("touchend.drag",null)}function E0(){EW();Ex.on("click.drag",null)}}Eo.origin=function(Eq){if(!arguments.length){return e}e=Eq;return Eo};return d3.rebind(Eo,Ep,"on")};d3.behavior.zoom=function(){var Et=[0,0],E4,E8=1,E0,Eo=DN,Ez=EF(e,"zoom"),E3,E1,Eq,Ep,Es;function e(){this.on("mousedown.zoom",Ex).on("mousewheel.zoom",Ew).on("mousemove.zoom",E5).on("DOMMouseScroll.zoom",Ew).on("dblclick.zoom",Eu).on("touchstart.zoom",E2).on("touchmove.zoom",Ev).on("touchend.zoom",E2)}e.translate=function(E9){if(!arguments.length){return Et}Et=E9.map(Number);return e};e.scale=function(E9){if(!arguments.length){return E8}E8=+E9;return e};e.scaleExtent=function(E9){if(!arguments.length){return Eo}Eo=E9==null?DN:E9.map(Number);return e};e.x=function(E9){if(!arguments.length){return E1}E1=E9;E3=E9.copy();return e};e.y=function(E9){if(!arguments.length){return Ep}Ep=E9;Eq=E9.copy();return e};function En(E9){return[(E9[0]-Et[0])/E8,(E9[1]-Et[1])/E8]}function Ey(E9){return[E9[0]*E8+Et[0],E9[1]*E8+Et[1]]}function Er(E9){E8=Math.max(Eo[0],Math.min(Eo[1],E9))}function E6(FA,E9){E9=Ey(E9);Et[0]+=FA[0]-E9[0];Et[1]+=FA[1]-E9[1]}function E7(E9){if(E1){E1.domain(E3.range().map(function(FA){return(FA-Et[0])/E8}).map(E3.invert))}if(Ep){Ep.domain(Eq.range().map(function(FA){return(FA-Et[1])/E8}).map(Eq.invert))}d3.event.preventDefault();E9({type:"zoom",scale:E8,translate:Et})}function Ex(){var FC=this,FF=Ez.of(FC,arguments),FE=d3.event.target,FD=0,FG=d3.select(window).on("mousemove.zoom",FB).on("mouseup.zoom",FA),E9=En(d3.mouse(FC));window.focus();EW();function FB(){FD=1;E6(d3.mouse(FC),E9);E7(FF)}function FA(){if(FD){EW()}FG.on("mousemove.zoom",null).on("mouseup.zoom",null);if(FD&&d3.event.target===FE){FG.on("click.zoom",FH)}}function FH(){EW();FG.on("click.zoom",null)}}function Ew(){if(!E4){E4=En(d3.mouse(this))}Er(Math.pow(2,BB()*0.002)*E8);E6(d3.mouse(this),E4);E7(Ez.of(this,arguments))}function E5(){E4=null}function Eu(){var FA=d3.mouse(this),E9=En(FA);Er(d3.event.shiftKey?E8/2:E8*2);E6(FA,E9);E7(Ez.of(this,arguments))}function E2(){var FC=d3.touches(this),FA=Date.now();E0=E8;E4={};FC.forEach(function(FD){E4[FD.identifier]=En(FD)});EW();if((FC.length===1)&&(FA-Es<500)){var FB=FC[0],E9=En(FC[0]);Er(E8*2);E6(FB,E9);E7(Ez.of(this,arguments))}Es=FA}function Ev(){var FB=d3.touches(this),FD=FB[0],FA=E4[FD.identifier];if(FC=FB[1]){var FC,E9=E4[FC.identifier];FD=[(FD[0]+FC[0])/2,(FD[1]+FC[1])/2];FA=[(FA[0]+E9[0])/2,(FA[1]+E9[1])/2];Er(d3.event.scale*E0)}E6(FD,FA);E7(Ez.of(this,arguments))}return d3.rebind(e,Ez,"on")};var B5,DN=[0,Infinity];function BB(){if(!B5){B5=d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode}var Eo=d3.event,Ep;try{B5.scrollTop=1000;B5.dispatchEvent(Eo);Ep=1000-B5.scrollTop}catch(En){Ep=Eo.wheelDelta||(-Eo.detail*5)}return Ep}d3.layout={};d3.layout.bundle=function(){return function(e){var Eo=[],En=-1,Ep=e.length;while(++En<Ep){Eo.push(CR(e[En]))}return Eo}};function CR(Ep){var Er=Ep.source,e=Ep.target,Eq=DI(Er,e),Eo=[Er];while(Er!==Eq){Er=Er.parent;Eo.push(Er)}var En=Eo.length;while(e!==Eq){Eo.splice(En,0,e);e=e.parent}return Eo}function C1(Eo){var En=[],e=Eo.parent;while(e!=null){En.push(Eo);Eo=e;e=e.parent}En.push(Eo);return En}function DI(Ep,En){if(Ep===En){return Ep}var Eo=C1(Ep),e=C1(En),Eq=Eo.pop(),Er=e.pop(),Es=null;while(Eq===Er){Es=Eq;Eq=Eo.pop();Er=e.pop()}return Es}d3.layout.chord=function(){var Er={},Es,Ep,Ew,Eo,Ev=0,e,En,Eq;function Eu(){var E1={},E4=[],FC=d3.range(Eo),E8=[],E2,FA,E0,E5,E3;Es=[];Ep=[];E2=0,E5=-1;while(++E5<Eo){FA=0,E3=-1;while(++E3<Eo){FA+=Ew[E5][E3]}E4.push(FA);E8.push(d3.range(Eo));E2+=FA}if(e){FC.sort(function(FE,FD){return e(E4[FE],E4[FD])})}if(En){E8.forEach(function(FE,FD){FE.sort(function(FG,FF){return En(Ew[FD][FG],Ew[FD][FF])})})}E2=(2*Math.PI-Ev*Eo)/E2;FA=0,E5=-1;while(++E5<Eo){E0=FA,E3=-1;while(++E3<Eo){var E9=FC[E5],E7=E8[E9][E3],FB=Ew[E9][E7],Ez=FA,Ey=FA+=FB*E2;E1[E9+"-"+E7]={index:E9,subindex:E7,startAngle:Ez,endAngle:Ey,value:FB}}Ep.push({index:E9,startAngle:E0,endAngle:FA,value:(FA-E0)/E2});FA+=Ev}E5=-1;while(++E5<Eo){E3=E5-1;while(++E3<Eo){var Ex=E1[E5+"-"+E3],E6=E1[E3+"-"+E5];if(Ex.value||E6.value){Es.push(Ex.value<E6.value?{source:E6,target:Ex}:{source:Ex,target:E6})}}}if(Eq){Et()}}function Et(){Es.sort(function(Ey,Ex){return Eq((Ey.source.value+Ey.target.value)/2,(Ex.source.value+Ex.target.value)/2)})}Er.matrix=function(Ex){if(!arguments.length){return Ew}Eo=(Ew=Ex)&&Ew.length;Es=Ep=null;return Er};Er.padding=function(Ex){if(!arguments.length){return Ev}Ev=Ex;Es=Ep=null;return Er};Er.sortGroups=function(Ex){if(!arguments.length){return e}e=Ex;Es=Ep=null;return Er};Er.sortSubgroups=function(Ex){if(!arguments.length){return En}En=Ex;Es=null;return Er};Er.sortChords=function(Ex){if(!arguments.length){return Eq}Eq=Ex;if(Es){Et()}return Er};Er.chords=function(){if(!Es){Eu()}return Es};Er.groups=function(){if(!Ep){Eu()}return Ep};return Er};d3.layout.force=function(){var En={},E0=d3.dispatch("start","tick","end"),Ew=[1,1],E2,Eq,Et=0.9,E4=DJ,Ep=A8,Ez=-30,Er=0.1,Eu=0.8,E3,Ey=[],Eo=[],Es,e,Ev;function E1(E5){return function(FC,E7,FB,E6,FA){if(FC.point!==E5){var FE=FC.cx-E5.x,FD=FC.cy-E5.y,E9=1/Math.sqrt(FE*FE+FD*FD);if((E6-E7)*E9<Eu){var E8=FC.charge*E9*E9;E5.px-=FE*E8;E5.py-=FD*E8;return true}if(FC.point&&isFinite(E9)){var E8=FC.pointCharge*E9*E9;E5.px-=FE*E8;E5.py-=FD*E8}}return !FC.charge}}En.tick=function(){if((Eq*=0.99)<0.005){E0.end({type:"end",alpha:Eq=0});return true}var E7=Ey.length,E8=Eo.length,E5,FB,E6,FF,FE,E9,FA,FD,FC;for(FB=0;FB<E8;++FB){E6=Eo[FB];FF=E6.source;FE=E6.target;FD=FE.x-FF.x;FC=FE.y-FF.y;if(E9=(FD*FD+FC*FC)){E9=Eq*e[FB]*((E9=Math.sqrt(E9))-Es[FB])/E9;FD*=E9;FC*=E9;FE.x-=FD*(FA=FF.weight/(FE.weight+FF.weight));FE.y-=FC*FA;FF.x+=FD*(FA=1-FA);FF.y+=FC*FA}}if(FA=Eq*Er){FD=Ew[0]/2;FC=Ew[1]/2;FB=-1;if(FA){while(++FB<E7){E6=Ey[FB];E6.x+=(FD-E6.x)*FA;E6.y+=(FC-E6.y)*FA}}}if(Ez){Dn(E5=d3.geom.quadtree(Ey),Eq,Ev);FB=-1;while(++FB<E7){if(!(E6=Ey[FB]).fixed){E5.visit(E1(E6))}}}FB=-1;while(++FB<E7){E6=Ey[FB];if(E6.fixed){E6.x=E6.px;E6.y=E6.py}else{E6.x-=(E6.px-(E6.px=E6.x))*Et;E6.y-=(E6.py-(E6.py=E6.y))*Et}}E0.tick({type:"tick",alpha:Eq})};En.nodes=function(E5){if(!arguments.length){return Ey}Ey=E5;return En};En.links=function(E5){if(!arguments.length){return Eo}Eo=E5;return En};En.size=function(E5){if(!arguments.length){return Ew}Ew=E5;return En};En.linkDistance=function(E5){if(!arguments.length){return E4}E4=d3.functor(E5);return En};En.distance=En.linkDistance;En.linkStrength=function(E5){if(!arguments.length){return Ep}Ep=d3.functor(E5);return En};En.friction=function(E5){if(!arguments.length){return Et}Et=E5;return En};En.charge=function(E5){if(!arguments.length){return Ez}Ez=typeof E5==="function"?E5:+E5;return En};En.gravity=function(E5){if(!arguments.length){return Er}Er=E5;return En};En.theta=function(E5){if(!arguments.length){return Eu}Eu=E5;return En};En.alpha=function(E5){if(!arguments.length){return Eq}if(Eq){if(E5>0){Eq=E5}else{Eq=0}}else{if(E5>0){E0.start({type:"start",alpha:Eq=E5});d3.timer(En.tick)}}return En};En.start=function(){var E9,E8,E6=Ey.length,E7=Eo.length,FC=Ew[0],FB=Ew[1],FE,E5;for(E9=0;E9<E6;++E9){(E5=Ey[E9]).index=E9;E5.weight=0}Es=[];e=[];for(E9=0;E9<E7;++E9){E5=Eo[E9];if(typeof E5.source=="number"){E5.source=Ey[E5.source]}if(typeof E5.target=="number"){E5.target=Ey[E5.target]}Es[E9]=E4.call(this,E5,E9);e[E9]=Ep.call(this,E5,E9);++E5.source.weight;++E5.target.weight}for(E9=0;E9<E6;++E9){E5=Ey[E9];if(isNaN(E5.x)){E5.x=FA("x",FC)}if(isNaN(E5.y)){E5.y=FA("y",FB)}if(isNaN(E5.px)){E5.px=E5.x}if(isNaN(E5.py)){E5.py=E5.y}}Ev=[];if(typeof Ez==="function"){for(E9=0;E9<E6;++E9){Ev[E9]=+Ez.call(this,Ey[E9],E9)}}else{for(E9=0;E9<E6;++E9){Ev[E9]=Ez}}function FA(FK,FJ){var FI=FD(E9),FH=-1,FG=FI.length,FF;while(++FH<FG){if(!isNaN(FF=FI[FH][FK])){return FF}}return Math.random()*FJ}function FD(){if(!FE){FE=[];for(E8=0;E8<E6;++E8){FE[E8]=[]}for(E8=0;E8<E7;++E8){var FF=Eo[E8];FE[FF.source.index].push(FF.target);FE[FF.target.index].push(FF.source)}}return FE[E9]}return En.resume()};En.resume=function(){return En.alpha(0.1)};En.stop=function(){return En.alpha(0)};En.drag=function(){if(!E2){E2=d3.behavior.drag().origin(Object).on("dragstart",Ex).on("drag",C6).on("dragend",Cc)}this.on("mouseover.force",J).on("mouseout.force",Dm).call(E2)};function Ex(E5){J(DC=E5);Cy=En}return d3.rebind(En,E0,"on")};var Cy,DC;function J(e){e.fixed|=2}function Dm(e){if(e!==DC){e.fixed&=1}}function Cc(){DC.fixed&=1;Cy=DC=null}function C6(){DC.px=d3.event.x;DC.py=d3.event.y;Cy.resume()}function Dn(Ev,Eq,Eu){var Er=0,Eo=0;Ev.charge=0;if(!Ev.leaf){var e=Ev.nodes,En=e.length,Es=-1,Et;while(++Es<En){Et=e[Es];if(Et==null){continue}Dn(Et,Eq,Eu);Ev.charge+=Et.charge;Er+=Et.charge*Et.cx;Eo+=Et.charge*Et.cy}}if(Ev.point){if(!Ev.leaf){Ev.point.x+=Math.random()-0.5;Ev.point.y+=Math.random()-0.5}var Ep=Eq*Eu[Ev.point.index];Ev.charge+=Ev.pointCharge=Ep;Er+=Ep*Ev.point.x;Eo+=Ep*Ev.point.y}Ev.cx=Er/Ev.charge;Ev.cy=Eo/Ev.charge}function DJ(e){return 20}function A8(e){return 1}d3.layout.partition=function(){var Eo=d3.layout.hierarchy(),Ep=[1,1];function e(Et,Ex,Ez,Ey){var Er=Et.children;Et.x=Ex;Et.y=Et.depth*Ey;Et.dx=Ez;Et.dy=Ey;if(Er&&(Es=Er.length)){var Eu=-1,Es,Ew,Ev;Ez=Et.value?Ez/Et.value:0;while(++Eu<Es){e(Ew=Er[Eu],Ex,Ev=Ew.value*Ez,Ey);Ex+=Ev}}}function Eq(Et){var Es=Et.children,Eu=0;if(Es&&(Ev=Es.length)){var Er=-1,Ev;while(++Er<Ev){Eu=Math.max(Eu,Eq(Es[Er]))}}return 1+Eu}function En(Et,Es){var Er=Eo.call(this,Et,Es);e(Er[0],0,Ep[0],Ep[1]/Eq(Er[0]));return Er}En.size=function(Er){if(!arguments.length){return Ep}Ep=Er;return En};return Di(En,Eo)};d3.layout.pie=function(){var Eq=Number,Ep=j,Eo=0,En=2*Math.PI;function e(Ex,Ev){var Et=Ex.map(function(Ez,Ey){return +Eq.call(e,Ez,Ey)});var Er=+(typeof Eo==="function"?Eo.apply(this,arguments):Eo);var Es=((typeof En==="function"?En.apply(this,arguments):En)-Eo)/d3.sum(Et);var Eu=d3.range(Ex.length);if(Ep!=null){Eu.sort(Ep===j?function(Ez,Ey){return Et[Ey]-Et[Ez]}:function(Ez,Ey){return Ep(Ex[Ez],Ex[Ey])})}var Ew=[];Eu.forEach(function(Ey){Ew[Ey]={data:Ex[Ey],value:d=Et[Ey],startAngle:Er,endAngle:Er+=d*Es}});return Ew}e.value=function(Er){if(!arguments.length){return Eq}Eq=Er;return e};e.sort=function(Er){if(!arguments.length){return Ep}Ep=Er;return e};e.startAngle=function(Er){if(!arguments.length){return Eo}Eo=Er;return e};e.endAngle=function(Er){if(!arguments.length){return En}En=Er;return e};return e};var j={};d3.layout.stack=function(){var Ep=Object,Eo=An,Er=DE,Eq=DF,En=r,Es=q;function e(E0,E2){var E1=E0.map(function(E5,E4){return Ep.call(e,E5,E4)});var E3=E1.map(function(E5,E4){return E5.map(function(E6,E7){return[En.call(e,E6,E7),Es.call(e,E6,E7)]})});var Ex=Eo.call(e,E3,E2);E1=d3.permute(E1,Ex);E3=d3.permute(E3,Ex);var Ew=Er.call(e,E3,E2);var Eu=E1.length,Ev=E1[0].length,Ez,Ey,Et;for(Ey=0;Ey<Ev;++Ey){Eq.call(e,E1[0][Ey],Et=Ew[Ey],E3[0][Ey][1]);for(Ez=1;Ez<Eu;++Ez){Eq.call(e,E1[Ez][Ey],Et+=E3[Ez-1][Ey][1],E3[Ez][Ey][1])}}return E0}e.values=function(Et){if(!arguments.length){return Ep}Ep=Et;return e};e.order=function(Et){if(!arguments.length){return Eo}Eo=typeof Et==="function"?Et:AP.get(Et)||An;return e};e.offset=function(Et){if(!arguments.length){return Er}Er=typeof Et==="function"?Et:o.get(Et)||DE;return e};e.x=function(Et){if(!arguments.length){return En}En=Et;return e};e.y=function(Et){if(!arguments.length){return Es}Es=Et;return e};e.out=function(Et){if(!arguments.length){return Eq}Eq=Et;return e};return e};function r(e){return e.x}function q(e){return e.y}function DF(En,e,Eo){En.y0=e;En.y=Eo}var AP=d3.map({"inside-out":function(Eq){var Eo=Eq.length,Er,Ep,Ev=Eq.map(At),Es=Eq.map(Bj),Et=d3.range(Eo).sort(function(Ey,Ex){return Ev[Ey]-Ev[Ex]}),Eu=0,e=0,Ew=[],En=[];for(Er=0;Er<Eo;++Er){Ep=Et[Er];if(Eu<e){Eu+=Es[Ep];Ew.push(Ep)}else{e+=Es[Ep];En.push(Ep)}}return En.reverse().concat(Ew)},reverse:function(e){return d3.range(e.length).reverse()},"default":An});var o=d3.map({silhouette:function(Eq){var En=Eq.length,Eo=Eq[0].length,Es=[],Et=0,Er,Ep,e,Eu=[];for(Ep=0;Ep<Eo;++Ep){for(Er=0,e=0;Er<En;Er++){e+=Eq[Er][Ep][1]}if(e>Et){Et=e}Es.push(e)}for(Ep=0;Ep<Eo;++Ep){Eu[Ep]=(Et-Es[Ep])/2}return Eu},wiggle:function(Es){var En=Es.length,Ew=Es[0],Eo=Ew.length,Eu=0,Et,Er,Eq,Ez,Ey,Ev,E0,e,Ep,Ex=[];Ex[0]=e=Ep=0;for(Er=1;Er<Eo;++Er){for(Et=0,Ez=0;Et<En;++Et){Ez+=Es[Et][Er][1]}for(Et=0,Ey=0,E0=Ew[Er][0]-Ew[Er-1][0];Et<En;++Et){for(Eq=0,Ev=(Es[Et][Er][1]-Es[Et][Er-1][1])/(2*E0);Eq<Et;++Eq){Ev+=(Es[Eq][Er][1]-Es[Eq][Er-1][1])/E0}Ey+=Ev*Es[Et][Er][1]}Ex[Er]=e-=Ez?Ey/Ez*E0:0;if(e<Ep){Ep=e}}for(Er=0;Er<Eo;++Er){Ex[Er]-=Ep}return Ex},expand:function(Er){var Et=Er.length,e=Er[0].length,En=1/Et,Ep,Eo,Es,Eq=[];for(Eo=0;Eo<e;++Eo){for(Ep=0,Es=0;Ep<Et;Ep++){Es+=Er[Ep][Eo][1]}if(Es){for(Ep=0;Ep<Et;Ep++){Er[Ep][Eo][1]/=Es}}else{for(Ep=0;Ep<Et;Ep++){Er[Ep][Eo][1]=En}}}for(Eo=0;Eo<e;++Eo){Eq[Eo]=0}return Eq},zero:DE});function An(e){return d3.range(e.length)}function DE(Ep){var En=-1,e=Ep[0].length,Eo=[];while(++En<e){Eo[En]=0}return Eo}function At(Er){var Ep=1,Eo=0,En=Er[0][1],e,Eq=Er.length;for(;Ep<Eq;++Ep){if((e=Er[Ep][1])>En){Eo=Ep;En=e}}return Eo}function Bj(e){return e.reduce(DD,0)}function DD(e,En){return e+En[1]}d3.layout.histogram=function(){var Eq=true,En=Number,e=AX,Eo=EP;function Ep(Eu,Ev){var E0=[],Ey=Eu.map(En,this),Ew=e.call(this,Ey,Ev),Ez=Eo.call(this,Ew,Ey,Ev),E1,Ev=-1,Er=Ey.length,Es=Ez.length-1,Et=Eq?1:1/Er,Ex;while(++Ev<Es){E1=E0[Ev]=[];E1.dx=Ez[Ev+1]-(E1.x=Ez[Ev]);E1.y=0}Ev=-1;while(++Ev<Er){Ex=Ey[Ev];if((Ex>=Ew[0])&&(Ex<=Ew[1])){E1=E0[d3.bisect(Ez,Ex,1,Es)-1];E1.y+=Et;E1.push(Eu[Ev])}}return E0}Ep.value=function(Er){if(!arguments.length){return En}En=Er;return Ep};Ep.range=function(Er){if(!arguments.length){return e}e=d3.functor(Er);return Ep};Ep.bins=function(Er){if(!arguments.length){return Eo}Eo=typeof Er==="number"?function(Es){return F(Es,Er)}:d3.functor(Er);return Ep};Ep.frequency=function(Er){if(!arguments.length){return Eq}Eq=!!Er;return Ep};return Ep};function EP(En,e){return F(En,Math.ceil(Math.log(e.length)/Math.LN2+1))}function F(Ep,Er){var Eo=-1,En=+Ep[0],e=(Ep[1]-En)/Er,Eq=[];while(++Eo<=Er){Eq[Eo]=e*Eo+En}return Eq}function AX(e){return[d3.min(e),d3.max(e)]}d3.layout.hierarchy=function(){var Eo=Bx,En=AR,Eq=EY;function Ep(Ex,Ew,Es){var Ez=En.call(e,Ex,Ew),Eu=H?Ex:{data:Ex};Eu.depth=Ew;Es.push(Eu);if(Ez&&(Et=Ez.length)){var Ey=-1,Et,E0=Eu.children=[],E1=0,Ev=Ew+1;while(++Ey<Et){d=Ep(Ez[Ey],Ev,Es);d.parent=Eu;E0.push(d);E1+=d.value}if(Eo){E0.sort(Eo)}if(Eq){Eu.value=E1}}else{if(Eq){Eu.value=+Eq.call(e,Ex,Ew)||0}}return Eu}function Er(Ew,Ex){var Ev=Ew.children,Es=0;if(Ev&&(Ey=Ev.length)){var Eu=-1,Ey,Et=Ex+1;while(++Eu<Ey){Es+=Er(Ev[Eu],Et)}}else{if(Eq){Es=+Eq.call(e,H?Ew:Ew.data,Ex)||0}}if(Eq){Ew.value=Es}return Es}function e(Et){var Es=[];Ep(Et,0,Es);return Es}e.sort=function(Es){if(!arguments.length){return Eo}Eo=Es;return e};e.children=function(Es){if(!arguments.length){return En}En=Es;return e};e.value=function(Es){if(!arguments.length){return Eq}Eq=Es;return e};e.revalue=function(Es){Er(Es,0);return Es};return e};function Di(En,e){d3.rebind(En,e,"sort","children","value");En.links=Dj;En.nodes=function(Eo){H=true;return(En.nodes=En)(Eo)};return En}function AR(e){return e.children}function EY(e){return e.value}function Bx(En,e){return e.value-En.value}function Dj(e){return d3.merge(e.map(function(En){return(En.children||[]).map(function(Eo){return{source:En,target:Eo}})}))}var H=false;d3.layout.pack=function(){var e=d3.layout.hierarchy().sort(CM),Eo=[1,1];function En(Ev,Et){var Es=e.call(this,Ev,Et),Eq=Es[0];Eq.x=0;Eq.y=0;B7(Eq);var Ep=Eo[0],Eu=Eo[1],Er=1/Math.max(2*Eq.r/Ep,2*Eq.r/Eu);C0(Eq,Ep/2,Eu/2,Er);return Es}En.size=function(Ep){if(!arguments.length){return Eo}Eo=Ep;return En};return Di(En,e)};function CM(En,e){return En.value-e.value}function Ao(En,e){var Eo=En._pack_next;En._pack_next=e;e._pack_prev=En;e._pack_next=Eo;Eo._pack_prev=e}function AT(En,e){En._pack_next=e;e._pack_prev=En}function CF(Eo,e){var Ep=e.x-Eo.x,En=e.y-Eo.y,Eq=Eo.r+e.r;return Eq*Eq-Ep*Ep-En*En>0.001}function g(Ew){var E1=Infinity,E5=-Infinity,e=Infinity,Eq=-Infinity,Ev=Ew.length,E4,E3,E2,Ez,Ey;function Eo(E6){E1=Math.min(E6.x-E6.r,E1);E5=Math.max(E6.x+E6.r,E5);e=Math.min(E6.y-E6.r,e);Eq=Math.max(E6.y+E6.r,Eq)}Ew.forEach(AG);E4=Ew[0];E4.x=-E4.r;E4.y=0;Eo(E4);if(Ev>1){E3=Ew[1];E3.x=E3.r;E3.y=0;Eo(E3);if(Ev>2){E2=Ew[2];AS(E4,E3,E2);Eo(E2);Ao(E4,E2);E4._pack_prev=E2;Ao(E2,E3);E3=E4._pack_next;for(var E0=3;E0<Ev;E0++){AS(E4,E3,E2=Ew[E0]);var En=0,Er=1,Ep=1;for(Ez=E3._pack_next;Ez!==E3;Ez=Ez._pack_next,Er++){if(CF(Ez,E2)){En=1;break}}if(En==1){for(Ey=E4._pack_prev;Ey!==Ez._pack_prev;Ey=Ey._pack_prev,Ep++){if(CF(Ey,E2)){break}}}if(En){if(Er<Ep||(Er==Ep&&E3.r<E4.r)){AT(E4,E3=Ez)}else{AT(E4=Ey,E3)}E0--}else{Ao(E4,E2);E3=E2;Eo(E2)}}}}var Et=(E1+E5)/2,Es=(e+Eq)/2,Eu=0;for(var E0=0;E0<Ev;E0++){var Ex=Ew[E0];Ex.x-=Et;Ex.y-=Es;Eu=Math.max(Eu,Ex.r+Math.sqrt(Ex.x*Ex.x+Ex.y*Ex.y))}Ew.forEach(CS);return Eu}function AG(e){e._pack_next=e._pack_prev=e}function CS(e){delete e._pack_next;delete e._pack_prev}function B7(En){var e=En.children;if(e&&e.length){e.forEach(B7);En.r=g(e)}else{En.r=Math.sqrt(En.value)}}function C0(Eq,e,Es,En){var Ep=Eq.children;Eq.x=(e+=En*Eq.x);Eq.y=(Es+=En*Eq.y);Eq.r*=En;if(Ep){var Eo=-1,Er=Ep.length;while(++Eo<Er){C0(Ep[Eo],e,Es,En)}}}function AS(Er,Ep,En){var Eu=Er.r+En.r,Ex=Ep.x-Er.x,Ev=Ep.y-Er.y;if(Eu&&(Ex||Ev)){var Ew=Ep.r+En.r,Et=Math.sqrt(Ex*Ex+Ev*Ev),Es=Math.max(-1,Math.min(1,(Eu*Eu+Et*Et-Ew*Ew)/(2*Eu*Et))),e=Math.acos(Es),Eq=Es*(Eu/=Et),Eo=Math.sin(e)*Eu;En.x=Er.x+Eq*Ex+Eo*Ev;En.y=Er.y+Eq*Ev-Eo*Ex}else{En.x=Er.x+Eu;En.y=Er.y}}d3.layout.cluster=function(){var En=d3.layout.hierarchy().sort(null).value(null),Ep=Bm,Eo=[1,1];function e(Ex,Eu){var Eq=En.call(this,Ex,Eu),Ey=Eq[0],Ez,E0=0,Ew,Ev;ET(Ey,function(E3){var E2=E3.children;if(E2&&E2.length){E3.x=Ad(E2);E3.y=Ac(E2)}else{E3.x=Ez?E0+=Ep(E3,Ez):0;E3.y=0;Ez=E3}});var Et=CN(Ey),E1=Br(Ey),Es=Et.x-Ep(Et,E1)/2,Er=E1.x+Ep(E1,Et)/2;ET(Ey,function(E2){E2.x=(E2.x-Es)/(Er-Es)*Eo[0];E2.y=(1-(Ey.y?E2.y/Ey.y:1))*Eo[1]});return Eq}e.separation=function(Eq){if(!arguments.length){return Ep}Ep=Eq;return e};e.size=function(Eq){if(!arguments.length){return Eo}Eo=Eq;return e};return Di(e,En)};function Ac(e){return 1+d3.max(e,function(En){return En.y})}function Ad(e){return e.reduce(function(En,Eo){return En+Eo.x},0)/e.length}function CN(En){var e=En.children;return e&&e.length?CN(e[0]):En}function Br(En){var e=En.children,Eo;return e&&(Eo=e.length)?Br(e[Eo-1]):En}d3.layout.tree=function(){var En=d3.layout.hierarchy().sort(null).value(null),Ep=Bm,Eo=[1,1];function e(Ex,Ev){var Er=En.call(this,Ex,Ev),Ez=Er[0];function Ew(E7,E3){var E5=E7.children,FA=E7._tree;if(E5&&(E6=E5.length)){var E6,FC=E5[0],FB,E9=FC,E4,E8=-1;while(++E8<E6){E4=E5[E8];Ew(E4,FB);E9=Eq(E4,FB,E9);FB=E4}Bo(E7);var FD=0.5*(FC._tree.prelim+E4._tree.prelim);if(E3){FA.prelim=E3._tree.prelim+Ep(E7,E3);FA.mod=FA.prelim-FD}else{FA.prelim=FD}}else{if(E3){FA.prelim=E3._tree.prelim+Ep(E7,E3)}}}function Ey(E6,E3){E6.x=E6._tree.prelim+E3;var E5=E6.children;if(E5&&(E7=E5.length)){var E4=-1,E7;E3+=E6._tree.mod;while(++E4<E7){Ey(E5[E4],E3)}}}function Eq(E7,E3,FA){if(E3){var E6=E7,E5=E7,E9=E3,E8=E7.parent.children[0],FC=E6._tree.mod,FB=E5._tree.mod,FE=E9._tree.mod,FD=E8._tree.mod,E4;while(E9=y(E9),E6=Ee(E6),E9&&E6){E8=Ee(E8);E5=y(E5);E5._tree.ancestor=E7;E4=E9._tree.prelim+FE-E6._tree.prelim-FC+Ep(E9,E6);if(E4>0){Eg(DP(E9,E7,FA),E7,E4);FC+=E4;FB+=E4}FE+=E9._tree.mod;FC+=E6._tree.mod;FD+=E8._tree.mod;FB+=E5._tree.mod}if(E9&&!y(E5)){E5._tree.thread=E9;E5._tree.mod+=FE-FB}if(E6&&!Ee(E8)){E8._tree.thread=E6;E8._tree.mod+=FC-FD;FA=E7}}return FA}ET(Ez,function(E4,E3){E4._tree={ancestor:E4,prelim:0,mod:0,change:0,shift:0,number:E3?E3._tree.number+1:0}});Ew(Ez);Ey(Ez,-Ez._tree.prelim);var Eu=B4(Ez,Ah),E2=B4(Ez,BT),E1=B4(Ez,W),Et=Eu.x-Ep(Eu,E2)/2,Es=E2.x+Ep(E2,Eu)/2,E0=E1.depth||1;ET(Ez,function(E3){E3.x=(E3.x-Et)/(Es-Et)*Eo[0];E3.y=E3.depth/E0*Eo[1];delete E3._tree});return Er}e.separation=function(Eq){if(!arguments.length){return Ep}Ep=Eq;return e};e.size=function(Eq){if(!arguments.length){return Eo}Eo=Eq;return e};return Di(e,En)};function Bm(En,e){return En.parent==e.parent?1:2}function Ee(En){var e=En.children;return e&&e.length?e[0]:En._tree.thread}function y(En){var e=En.children,Eo;return e&&(Eo=e.length)?e[Eo-1]:En._tree.thread}function B4(Eo,Ep){var En=Eo.children;if(En&&(Eq=En.length)){var Er,Eq,e=-1;while(++e<Eq){if(Ep(Er=B4(En[e],Ep),Eo)>0){Eo=Er}}}return Eo}function BT(En,e){return En.x-e.x}function Ah(En,e){return e.x-En.x}function W(En,e){return En.depth-e.depth}function ET(En,Eo){function e(Et,Es){var Er=Et.children;if(Er&&(Eu=Er.length)){var Ev,Eq=null,Ep=-1,Eu;while(++Ep<Eu){Ev=Er[Ep];e(Ev,Eq);Eq=Ev}}Eo(Et,Es)}e(En,null)}function Bo(Ep){var e=0,Er=0,Eo=Ep.children,En=Eo.length,Eq;while(--En>=0){Eq=Eo[En]._tree;Eq.prelim+=e;Eq.mod+=e;e+=Eq.shift+(Er+=Eq.change)}}function Eg(En,Eo,e){En=En._tree;Eo=Eo._tree;var Ep=e/(Eo.number-En.number);En.change+=Ep;Eo.change-=Ep;Eo.shift+=e;Eo.prelim+=e;Eo.mod+=e}function DP(e,Eo,En){return e._tree.ancestor.parent==Eo.parent?e._tree.ancestor:En}d3.layout.treemap=function(){var Et=d3.layout.hierarchy(),Ex=Math.round,Ez=[1,1],Eu=null,e=Cm,Ev=false,Er,Es=0.5*(1+Math.sqrt(5));function En(E2,E0){var E1=-1,E5=E2.length,E4,E3;while(++E1<E5){E3=(E4=E2[E1]).value*(E0<0?0:E0);E4.area=isNaN(E3)||E3<=0?0:E3}}function Ep(E4){var E1=E4.children;if(E1&&E1.length){var E7=e(E4),E9=[],E6=E1.slice(),E0,E5=Infinity,E3,E8=Math.min(E7.dx,E7.dy),E2;En(E6,E7.dx*E7.dy/E4.value);E9.area=0;while((E2=E6.length)>0){E9.push(E0=E6[E2-1]);E9.area+=E0.area;if((E3=Eo(E9,E8))<=E5){E6.pop();E5=E3}else{E9.area-=E9.pop().area;Eq(E9,E8,E7,false);E8=Math.min(E7.dx,E7.dy);E9.length=E9.area=0;E5=Infinity}}if(E9.length){Eq(E9,E8,E7,true);E9.length=E9.area=0}E1.forEach(Ep)}}function Ey(E3){var E0=E3.children;if(E0&&E0.length){var E2=e(E3),E1=E0.slice(),E5,E4=[];En(E1,E2.dx*E2.dy/E3.value);E4.area=0;while(E5=E1.pop()){E4.push(E5);E4.area+=E5.area;if(E5.z!=null){Eq(E4,E5.z?E2.dx:E2.dy,E2,!E1.length);E4.length=E4.area=0}}E0.forEach(Ey)}}function Eo(E5,E1){var E3=E5.area,E4,E7=0,E0=Infinity,E2=-1,E6=E5.length;while(++E2<E6){if(!(E4=E5[E2].area)){continue}if(E4<E0){E0=E4}if(E4>E7){E7=E4}}E3*=E3;E1*=E1;return E3?Math.max((E1*E7*Es)/E3,E3/(E1*E0*Es)):Infinity}function Eq(E9,E8,E4,E7){var E2=-1,E1=E9.length,E5=E4.x,E3=E4.y,E6=E8?Ex(E9.area/E8):0,E0;if(E8==E4.dx){if(E7||E6>E4.dy){E6=E4.dy}while(++E2<E1){E0=E9[E2];E0.x=E5;E0.y=E3;E0.dy=E6;E5+=E0.dx=Math.min(E4.x+E4.dx-E5,E6?Ex(E0.area/E6):0)}E0.z=true;E0.dx+=E4.x+E4.dx-E5;E4.y+=E6;E4.dy-=E6}else{if(E7||E6>E4.dx){E6=E4.dx}while(++E2<E1){E0=E9[E2];E0.x=E5;E0.y=E3;E0.dx=E6;E3+=E0.dy=Math.min(E4.y+E4.dy-E3,E6?Ex(E0.area/E6):0)}E0.z=false;E0.dy+=E4.y+E4.dy-E3;E4.x+=E6;E4.dx-=E6}}function Ew(E2){var E1=Er||Et(E2),E0=E1[0];E0.x=0;E0.y=0;E0.dx=Ez[0];E0.dy=Ez[1];if(Er){Et.revalue(E0)}En([E0],E0.dx*E0.dy/E0.value);(Er?Ey:Ep)(E0);if(Ev){Er=E1}return E1}Ew.size=function(E0){if(!arguments.length){return Ez}Ez=E0;return Ew};Ew.padding=function(E0){if(!arguments.length){return Eu}function E3(E4){var E5=E0.call(Ew,E4,E4.depth);return E5==null?Cm(E4):AM(E4,typeof E5==="number"?[E5,E5,E5,E5]:E5)}function E2(E4){return AM(E4,E0)}var E1;e=(Eu=E0)==null?Cm:(E1=typeof E0)==="function"?E3:E1==="number"?(E0=[E0,E0,E0,E0],E2):E2;return Ew};Ew.round=function(E0){if(!arguments.length){return Ex!=Number}Ex=E0?Math.round:Number;return Ew};Ew.sticky=function(E0){if(!arguments.length){return Ev}Ev=E0;Er=null;return Ew};Ew.ratio=function(E0){if(!arguments.length){return Es}Es=E0;return Ew};return Di(Ew,Et)};function Cm(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function AM(Ep,Eq){var e=Ep.x+Eq[3],Er=Ep.y+Eq[0],Eo=Ep.dx-Eq[1]-Eq[3],En=Ep.dy-Eq[0]-Eq[2];if(Eo<0){e+=Eo/2;Eo=0}if(En<0){Er+=En/2;En=0}return{x:e,y:Er,dx:Eo,dy:En}}d3.csv=function(e,En){d3.text(e,"text/csv",function(Eo){En(Eo&&d3.csv.parse(Eo))})};d3.csv.parse=function(e){var En;return d3.csv.parseRows(e,function(Es,Eq){if(Eq){var Er={},Ep=-1,Eo=En.length;while(++Ep<Eo){Er[En[Ep]]=Es[Ep]}return Er}else{En=Es;return null}})};d3.csv.parseRows=function(Et,Eq){var En={},Ep={},Ew=[],Eu=/\r\n|[,\r\n]/g,e=0,Ev,Er;Eu.lastIndex=0;function Eo(){if(Eu.lastIndex>=Et.length){return Ep}if(Er){Er=false;return En}var Ey=Eu.lastIndex;if(Et.charCodeAt(Ey)===34){var Ez=Ey;while(Ez++<Et.length){if(Et.charCodeAt(Ez)===34){if(Et.charCodeAt(Ez+1)!==34){break}Ez++}}Eu.lastIndex=Ez+2;var E0=Et.charCodeAt(Ez+1);if(E0===13){Er=true;if(Et.charCodeAt(Ez+2)===10){Eu.lastIndex++}}else{if(E0===10){Er=true}}return Et.substring(Ey+1,Ez).replace(/""/g,'"')}var Ex=Eu.exec(Et);if(Ex){Er=Ex[0].charCodeAt(0)!==44;return Et.substring(Ey,Ex.index)}Eu.lastIndex=Et.length;return Et.substring(Ey)}while((Ev=Eo())!==Ep){var Es=[];while((Ev!==En)&&(Ev!==Ep)){Es.push(Ev);Ev=Eo()}if(Eq&&!(Es=Eq(Es,e++))){continue}Ew.push(Es)}return Ew};d3.csv.format=function(e){return e.map(CC).join("\n")};function CC(e){return e.map(w).join(",")}function w(e){return/[",\n]/.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}d3.geo={};var CT=Math.PI/180;d3.geo.azimuthal=function(){var Er="orthographic",Eu,Ep=200,Eo=[480,250],e,Et,Eq,Es;function En(E6){var Ew=E6[0]*CT-e,E5=E6[1]*CT,E0=Math.cos(Ew),Ev=Math.sin(Ew),Ey=Math.cos(E5),E4=Math.sin(E5),Ex=Er!=="orthographic"?Es*E4+Eq*Ey*E0:null,E1,Ez=Er==="stereographic"?1/(1+Ex):Er==="gnomonic"?1/Ex:Er==="equidistant"?(E1=Math.acos(Ex),E1?E1/Math.sin(E1):0):Er==="equalarea"?Math.sqrt(2/(1+Ex)):1,E3=Ez*Ey*Ev,E2=Ez*(Es*Ey*E0-Eq*E4);return[Ep*E3+Eo[0],Ep*E2+Eo[1]]}En.invert=function(Ey){var Ev=(Ey[0]-Eo[0])/Ep,E1=(Ey[1]-Eo[1])/Ep,Ew=Math.sqrt(Ev*Ev+E1*E1),E0=Er==="stereographic"?2*Math.atan(Ew):Er==="gnomonic"?Math.atan(Ew):Er==="equidistant"?Ew:Er==="equalarea"?2*Math.asin(0.5*Ew):Math.asin(Ew),Ex=Math.sin(E0),Ez=Math.cos(E0);return[(e+Math.atan2(Ev*Ex,Ew*Eq*Ez+E1*Es*Ex))/CT,Math.asin(Ez*Es-(Ew?(E1*Ex*Eq)/Ew:0))/CT]};En.mode=function(Ev){if(!arguments.length){return Er}Er=Ev+"";return En};En.origin=function(Ev){if(!arguments.length){return Eu}Eu=Ev;e=Eu[0]*CT;Et=Eu[1]*CT;Eq=Math.cos(Et);Es=Math.sin(Et);return En};En.scale=function(Ev){if(!arguments.length){return Ep}Ep=+Ev;return En};En.translate=function(Ev){if(!arguments.length){return Eo}Eo=[+Ev[0],+Ev[1]];return En};return En.origin([0,0])};d3.geo.albers=function(){var Eu=[-98,38],Es=[29.5,45.5],Er=1000,Eq=[480,250],Et,Ep,En,Ev;function Eo(Ey){var Ew=Ep*(CT*Ey[0]-Et),Ex=Math.sqrt(En-2*Ep*Math.sin(CT*Ey[1]))/Ep;return[Er*Ex*Math.sin(Ew)+Eq[0],Er*(Ex*Math.cos(Ew)-Ev)+Eq[1]]}Eo.invert=function(Ez){var Ew=(Ez[0]-Eq[0])/Er,E1=(Ez[1]-Eq[1])/Er,E0=Ev+E1,Ex=Math.atan2(Ew,E0),Ey=Math.sqrt(Ew*Ew+E0*E0);return[(Et+Ex/Ep)/CT,Math.asin((En-Ey*Ey*Ep*Ep)/(2*Ep))/CT]};function e(){var Ex=CT*Es[0],Ew=CT*Es[1],E0=CT*Eu[1],Ey=Math.sin(Ex),Ez=Math.cos(Ex);Et=CT*Eu[0];Ep=0.5*(Ey+Math.sin(Ew));En=Ez*Ez+2*Ep*Ey;Ev=Math.sqrt(En-2*Ep*Math.sin(E0))/Ep;return Eo}Eo.origin=function(Ew){if(!arguments.length){return Eu}Eu=[+Ew[0],+Ew[1]];return e()};Eo.parallels=function(Ew){if(!arguments.length){return Es}Es=[+Ew[0],+Ew[1]];return e()};Eo.scale=function(Ew){if(!arguments.length){return Er}Er=+Ew;return Eo};Eo.translate=function(Ew){if(!arguments.length){return Eq}Eq=[+Ew[0],+Ew[1]];return Eo};return e()};d3.geo.albersUsa=function(){var e=d3.geo.albers();var Eq=d3.geo.albers().origin([-160,60]).parallels([55,65]);var Ep=d3.geo.albers().origin([-160,20]).parallels([8,18]);var Eo=d3.geo.albers().origin([-60,10]).parallels([8,18]);function En(Et){var Es=Et[0],Er=Et[1];return(Er>50?Eq:Es<-140?Ep:Er<21?Eo:e)(Et)}En.scale=function(Er){if(!arguments.length){return e.scale()}e.scale(Er);Eq.scale(Er*0.6);Ep.scale(Er);Eo.scale(Er*1.5);return En.translate(e.translate())};En.translate=function(Es){if(!arguments.length){return e.translate()}var Er=e.scale()/1000,Eu=Es[0],Et=Es[1];e.translate(Es);Eq.translate([Eu-400*Er,Et+170*Er]);Ep.translate([Eu-190*Er,Et+200*Er]);Eo.translate([Eu+580*Er,Et+430*Er]);return En};return En.scale(e.scale())};d3.geo.bonne=function(){var Er=200,Eq=[480,250],e,Ep,Eo,En;function Es(Ew){var Et=Ew[0]*CT-e,Ex=Ew[1]*CT-Ep;if(Eo){var Ev=En+Eo-Ex,Eu=Et*Math.cos(Ex)/Ev;Et=Ev*Math.sin(Eu);Ex=Ev*Math.cos(Eu)-En}else{Et*=Math.cos(Ex);Ex*=-1}return[Er*Et+Eq[0],Er*Ex+Eq[1]]}Es.invert=function(Ev){var Et=(Ev[0]-Eq[0])/Er,Ex=(Ev[1]-Eq[1])/Er;if(Eo){var Ew=En+Ex,Eu=Math.sqrt(Et*Et+Ew*Ew);Ex=En+Eo-Eu;Et=e+Eu*Math.atan2(Et,Ew)/Math.cos(Ex)}else{Ex*=-1;Et/=Math.cos(Ex)}return[Et/CT,Ex/CT]};Es.parallel=function(Et){if(!arguments.length){return Eo/CT}En=1/Math.tan(Eo=Et*CT);return Es};Es.origin=function(Et){if(!arguments.length){return[e/CT,Ep/CT]}e=Et[0]*CT;Ep=Et[1]*CT;return Es};Es.scale=function(Et){if(!arguments.length){return Er}Er=+Et;return Es};Es.translate=function(Et){if(!arguments.length){return Eq}Eq=[+Et[0],+Et[1]];return Es};return Es.origin([0,0]).parallel(45)};d3.geo.equirectangular=function(){var Eo=500,En=[480,250];function e(Eq){var Ep=Eq[0]/360,Er=-Eq[1]/360;return[Eo*Ep+En[0],Eo*Er+En[1]]}e.invert=function(Eq){var Ep=(Eq[0]-En[0])/Eo,Er=(Eq[1]-En[1])/Eo;return[360*Ep,-360*Er]};e.scale=function(Ep){if(!arguments.length){return Eo}Eo=+Ep;return e};e.translate=function(Ep){if(!arguments.length){return En}En=[+Ep[0],+Ep[1]];return e};return e};d3.geo.mercator=function(){var Eo=500,En=[480,250];function e(Eq){var Ep=Eq[0]/360,Er=-(Math.log(Math.tan(Math.PI/4+Eq[1]*CT/2))/CT)/360;return[Eo*Ep+En[0],Eo*Math.max(-0.5,Math.min(0.5,Er))+En[1]]}e.invert=function(Eq){var Ep=(Eq[0]-En[0])/Eo,Er=(Eq[1]-En[1])/Eo;return[360*Ep,2*Math.atan(Math.exp(-360*Er*CT))/CT-90]};e.scale=function(Ep){if(!arguments.length){return Eo}Eo=+Ep;return e};e.translate=function(Ep){if(!arguments.length){return En}En=[+Ep[0],+Ep[1]];return e};return e};function DA(En,e){return function(Eo){return Eo&&En.hasOwnProperty(Eo.type)?En[Eo.type](Eo):e}}d3.geo.path=function(){var Es=4.5,Ew=Z(Es),Er=d3.geo.albersUsa();function Ev(Ey,Ex){if(typeof Es==="function"){Ew=Z(Es.apply(this,arguments))}return En(Ey)||null}function Et(Ex){return Er(Ex).join(",")}var En=DA({FeatureCollection:function(E0){var Ez=[],Ey=E0.features,Ex=-1,E1=Ey.length;while(++Ex<E1){Ez.push(En(Ey[Ex].geometry))}return Ez.join("")},Feature:function(Ex){return En(Ex.geometry)},Point:function(Ex){return"M"+Et(Ex.coordinates)+Ew},MultiPoint:function(E0){var Ey=[],Ez=E0.coordinates,Ex=-1,E1=Ez.length;while(++Ex<E1){Ey.push("M",Et(Ez[Ex]),Ew)}return Ey.join("")},LineString:function(E0){var Ey=["M"],Ez=E0.coordinates,Ex=-1,E1=Ez.length;while(++Ex<E1){Ey.push(Et(Ez[Ex]),"L")}Ey.pop();return Ey.join("")},MultiLineString:function(E3){var E1=[],E2=E3.coordinates,E0=-1,E4=E2.length,Ey,Ez,Ex;while(++E0<E4){Ey=E2[E0];Ez=-1;Ex=Ey.length;E1.push("M");while(++Ez<Ex){E1.push(Et(Ey[Ez]),"L")}E1.pop()}return E1.join("")},Polygon:function(E3){var E1=[],E2=E3.coordinates,E0=-1,E4=E2.length,Ey,Ez,Ex;while(++E0<E4){Ey=E2[E0];Ez=-1;if((Ex=Ey.length-1)>0){E1.push("M");while(++Ez<Ex){E1.push(Et(Ey[Ez]),"L")}E1[E1.length-1]="Z"}}return E1.join("")},MultiPolygon:function(Ey){var E7=[],E6=Ey.coordinates,E5=-1,Ez=E6.length,E2,E4,E0,E3,E1,Ex;while(++E5<Ez){E2=E6[E5];E4=-1;E0=E2.length;while(++E4<E0){E3=E2[E4];E1=-1;if((Ex=E3.length-1)>0){E7.push("M");while(++E1<Ex){E7.push(Et(E3[E1]),"L")}E7[E7.length-1]="Z"}}}return E7.join("")},GeometryCollection:function(E0){var Ez=[],Ey=E0.geometries,Ex=-1,E1=Ey.length;while(++Ex<E1){Ez.push(En(Ey[Ex]))}return Ez.join("")}});var Eo=Ev.area=DA({FeatureCollection:function(E0){var Ez=0,Ey=E0.features,Ex=-1,E1=Ey.length;while(++Ex<E1){Ez+=Eo(Ey[Ex])}return Ez},Feature:function(Ex){return Eo(Ex.geometry)},Polygon:function(Ex){return Eq(Ex.coordinates)},MultiPolygon:function(E0){var Ey=0,Ez=E0.coordinates,Ex=-1,E1=Ez.length;while(++Ex<E1){Ey+=Eq(Ez[Ex])}return Ey},GeometryCollection:function(E0){var Ez=0,Ey=E0.geometries,Ex=-1,E1=Ey.length;while(++Ex<E1){Ez+=Eo(Ey[Ex])}return Ez}},0);function Eq(Ez){var Ey=Ep(Ez[0]),Ex=0,E0=Ez.length;while(++Ex<E0){Ey-=Ep(Ez[Ex])}return Ey}function e(E5){var E3=d3.geom.polygon(E5[0].map(Er)),Ex=E3.area(),Ey=E3.centroid(Ex<0?(Ex*=-1,1):-1),E4=Ey[0],E2=Ey[1],E1=Ex,E0=0,Ez=E5.length;while(++E0<Ez){E3=d3.geom.polygon(E5[E0].map(Er));Ex=E3.area();Ey=E3.centroid(Ex<0?(Ex*=-1,1):-1);E4-=Ey[0];E2-=Ey[1];E1-=Ex}return[E4,E2,6*E1]}var Eu=Ev.centroid=DA({Feature:function(Ex){return Eu(Ex.geometry)},Polygon:function(Ey){var Ex=e(Ey.coordinates);return[Ex[0]/Ex[2],Ex[1]/Ex[2]]},MultiPolygon:function(Ey){var Ex=0,E5=Ey.coordinates,Ez,E4=0,E3=0,E2=0,E1=-1,E0=E5.length;while(++E1<E0){Ez=e(E5[E1]);E4+=Ez[0];E3+=Ez[1];E2+=Ez[2]}return[E4/E2,E3/E2]}});function Ep(Ex){return Math.abs(d3.geom.polygon(Ex.map(Er)).area())}Ev.projection=function(Ex){Er=Ex;return Ev};Ev.pointRadius=function(Ex){if(typeof Ex==="function"){Es=Ex}else{Es=+Ex;Ew=Z(Es)}return Ev};return Ev};function Z(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+(-2*e)+"a"+e+","+e+" 0 1,1 0,"+(+2*e)+"z"}d3.geo.bounds=function(Eo){var Eq=Infinity,e=Infinity,En=-Infinity,Ep=-Infinity;Bc(Eo,function(Er,Es){if(Er<Eq){Eq=Er}if(Er>En){En=Er}if(Es<e){e=Es}if(Es>Ep){Ep=Es}});return[[Eq,e],[En,Ep]]};function Bc(En,e){if(Ds.hasOwnProperty(En.type)){Ds[En.type](En,e)}}var Ds={Feature:EX,FeatureCollection:DW,GeometryCollection:Cq,LineString:Db,MultiLineString:Do,MultiPoint:Db,MultiPolygon:EV,Point:EJ,Polygon:BI};function EX(En,e){Bc(En.geometry,e)}function DW(Ep,Eo){for(var e=Ep.features,En=0,Eq=e.length;En<Eq;En++){Bc(e[En].geometry,Eo)}}function Cq(Ep,Eo){for(var e=Ep.geometries,En=0,Eq=e.length;En<Eq;En++){Bc(e[En],Eo)}}function Db(Ep,Eo){for(var e=Ep.coordinates,En=0,Eq=e.length;En<Eq;En++){Eo.apply(null,e[En])}}function Do(Es,Er){for(var Eo=Es.coordinates,Eq=0,Et=Eo.length;Eq<Et;Eq++){for(var En=Eo[Eq],Ep=0,e=En.length;Ep<e;Ep++){Er.apply(null,En[Ep])}}}function EV(Es,Er){for(var Eo=Es.coordinates,Eq=0,Et=Eo.length;Eq<Et;Eq++){for(var En=Eo[Eq][0],Ep=0,e=En.length;Ep<e;Ep++){Er.apply(null,En[Ep])}}}function EJ(En,e){e.apply(null,En.coordinates)}function BI(Ep,Eo){for(var e=Ep.coordinates[0],En=0,Eq=e.length;En<Eq;En++){Eo.apply(null,e[En])}}d3.geo.circle=function(){var Eu=[0,0],Er=90-0.01,Es=Er*CT,Eo=d3.geo.greatArc().target(Object);function En(){}function Ep(Ev){return Eo.distance(Ev)<Es}En.clip=function(Ev){Eo.source(typeof Eu==="function"?Eu.apply(this,arguments):Eu);return Et(Ev)};var Et=DA({FeatureCollection:function(Ew){var Ev=Ew.features.map(Et).filter(Object);return Ev&&(Ew=Object.create(Ew),Ew.features=Ev,Ew)},Feature:function(Ew){var Ev=Et(Ew.geometry);return Ev&&(Ew=Object.create(Ew),Ew.geometry=Ev,Ew)},Point:function(Ev){return Ep(Ev.coordinates)&&Ev},MultiPoint:function(Ew){var Ev=Ew.coordinates.filter(Ep);return Ev.length&&{type:Ew.type,coordinates:Ev}},LineString:function(Ew){var Ev=Eq(Ew.coordinates);return Ev.length&&(Ew=Object.create(Ew),Ew.coordinates=Ev,Ew)},MultiLineString:function(Ew){var Ev=Ew.coordinates.map(Eq).filter(function(Ex){return Ex.length});return Ev.length&&(Ew=Object.create(Ew),Ew.coordinates=Ev,Ew)},Polygon:function(Ew){var Ev=Ew.coordinates.map(Eq);return Ev[0].length&&(Ew=Object.create(Ew),Ew.coordinates=Ev,Ew)},MultiPolygon:function(Ew){var Ev=Ew.coordinates.map(function(Ex){return Ex.map(Eq)}).filter(function(Ex){return Ex[0].length});return Ev.length&&(Ew=Object.create(Ew),Ew.coordinates=Ev,Ew)},GeometryCollection:function(Ew){var Ev=Ew.geometries.map(Et).filter(Object);return Ev.length&&(Ew=Object.create(Ew),Ew.geometries=Ev,Ew)}});function Eq(E0){var Ez=-1,Ex=E0.length,Ey=[],E3,E2,E1,Ew,Ev;while(++Ez<Ex){Ev=Eo.distance(E1=E0[Ez]);if(Ev<Es){if(E2){Ey.push(Em(E2,E1)((Ew-Es)/(Ew-Ev)))}Ey.push(E1);E3=E2=null}else{E2=E1;if(!E3&&Ey.length){Ey.push(Em(Ey[Ey.length-1],E2)((Es-Ew)/(Ev-Ew)));E3=E2}}Ew=Ev}if(E2&&Ey.length){Ev=Eo.distance(E1=Ey[0]);Ey.push(Em(E2,E1)((Ew-Es)/(Ew-Ev)))}return e(Ey)}function e(E1){var Ez=0,E2=E1.length,Ey,Ev,Ew=E2?[E1[0]]:E1,E0,Ex=Eo.source();while(++Ez<E2){E0=Eo.source(E1[Ez-1])(E1[Ez]).coordinates;for(Ey=0,Ev=E0.length;++Ey<Ev;){Ew.push(E0[Ey])}}Eo.source(Ex);return Ew}En.origin=function(Ev){if(!arguments.length){return Eu}Eu=Ev;return En};En.angle=function(Ev){if(!arguments.length){return Er}Es=(Er=+Ev)*CT;return En};En.precision=function(Ev){if(!arguments.length){return Eo.precision()}Eo.precision(Ev);return En};return En};d3.geo.greatArc=function(){var Eo=BZ,Ep=Be,En=6*CT;function e(){var Er=typeof Eo==="function"?Eo.apply(this,arguments):Eo,Eq=typeof Ep==="function"?Ep.apply(this,arguments):Ep,Et=Em(Er,Eq),Eu=En/Et.d,Es=0,Ev=[Er];while((Es+=Eu)<1){Ev.push(Et(Es))}Ev.push(Eq);return{type:"LineString",coordinates:Ev}}e.distance=function(){var Er=typeof Eo==="function"?Eo.apply(this,arguments):Eo,Eq=typeof Ep==="function"?Ep.apply(this,arguments):Ep;return Em(Er,Eq).d};e.source=function(Eq){if(!arguments.length){return Eo}Eo=Eq;return e};e.target=function(Eq){if(!arguments.length){return Ep}Ep=Eq;return e};e.precision=function(Eq){if(!arguments.length){return En/CT}En=Eq*CT;return e};return e};function BZ(e){return e.source}function Be(e){return e.target}function Em(E0,Ex){var Ep=E0[0]*CT,Ew=Math.cos(Ep),Eo=Math.sin(Ep),E2=E0[1]*CT,Er=Math.cos(E2),E1=Math.sin(E2),En=Ex[0]*CT,Ev=Math.cos(En),e=Math.sin(En),Ez=Ex[1]*CT,Eq=Math.cos(Ez),Ey=Math.sin(Ez),Eu=Es.d=Math.acos(Math.max(-1,Math.min(1,E1*Ey+Er*Eq*Math.cos(En-Ep)))),Et=Math.sin(Eu);function Es(E5){var E4=Math.sin(Eu-(E5*=Eu))/Et,E8=Math.sin(E5)/Et,E3=E4*Er*Ew+E8*Eq*Ev,E7=E4*Er*Eo+E8*Eq*e,E6=E4*E1+E8*Ey;return[Math.atan2(E7,E3)/CT,Math.atan2(E6,Math.sqrt(E3*E3+E7*E7))/CT]}return Es}d3.geo.greatCircle=d3.geo.circle;d3.geom={};d3.geom.contour=function(e,En){var Ev=En||K(e),Er=[],Et=Ev[0],Es=Ev[1],Ew=0,Eu=0,Ep=NaN,Eo=NaN,Eq=0;do{Eq=0;if(e(Et-1,Es-1)){Eq+=1}if(e(Et,Es-1)){Eq+=2}if(e(Et-1,Es)){Eq+=4}if(e(Et,Es)){Eq+=8}if(Eq===6){Ew=Eo===-1?-1:1;Eu=0}else{if(Eq===9){Ew=0;Eu=Ep===1?-1:1}else{Ew=BX[Eq];Eu=BV[Eq]}}if(Ew!=Ep&&Eu!=Eo){Er.push([Et,Es]);Ep=Ew;Eo=Eu}Et+=Ew;Es+=Eu}while(Ev[0]!=Et||Ev[1]!=Es);return Er};var BX=[1,0,1,1,-1,0,-1,1,0,0,0,0,-1,0,-1,NaN],BV=[0,-1,0,0,0,-1,0,0,1,-1,1,1,0,-1,0,NaN];function K(En){var e=0,Eo=0;while(true){if(En(e,Eo)){return[e,Eo]}if(e===0){e=Eo+1;Eo=0}else{e=e-1;Eo=Eo+1}}}d3.geom.hull=function(Ev){if(Ev.length<3){return[]}var Eu=Ev.length,Eq=Eu-1,E1=[],Ex=[],Es,Er,Et=0,Ep,Ez,En,Ew,E2,E0,Ey,Eo;for(Es=1;Es<Eu;++Es){if(Ev[Es][1]<Ev[Et][1]){Et=Es}else{if(Ev[Es][1]==Ev[Et][1]){Et=(Ev[Es][0]<Ev[Et][0]?Es:Et)}}}for(Es=0;Es<Eu;++Es){if(Es===Et){continue}Ez=Ev[Es][1]-Ev[Et][1];Ep=Ev[Es][0]-Ev[Et][0];E1.push({angle:Math.atan2(Ez,Ep),index:Es})}E1.sort(function(E4,E3){return E4.angle-E3.angle});Ey=E1[0].angle;E0=E1[0].index;E2=0;for(Es=1;Es<Eq;++Es){Er=E1[Es].index;if(Ey==E1[Es].angle){Ep=Ev[E0][0]-Ev[Et][0];Ez=Ev[E0][1]-Ev[Et][1];En=Ev[Er][0]-Ev[Et][0];Ew=Ev[Er][1]-Ev[Et][1];if((Ep*Ep+Ez*Ez)>=(En*En+Ew*Ew)){E1[Es].index=-1}else{E1[E2].index=-1;Ey=E1[Es].angle;E2=Es;E0=Er}}else{Ey=E1[Es].angle;E2=Es;E0=Er}}Ex.push(Et);for(Es=0,Er=0;Es<2;++Er){if(E1[Er].index!==-1){Ex.push(E1[Er].index);Es++}}Eo=Ex.length;for(;Er<Eq;++Er){if(E1[Er].index===-1){continue}while(!Bs(Ex[Eo-2],Ex[Eo-1],E1[Er].index,Ev)){--Eo}Ex[Eo++]=E1[Er].index}var e=[];for(Es=0;Es<Eo;++Es){e.push(Ev[Ex[Es]])}return e};function Bs(Ep,Eo,En,Ew){var Ex,Ev,Eu,Et,Es,Er,Eq;Ex=Ew[Ep];Ev=Ex[0];Eu=Ex[1];Ex=Ew[Eo];Et=Ex[0];Es=Ex[1];Ex=Ew[En];Er=Ex[0];Eq=Ex[1];return((Eq-Eu)*(Et-Ev)-(Es-Eu)*(Er-Ev))>0}d3.geom.polygon=function(e){e.area=function(){var Ep=0,Eq=e.length,Eo=e[Eq-1][0]*e[0][1],En=e[Eq-1][1]*e[0][0];while(++Ep<Eq){Eo+=e[Ep-1][0]*e[Ep][1];En+=e[Ep-1][1]*e[Ep][0]}return(En-Eo)*0.5};e.centroid=function(Eq){var Er=-1,Eu=e.length,Eo=0,Et=0,Ep,En=e[Eu-1],Es;if(!arguments.length){Eq=-1/(6*e.area())}while(++Er<Eu){Ep=En;En=e[Er];Es=Ep[0]*En[1]-En[0]*Ep[1];Eo+=(Ep[0]+En[0])*Es;Et+=(Ep[1]+En[1])*Es}return[Eo*Eq,Et*Eq]};e.clip=function(Et){var Ev,Eq=-1,En=e.length,Ep,Eo,Ew=e[En-1],Eu,Es,Er;while(++Eq<En){Ev=Et.slice();Et.length=0;Eu=e[Eq];Es=Ev[(Eo=Ev.length)-1];Ep=-1;while(++Ep<Eo){Er=Ev[Ep];if(T(Er,Ew,Eu)){if(!T(Es,Ew,Eu)){Et.push(De(Es,Er,Ew,Eu))}Et.push(Er)}else{if(T(Es,Ew,Eu)){Et.push(De(Es,Er,Ew,Eu))}}Es=Er}Ew=Eu}return Et};return e};function T(Eo,En,e){return(e[0]-En[0])*(Eo[1]-En[1])<(e[1]-En[1])*(Eo[0]-En[0])}function De(Ez,Ey,E2,E1){var Ex=Ez[0],Ew=Ey[0],Ev=E2[0],Et=E1[0],Ep=Ez[1],Eo=Ey[1],En=E2[1],e=E1[1],E3=Ex-Ev,Eq=Ew-Ex,E4=Et-Ev,Er=Ep-En,E0=Eo-Ep,Es=e-En,Eu=(E4*Er-Es*E3)/(Es*Eq-E4*E0);return[Ex+Eu*Eq,Ep+Eu*E0]}d3.geom.voronoi=function(En){var e=En.map(function(){return[]});Dy(En,function(Eq){var Ew,Ev,Ep,Eo,Et,Er;if(Eq.a===1&&Eq.b>=0){Ew=Eq.ep.r;Ev=Eq.ep.l}else{Ew=Eq.ep.l;Ev=Eq.ep.r}if(Eq.a===1){Et=Ew?Ew.y:-1000000;Ep=Eq.c-Eq.b*Et;Er=Ev?Ev.y:1000000;Eo=Eq.c-Eq.b*Er}else{Ep=Ew?Ew.x:-1000000;Et=Eq.c-Eq.a*Ep;Eo=Ev?Ev.x:1000000;Er=Eq.c-Eq.a*Eo}var Eu=[Ep,Et],Es=[Eo,Er];e[Eq.region.l.index].push(Eu,Es);e[Eq.region.r.index].push(Eu,Es)});return e.map(function(Eq,Ep){var Eo=En[Ep][0],Er=En[Ep][1];Eq.forEach(function(Es){Es.angle=Math.atan2(Es[0]-Eo,Es[1]-Er)});return Eq.sort(function(Et,Es){return Et.angle-Es.angle}).filter(function(Et,Es){return !Es||(Et.angle-Eq[Es-1].angle>1e-10)})})};var Bk={l:"r",r:"l"};function Dy(Er,Ep){var E5={list:Er.map(function(e,E7){return{index:E7,x:e[0],y:e[1]}}).sort(function(E7,e){return E7.y<e.y?-1:E7.y>e.y?1:E7.x<e.x?-1:E7.x>e.x?1:0}),bottomSite:null};var Eo={list:[],leftEnd:null,rightEnd:null,init:function(){Eo.leftEnd=Eo.createHalfEdge(null,"l");Eo.rightEnd=Eo.createHalfEdge(null,"l");Eo.leftEnd.r=Eo.rightEnd;Eo.rightEnd.l=Eo.leftEnd;Eo.list.unshift(Eo.leftEnd,Eo.rightEnd)},createHalfEdge:function(E7,e){return{edge:E7,side:e,vertex:null,l:null,r:null}},insert:function(E7,e){e.l=E7;e.r=E7.r;E7.r.l=e;E7.r=e},leftBound:function(E7){var e=Eo.leftEnd;do{e=e.r}while(e!=Eo.rightEnd&&E4.rightOf(e,E7));e=e.l;return e},del:function(e){e.l.r=e.r;e.r.l=e.l;e.edge=null},right:function(e){return e.r},left:function(e){return e.l},leftRegion:function(e){return e.edge==null?E5.bottomSite:e.edge.region[e.side]},rightRegion:function(e){return e.edge==null?E5.bottomSite:e.edge.region[Bk[e.side]]}};var E4={bisect:function(FA,E8){var E9={region:{l:FA,r:E8},ep:{l:null,r:null}};var E7=E8.x-FA.x,e=E8.y-FA.y,FC=E7>0?E7:-E7,FB=e>0?e:-e;E9.c=FA.x*E7+FA.y*e+(E7*E7+e*e)*0.5;if(FC>FB){E9.a=1;E9.b=e/E7;E9.c/=E7}else{E9.b=1;E9.a=E7/e;E9.c/=e}return E9},intersect:function(FA,E9){var FF=FA.edge,FE=E9.edge;if(!FF||!FE||(FF.region.r==FE.region.r)){return null}var FD=(FF.a*FE.b)-(FF.b*FE.a);if(Math.abs(FD)<1e-10){return null}var E8=(FF.c*FE.b-FE.c*FF.b)/FD,FI=(FE.c*FF.a-FF.c*FE.a)/FD,FH=FF.region.r,FC=FE.region.r,E7,FB;if((FH.y<FC.y)||(FH.y==FC.y&&FH.x<FC.x)){E7=FA;FB=FF}else{E7=E9;FB=FE}var FG=(E8>=FB.region.r.x);if((FG&&(E7.side==="l"))||(!FG&&(E7.side==="r"))){return null}return{x:E8,y:FI}},rightOf:function(FC,E7){var FG=FC.edge,FA=FG.region.r,FJ=(E7.x>FA.x);if(FJ&&(FC.side==="l")){return 1}if(!FJ&&(FC.side==="r")){return 0}if(FG.a===1){var FI=E7.y-FA.y,E8=E7.x-FA.x,FD=0,FH=0;if((!FJ&&(FG.b<0))||(FJ&&(FG.b>=0))){FH=FD=(FI>=FG.b*E8)}else{FH=((E7.x+E7.y*FG.b)>FG.c);if(FG.b<0){FH=!FH}if(!FH){FD=1}}if(!FD){var FK=FA.x-FG.region.l.x;FH=(FG.b*(E8*E8-FI*FI))<(FK*FI*(1+2*E8/FK+FG.b*FG.b));if(FG.b<0){FH=!FH}}}else{var E9=FG.c-FG.a*E7.x,FF=E7.y-E9,FE=E7.x-FA.x,FB=E9-FA.y;FH=(FF*FF)>(FE*FE+FB*FB)}return FC.side==="l"?FH:!FH},endPoint:function(E8,E7,e){E8.ep[E7]=e;if(!E8.ep[Bk[E7]]){return}Ep(E8)},distance:function(E9,E8){var E7=E9.x-E8.x,e=E9.y-E8.y;return Math.sqrt(E7*E7+e*e)}};var En={list:[],insert:function(FB,E7,FC){FB.vertex=E7;FB.ystar=E7.y+FC;for(var E8=0,FA=En.list,e=FA.length;E8<e;E8++){var E9=FA[E8];if(FB.ystar>E9.ystar||(FB.ystar==E9.ystar&&E7.x>E9.vertex.x)){continue}else{break}}FA.splice(E8,0,FB)},del:function(E9){for(var E8=0,E7=En.list,e=E7.length;E8<e&&(E7[E8]!=E9);++E8){}E7.splice(E8,1)},empty:function(){return En.list.length===0},nextEvent:function(E9){for(var E8=0,E7=En.list,e=E7.length;E8<e;++E8){if(E7[E8]==E9){return E7[E8+1]}}return null},min:function(){var e=En.list[0];return{x:e.vertex.x,y:e.ystar}},extractMin:function(){return En.list.shift()}};Eo.init();E5.bottomSite=E5.list.shift();var E6=E5.list.shift(),Et;var Ey,Ev,Eq,E2,Es;var Ew,Ex,E3,Ez,Eu;var E1,E0;while(true){if(!En.empty()){Et=En.min()}if(E6&&(En.empty()||E6.y<Et.y||(E6.y==Et.y&&E6.x<Et.x))){Ey=Eo.leftBound(E6);Ev=Eo.right(Ey);Ew=Eo.rightRegion(Ey);E1=E4.bisect(Ew,E6);Es=Eo.createHalfEdge(E1,"l");Eo.insert(Ey,Es);Ez=E4.intersect(Ey,Es);if(Ez){En.del(Ey);En.insert(Ey,Ez,E4.distance(Ez,E6))}Ey=Es;Es=Eo.createHalfEdge(E1,"r");Eo.insert(Ey,Es);Ez=E4.intersect(Es,Ev);if(Ez){En.insert(Es,Ez,E4.distance(Ez,E6))}E6=E5.list.shift()}else{if(!En.empty()){Ey=En.extractMin();Eq=Eo.left(Ey);Ev=Eo.right(Ey);E2=Eo.right(Ev);Ew=Eo.leftRegion(Ey);Ex=Eo.rightRegion(Ev);Eu=Ey.vertex;E4.endPoint(Ey.edge,Ey.side,Eu);E4.endPoint(Ev.edge,Ev.side,Eu);Eo.del(Ey);En.del(Ev);Eo.del(Ev);E0="l";if(Ew.y>Ex.y){E3=Ew;Ew=Ex;Ex=E3;E0="r"}E1=E4.bisect(Ew,Ex);Es=Eo.createHalfEdge(E1,E0);Eo.insert(Eq,Es);E4.endPoint(E1,Bk[E0],Eu);Ez=E4.intersect(Eq,Es);if(Ez){En.del(Eq);En.insert(Eq,Ez,E4.distance(Ez,Ew))}Ez=E4.intersect(Es,E2);if(Ez){En.insert(Es,Ez,E4.distance(Ez,Ew))}}else{break}}}for(Ey=Eo.right(Eo.leftEnd);Ey!=Eo.rightEnd;Ey=Eo.right(Ey)){Ep(Ey.edge)}}d3.geom.delaunay=function(En){var e=En.map(function(){return[]}),Eo=[];Dy(En,function(Ep){e[Ep.region.l.index].push(En[Ep.region.r.index])});e.forEach(function(Eu,Et){var Er=En[Et],Eq=Er[0],Ev=Er[1];Eu.forEach(function(Ew){Ew.angle=Math.atan2(Ew[0]-Eq,Ew[1]-Ev)});Eu.sort(function(Ex,Ew){return Ex.angle-Ew.angle});for(var Es=0,Ep=Eu.length-1;Es<Ep;Es++){Eo.push([Er,Eu[Es],Eu[Es+1]])}});return Eo};d3.geom.quadtree=function(Ev,Eo,Eu,e,Et){var En,Eq=-1,Ep=Ev.length;if(Ep&&isNaN(Ev[0].x)){Ev=Ev.map(h)}if(arguments.length<5){if(arguments.length===3){Et=e=Eu;Eu=Eo}else{Eo=Eu=Infinity;e=Et=-Infinity;while(++Eq<Ep){En=Ev[Eq];if(En.x<Eo){Eo=En.x}if(En.y<Eu){Eu=En.y}if(En.x>e){e=En.x}if(En.y>Et){Et=En.y}}var Ey=e-Eo,Ex=Et-Eu;if(Ey>Ex){Et=Eu+Ey}else{e=Eo+Ex}}}function Ew(E5,E4,E1,E3,E0,E2){if(isNaN(E4.x)||isNaN(E4.y)){return}if(E5.leaf){var Ez=E5.point;if(Ez){if((Math.abs(Ez.x-E4.x)+Math.abs(Ez.y-E4.y))<0.01){Er(E5,E4,E1,E3,E0,E2)}else{E5.point=null;Er(E5,Ez,E1,E3,E0,E2);Er(E5,E4,E1,E3,E0,E2)}}else{E5.point=E4}}else{Er(E5,E4,E1,E3,E0,E2)}}function Er(E3,E1,E2,E8,E0,E6){var E7=(E2+E0)*0.5,E5=(E8+E6)*0.5,E9=E1.x>=E7,Ez=E1.y>=E5,E4=(Ez<<1)+E9;E3.leaf=false;E3=E3.nodes[E4]||(E3.nodes[E4]=DH());if(E9){E2=E7}else{E0=E7}if(Ez){E8=E5}else{E6=E5}Ew(E3,E1,E2,E8,E0,E6)}var Es=DH();Es.add=function(Ez){Ew(Es,Ez,Eo,Eu,e,Et)};Es.visit=function(Ez){BK(Ez,Es,Eo,Eu,e,Et)};Ev.forEach(Es.add);return Es};function DH(){return{leaf:true,nodes:[],point:null}}function BK(Eq,Ep,En,Eu,e,Es){if(!Eq(Ep,En,Eu,e,Es)){var Et=(En+e)*0.5,Er=(Eu+Es)*0.5,Eo=Ep.nodes;if(Eo[0]){BK(Eq,Eo[0],En,Eu,Et,Er)}if(Eo[1]){BK(Eq,Eo[1],Et,Eu,e,Er)}if(Eo[2]){BK(Eq,Eo[2],En,Er,Et,Es)}if(Eo[3]){BK(Eq,Eo[3],Et,Er,e,Es)}}}function h(e){return{x:e[0],y:e[1]}}d3.time={};var DG=Date;function D8(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}D8.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){DR.setUTCDate.apply(this._,arguments)},setDay:function(){DR.setUTCDay.apply(this._,arguments)},setFullYear:function(){DR.setUTCFullYear.apply(this._,arguments)},setHours:function(){DR.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){DR.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){DR.setUTCMinutes.apply(this._,arguments)},setMonth:function(){DR.setUTCMonth.apply(this._,arguments)},setSeconds:function(){DR.setUTCSeconds.apply(this._,arguments)},setTime:function(){DR.setTime.apply(this._,arguments)}};var DR=Date.prototype;d3.time.format=function(e){var Eo=e.length;function En(Er){var Eq=[],Es=-1,Ep=0,Eu,Et;while(++Es<Eo){if(e.charCodeAt(Es)==37){Eq.push(e.substring(Ep,Es),(Et=Dl[Eu=e.charAt(++Es)])?Et(Er):Eu);Ep=Es+1}}Eq.push(e.substring(Ep,Es));return Eq.join("")}En.parse=function(Eq){var Es={y:1900,m:0,d:1,H:0,M:0,S:0,L:0},Er=B8(Es,e,Eq,0);if(Er!=Eq.length){return null}if("p" in Es){Es.H=Es.H%12+Es.p*12}var Ep=new DG();Ep.setFullYear(Es.y,Es.m,Es.d);Ep.setHours(Es.H,Es.M,Es.S,Es.L);return Ep};En.toString=function(){return e};return En};function B8(Ep,Eu,Es,Eq){var Et,e,Er=0,En=Eu.length,Eo=Es.length;while(Er<En){if(Eq>=Eo){return -1}Et=Eu.charCodeAt(Er++);if(Et==37){e=Eb[Eu.charAt(Er++)];if(!e||((Eq=e(Ep,Es,Eq))<0)){return -1}}else{if(Et!=Es.charCodeAt(Eq++)){return -1}}}return Eq}var Ak=d3.format("02d"),Aj=d3.format("03d"),Ai=d3.format("04d"),Ag=d3.format("2d");var Dl={a:function(e){return d3_time_weekdays[e.getDay()].substring(0,3)},A:function(e){return d3_time_weekdays[e.getDay()]},b:function(e){return A5[e.getMonth()].substring(0,3)},B:function(e){return A5[e.getMonth()]},c:d3.time.format("%a %b %e %H:%M:%S %Y"),d:function(e){return Ak(e.getDate())},e:function(e){return Ag(e.getDate())},H:function(e){return Ak(e.getHours())},I:function(e){return Ak(e.getHours()%12||12)},j:function(e){return Aj(1+d3.time.dayOfYear(e))},L:function(e){return Aj(e.getMilliseconds())},m:function(e){return Ak(e.getMonth()+1)},M:function(e){return Ak(e.getMinutes())},p:function(e){return e.getHours()>=12?"PM":"AM"},S:function(e){return Ak(e.getSeconds())},U:function(e){return Ak(d3.time.sundayOfYear(e))},w:function(e){return e.getDay()},W:function(e){return Ak(d3.time.mondayOfYear(e))},x:d3.time.format("%m/%d/%y"),X:d3.time.format("%H:%M:%S"),y:function(e){return Ak(e.getFullYear()%100)},Y:function(e){return Ai(e.getFullYear()%10000)},Z:DO,"%":function(e){return"%"}};var Eb={a:D7,A:BG,b:AN,B:Cd,c:CK,d:Av,e:Av,H:AF,I:AF,L:D3,m:Du,M:BQ,p:ES,S:B0,x:El,X:Dr,y:c,Y:Ae};function D7(En,e,Eo){return Cw.test(e.substring(Eo,Eo+=3))?Eo:-1}function BG(En,e,Eo){Aq.lastIndex=0;var Ep=Aq.exec(e.substring(Eo,Eo+10));return Ep?Eo+=Ep[0].length:-1}var Cw=/^(?:sun|mon|tue|wed|thu|fri|sat)/i,Aq=/^(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)/i;d3_time_weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function AN(En,e,Eo){var Ep=Ch.get(e.substring(Eo,Eo+=3).toLowerCase());return Ep==null?-1:(En.m=Ep,Eo)}var Ch=d3.map({jan:0,feb:1,mar:2,apr:3,may:4,jun:5,jul:6,aug:7,sep:8,oct:9,nov:10,dec:11});function Cd(En,e,Eo){EA.lastIndex=0;var Ep=EA.exec(e.substring(Eo,Eo+12));return Ep?(En.m=C8.get(Ep[0].toLowerCase()),Eo+=Ep[0].length):-1}var EA=/^(?:January|February|March|April|May|June|July|August|September|October|November|December)/ig;var C8=d3.map({january:0,february:1,march:2,april:3,may:4,june:5,july:6,august:7,september:8,october:9,november:10,december:11});var A5=["January","February","March","April","May","June","July","August","September","October","November","December"];function CK(En,e,Eo){return B8(En,Dl.c.toString(),e,Eo)}function El(En,e,Eo){return B8(En,Dl.x.toString(),e,Eo)}function Dr(En,e,Eo){return B8(En,Dl.X.toString(),e,Eo)}function Ae(En,e,Eo){DS.lastIndex=0;var Ep=DS.exec(e.substring(Eo,Eo+4));return Ep?(En.y=+Ep[0],Eo+=Ep[0].length):-1}function c(En,e,Eo){DS.lastIndex=0;var Ep=DS.exec(e.substring(Eo,Eo+2));return Ep?(En.y=Ab()+ +Ep[0],Eo+=Ep[0].length):-1}function Ab(){return ~~(new Date().getFullYear()/1000)*1000}function Du(En,e,Eo){DS.lastIndex=0;var Ep=DS.exec(e.substring(Eo,Eo+2));return Ep?(En.m=Ep[0]-1,Eo+=Ep[0].length):-1}function Av(En,e,Eo){DS.lastIndex=0;var Ep=DS.exec(e.substring(Eo,Eo+2));return Ep?(En.d=+Ep[0],Eo+=Ep[0].length):-1}function AF(En,e,Eo){DS.lastIndex=0;var Ep=DS.exec(e.substring(Eo,Eo+2));return Ep?(En.H=+Ep[0],Eo+=Ep[0].length):-1}function BQ(En,e,Eo){DS.lastIndex=0;var Ep=DS.exec(e.substring(Eo,Eo+2));return Ep?(En.M=+Ep[0],Eo+=Ep[0].length):-1}function B0(En,e,Eo){DS.lastIndex=0;var Ep=DS.exec(e.substring(Eo,Eo+2));return Ep?(En.S=+Ep[0],Eo+=Ep[0].length):-1}function D3(En,e,Eo){DS.lastIndex=0;var Ep=DS.exec(e.substring(Eo,Eo+3));return Ep?(En.L=+Ep[0],Eo+=Ep[0].length):-1}var DS=/\s*\d+/;function ES(En,e,Eo){var Ep=C.get(e.substring(Eo,Eo+=2).toLowerCase());return Ep==null?-1:(En.p=Ep,Eo)}var C=d3.map({am:0,pm:1});function DO(Eq){var Ep=Eq.getTimezoneOffset(),Eo=Ep>0?"-":"+",En=~~(Math.abs(Ep)/60),e=Math.abs(Ep)%60;return Eo+Ak(En)+Ak(e)}d3.time.format.utc=function(En){var e=d3.time.format(En);function Eo(Ep){try{DG=D8;var Eq=new DG();Eq._=Ep;return e(Eq)}finally{DG=Date}}Eo.parse=function(Eq){try{DG=D8;var Ep=e.parse(Eq);return Ep&&Ep._}finally{DG=Date}};Eo.toString=e.toString;return Eo};var Bw=d3.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ");d3.time.format.iso=Date.prototype.toISOString?Bl:Bw;function Bl(e){return e.toISOString()}Bl.parse=function(e){return new Date(e)};Bl.toString=Bw.toString;function BS(Er,e,En){function Eu(Ev){var Ex=Er(Ev),Ew=Ep(Ex,1);return Ev-Ex<Ew-Ev?Ex:Ew}function Et(Ev){e(Ev=Er(new DG(Ev-1)),1);return Ev}function Ep(Ew,Ev){e(Ew=new DG(+Ew),Ev);return Ew}function Eq(Ex,Ew,Ev){var Ey=Et(Ex),Ez=[];if(Ev>1){while(Ey<Ew){if(!(En(Ey)%Ev)){Ez.push(new Date(+Ey))}e(Ey,1)}}else{while(Ey<Ew){Ez.push(new Date(+Ey)),e(Ey,1)}}return Ez}function Eo(Ey,Ex,Ew){try{DG=D8;var Ev=new D8();Ev._=Ey;return Eq(Ev,Ex,Ew)}finally{DG=Date}}Er.floor=Er;Er.round=Eu;Er.ceil=Et;Er.offset=Ep;Er.range=Eq;var Es=Er.utc=By(Er);Es.floor=Es;Es.round=By(Eu);Es.ceil=By(Et);Es.offset=By(Ep);Es.range=Eo;return Er}function By(e){return function(Eo,En){try{DG=D8;var Ep=new D8();Ep._=Eo;return e(Ep,En)._}finally{DG=Date}}}d3.time.second=BS(function(e){return new DG(Math.floor(e/1000)*1000)},function(e,En){e.setTime(e.getTime()+Math.floor(En)*1000)},function(e){return e.getSeconds()});d3.time.seconds=d3.time.second.range;d3.time.seconds.utc=d3.time.second.utc.range;d3.time.minute=BS(function(e){return new DG(Math.floor(e/60000)*60000)},function(e,En){e.setTime(e.getTime()+Math.floor(En)*60000)},function(e){return e.getMinutes()});d3.time.minutes=d3.time.minute.range;d3.time.minutes.utc=d3.time.minute.utc.range;d3.time.hour=BS(function(e){var En=e.getTimezoneOffset()/60;return new DG((Math.floor(e/3600000-En)+En)*3600000)},function(e,En){e.setTime(e.getTime()+Math.floor(En)*3600000)},function(e){return e.getHours()});d3.time.hours=d3.time.hour.range;d3.time.hours.utc=d3.time.hour.utc.range;d3.time.day=BS(function(e){return new DG(e.getFullYear(),e.getMonth(),e.getDate())},function(e,En){e.setDate(e.getDate()+En)},function(e){return e.getDate()-1});d3.time.days=d3.time.day.range;d3.time.days.utc=d3.time.day.utc.range;d3.time.dayOfYear=function(e){var En=d3.time.year(e);return Math.floor((e-En)/86400000-(e.getTimezoneOffset()-En.getTimezoneOffset())/1440)};d3_time_weekdays.forEach(function(En,Eo){En=En.toLowerCase();Eo=7-Eo;var e=d3.time[En]=BS(function(Ep){(Ep=d3.time.day(Ep)).setDate(Ep.getDate()-(Ep.getDay()+Eo)%7);return Ep},function(Ep,Eq){Ep.setDate(Ep.getDate()+Math.floor(Eq)*7)},function(Eq){var Ep=d3.time.year(Eq).getDay();return Math.floor((d3.time.dayOfYear(Eq)+(Ep+Eo)%7)/7)-(Ep!==Eo)});d3.time[En+"s"]=e.range;d3.time[En+"s"].utc=e.utc.range;d3.time[En+"OfYear"]=function(Eq){var Ep=d3.time.year(Eq).getDay();return Math.floor((d3.time.dayOfYear(Eq)+(Ep+Eo)%7)/7)}});d3.time.week=d3.time.sunday;d3.time.weeks=d3.time.sunday.range;d3.time.weeks.utc=d3.time.sunday.utc.range;d3.time.weekOfYear=d3.time.sundayOfYear;d3.time.month=BS(function(e){return new DG(e.getFullYear(),e.getMonth(),1)},function(e,En){e.setMonth(e.getMonth()+En)},function(e){return e.getMonth()});d3.time.months=d3.time.month.range;d3.time.months.utc=d3.time.month.utc.range;d3.time.year=BS(function(e){return new DG(e.getFullYear(),0,1)},function(e,En){e.setFullYear(e.getFullYear()+En)},function(e){return e.getFullYear()});d3.time.years=d3.time.year.range;d3.time.years.utc=d3.time.year.utc.range;function Aa(e,En,Eo){function Ep(Eq){return e(Eq)}Ep.invert=function(Eq){return DQ(e.invert(Eq))};Ep.domain=function(Eq){if(!arguments.length){return e.domain().map(DQ)}e.domain(Eq);return Ep};Ep.nice=function(Eq){var Er=DL(Ep.domain());return Ep.domain([Eq.floor(Er[0]),Eq.ceil(Er[1])])};Ep.ticks=function(Eq,Er){var Eu=DL(Ep.domain());if(typeof Eq!=="function"){var Et=Eu[1]-Eu[0],Ev=Et/Eq,Es=d3.bisect(Cp,Ev);if(Es==Cp.length){return En.year(Eu,Eq)}if(!Es){return e.ticks(Eq).map(DQ)}if(Math.log(Ev/Cp[Es-1])<Math.log(Cp[Es]/Ev)){--Es}Eq=En[Es];Er=Eq[1];Eq=Eq[0].range}return Eq(Eu[0],new Date(+Eu[1]+1),Er)};Ep.tickFormat=function(){return Eo};Ep.copy=function(){return Aa(e.copy(),En,Eo)};return d3.rebind(Ep,e,"range","rangeRound","interpolate","clamp")}function DL(En){var Eo=En[0],e=En[En.length-1];return Eo<e?[Eo,e]:[e,Eo]}function DQ(e){return new Date(e)}function BP(e){return function(En){var Eo=e.length-1,Ep=e[Eo];while(!Ep[1](En)){Ep=e[--Eo]}return Ep[0](En)}}function B3(En){var e=new Date(En,0,1);e.setFullYear(En);return e}function D9(Eo){var Ep=Eo.getFullYear(),En=B3(Ep),e=B3(Ep+1);return Ep+(Eo-En)/(e-En)}var Cp=[1000,5000,15000,30000,60000,300000,900000,1800000,3600000,10800000,21600000,43200000,86400000,172800000,604800000,2592000000,7776000000,31536000000];var BF=[[d3.time.second,1],[d3.time.second,5],[d3.time.second,15],[d3.time.second,30],[d3.time.minute,1],[d3.time.minute,5],[d3.time.minute,15],[d3.time.minute,30],[d3.time.hour,1],[d3.time.hour,3],[d3.time.hour,6],[d3.time.hour,12],[d3.time.day,1],[d3.time.day,2],[d3.time.week,1],[d3.time.month,1],[d3.time.month,3],[d3.time.year,1]];var C9=[[d3.time.format("%Y"),function(e){return true}],[d3.time.format("%B"),function(e){return e.getMonth()}],[d3.time.format("%b %d"),function(e){return e.getDate()!=1}],[d3.time.format("%a %d"),function(e){return e.getDay()&&e.getDate()!=1}],[d3.time.format("%I %p"),function(e){return e.getHours()}],[d3.time.format("%I:%M"),function(e){return e.getMinutes()}],[d3.time.format(":%S"),function(e){return e.getSeconds()}],[d3.time.format(".%L"),function(e){return e.getMilliseconds()}]];var BD=d3.scale.linear(),i=BP(C9);BF.year=function(En,e){return BD.domain(En.map(D9)).ticks(e).map(B3)};d3.time.scale=function(){return Aa(d3.scale.linear(),BF,i)};var Ed=BF.map(function(e){return[e[0].utc,e[1]]});var A1=[[d3.time.format.utc("%Y"),function(e){return true}],[d3.time.format.utc("%B"),function(e){return e.getUTCMonth()}],[d3.time.format.utc("%b %d"),function(e){return e.getUTCDate()!=1}],[d3.time.format.utc("%a %d"),function(e){return e.getUTCDay()&&e.getUTCDate()!=1}],[d3.time.format.utc("%I %p"),function(e){return e.getUTCHours()}],[d3.time.format.utc("%I:%M"),function(e){return e.getUTCMinutes()}],[d3.time.format.utc(":%S"),function(e){return e.getUTCSeconds()}],[d3.time.format.utc(".%L"),function(e){return e.getUTCMilliseconds()}]];var Cg=BP(A1);function BW(En){var e=new Date(Date.UTC(En,0,1));e.setUTCFullYear(En);return e}function Da(Eo){var Ep=Eo.getUTCFullYear(),En=BW(Ep),e=BW(Ep+1);return Ep+(Eo-En)/(e-En)}Ed.year=function(En,e){return BD.domain(En.map(Da)).ticks(e).map(BW)};d3.time.scale.utc=function(){return Aa(d3.scale.linear(),Ed,Cg)}})();
+/*
+ * Including Box2DWeb
+ * http://www.gphysics.com
+ * Copyright 2006, Erin Catto 
+ * Released under zlib License.
+ * 
+ */
 var Box2D={};
 (function(F,G){function K(){}if(!(Object.prototype.defineProperty instanceof Function)&&Object.prototype.__defineGetter__ instanceof Function&&Object.prototype.__defineSetter__ instanceof Function)Object.defineProperty=function(y,w,A){A.get instanceof Function&&y.__defineGetter__(w,A.get);A.set instanceof Function&&y.__defineSetter__(w,A.set)};F.inherit=function(y,w){K.prototype=w.prototype;y.prototype=new K;y.prototype.constructor=y};F.generateCallback=function(y,w){return function(){w.apply(y,arguments)}};
 F.NVector=function(y){if(y===G)y=0;for(var w=Array(y||0),A=0;A<y;++A)w[A]=0;return w};F.is=function(y,w){if(y===null)return false;if(w instanceof Function&&y instanceof w)return true;if(y.constructor.__implements!=G&&y.constructor.__implements[w])return true;return false};F.parseUInt=function(y){return Math.abs(parseInt(y))}})(Box2D);var Vector=Array,Vector_a2j_Number=Box2D.NVector;if(typeof Box2D==="undefined")Box2D={};if(typeof Box2D.Collision==="undefined")Box2D.Collision={};
@@ -488,9 +488,9 @@
 1;y<K;y++)w.lineTo(G[y].x*A,G[y].y*A);w.lineTo(G[0].x*A,G[0].y*A);w.closePath();w.fill();w.stroke()}};F.prototype.DrawCircle=function(G,K,y){if(K){var w=this.m_ctx,A=this.m_drawScale;w.beginPath();w.strokeStyle=this._color(y.color,this.m_alpha);w.arc(G.x*A,G.y*A,K*A,0,Math.PI*2,true);w.closePath();w.stroke()}};F.prototype.DrawSolidCircle=function(G,K,y,w){if(K){var A=this.m_ctx,U=this.m_drawScale,p=G.x*U,B=G.y*U;A.moveTo(0,0);A.beginPath();A.strokeStyle=this._color(w.color,this.m_alpha);A.fillStyle=
 this._color(w.color,this.m_fillAlpha);A.arc(p,B,K*U,0,Math.PI*2,true);A.moveTo(p,B);A.lineTo((G.x+y.x*K)*U,(G.y+y.y*K)*U);A.closePath();A.fill();A.stroke()}};F.prototype.DrawSegment=function(G,K,y){var w=this.m_ctx,A=this.m_drawScale;w.strokeStyle=this._color(y.color,this.m_alpha);w.beginPath();w.moveTo(G.x*A,G.y*A);w.lineTo(K.x*A,K.y*A);w.closePath();w.stroke()};F.prototype.DrawTransform=function(G){var K=this.m_ctx,y=this.m_drawScale;K.beginPath();K.strokeStyle=this._color(16711680,this.m_alpha);
 K.moveTo(G.position.x*y,G.position.y*y);K.lineTo((G.position.x+this.m_xformScale*G.R.col1.x)*y,(G.position.y+this.m_xformScale*G.R.col1.y)*y);K.strokeStyle=this._color(65280,this.m_alpha);K.moveTo(G.position.x*y,G.position.y*y);K.lineTo((G.position.x+this.m_xformScale*G.R.col2.x)*y,(G.position.y+this.m_xformScale*G.R.col2.y)*y);K.closePath();K.stroke()}})();var i;for(i=0;i<Box2D.postDefs.length;++i)Box2D.postDefs[i]();delete Box2D.postDefs;
-
-/*
- * Main VS Code
- * 
- */
-(function(B){B.fn.vs=function(){};B.fn._vs={};B.fn._vs.token={};B.fn._vs.draw={};B.fn._vs.stream={};B.fn._vs.chart={};B.fn._vs.phy={};B.fn._vs.decay={};B.fn._vs.flocculate={};B.fn._vs.strata={};B.fn._vs.aggregate={};var A=function(E,O){this.token=B.fn._vs.token;this.draw=B.fn._vs.draw;this.stream=B.fn._vs.stream;this.chart=B.fn._vs.chart;this.phy=B.fn._vs.phy;this.decay=B.fn._vs.decay;this.flocculate=B.fn._vs.flocculate;this.strata=B.fn._vs.strata;this.requestAnimFrame;this.mouse={};this.mouse.x=0;this.mouse.y=0;this.mouse.isMouseDragging=false;this.mouse.isMouseDown=false;this.mouse.selectedBody=null;this.dataFlow=[];this.chartPhySetup={};this.tokens=[];this.world=null;this.ctx=null;var D=B(E);var M=this;var L=[];var N;var C;var H={x:0,y:0,width:290.5,height:300.5,DOMelement:null,chart:{x:undefined,y:undefined,width:undefined,height:undefined,colorRange:d3.scale.category10(),scale:d3.scale,type:"StackedAreaChart",spacer:5,column:3,wallColor:"rgba(230,230,230,0)",label:true,radius:10},data:{model:[{label:"Column A"},{label:"Column B"},{label:"Column C"},],strata:[[{initValue:100,label:"Strata 1 col A"}],[{initValue:20,label:"Strata 1 col B"}],[{initValue:175,label:"Strata 2 col C"}]],token:[{timestamp:1,category:1,value:1,userdata:{},callback:{}}],tokenPast:0,stream:{provider:"generator",refresh:10000/8,now:0},},sedimentation:{token:{size:{original:4,minimum:2},visible:true},incoming:{strategy:1,point:[{x:50,y:0},{x:100,y:0},{x:150,y:0}],target:[{x:50,y:0},{x:100,y:0},{x:150,y:0}]},granulate:{visible:false},flocculate:{number:1,action:"buffer",strategy:"Size",bufferSize:5,bufferTime:1000,bufferHeight:50,bufferFrameRate:25,buffer:[]},suspension:{height:null,incomming:"top",decay:{power:1.001},refresh:200},accumulation:{height:null},aggregation:{height:0,maxData:0,invertStrata:false},},options:{refresh:1000/25,panel:false,scale:30,layout:false,canvasFirst:true}};this.now=function(){return(new Date().getTime())};this.globalDecay=function(P){if(typeof(P)=="undefined"){return this.settings.sedimentation.suspension.decay.power}else{return this.settings.sedimentation.suspension.decay.power=P}};this.getWorld=function(){return this.world};this.chartUpdate=function(P,R){var Q={cat:P,y:R};this.chart[this.settings.chart.type](M,"update",Q)};this.flocculateTokens=function(P){return this.flocculate.update(M,P)};this.flocculateAll=function(){return this.flocculate.all(M)};this.addToken=function(P){return this.token.addToken(M,P)};this.selectAll=function(P,Q){return this.token.selectAll(M,P,Q)};this.select=function(P,Q){return this.token.select(M,P,Q)};this.updateAll=function(P){var Q=this.chart.updateAll(M,key,value);return Q};this.update=function(P,Q){var R=this.chart.update(M,P,Q);return R};function J(S,R){var Q={};for(var P in S){Q[P]=S[P]}for(var P in R){Q[P]=R[P]}return Q}J(H,O);if(O.data!=undefined){H.data=O.data}this.settings=B.extend(true,H,O);this.settings.DOMelement=E;if(typeof(this.settings.chart.width)=="undefined"){this.settings.chart.width=this.settings.width}if(typeof(this.settings.chart.x)=="undefined"){this.settings.chart.x=0}if(typeof(this.settings.chart.y)=="undefined"){this.settings.chart.y=0}if(typeof(this.settings.chart.height)=="undefined"){this.settings.chart.height=this.settings.height}if(typeof(this.settings.stream)=="undefined"){this.settings.stream={}}if(typeof(this.settings.stream.now)=="undefined"){this.settings.stream.now=0}if(typeof(this.settings.stream.provider)=="undefined"){this.settings.stream.provider="generator"}if(typeof(this.settings.stream.refresh)=="undefined"){this.settings.stream.refresh=1000}if(typeof(this.settings.data.tokenPast)=="undefined"){this.settings.data.tokenPast=0}if(typeof(this.settings.data.tokens)=="undefined"){this.settings.data.tokens=[]}if(typeof(this.settings.data.strata)!="undefined"&&this.settings.data.strata.length!=0){if(typeof(this.settings.sedimentation.aggregation)=="undefined"){this.settings.sedimentation.aggregation={}}if(typeof(this.settings.sedimentation.aggregation.height)=="undefined"){this.settings.sedimentation.aggregation.height=this.settings.chart.height/2}if(typeof(this.settings.sedimentation.aggregation.maxData)=="undefined"){this.settings.sedimentation.aggregation.maxData=10}}this.init=function(){this.requestAnimFrame=(function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(W,V){window.setTimeout(W,1000/60)}})();this.world=new this.phy.b2World(new this.phy.b2Vec2(0,0),true);var Q=E.appendChild(document.createElement("div"));Q.id="box_sediviz_"+I();Q.width=this.settings.width;Q.height=this.settings.height;this.settings.DOMelement=Q;C=Q.appendChild(document.createElement("canvas"));C.id="canvas";C.width=this.settings.width;C.height=this.settings.height;C.style.position="absolute";this.ctx=C.getContext("2d");this.chart[this.settings.chart.type](M,"init");this.stream.init(M);this.flocculate.init(M);this.stream.update(M);this.token.init(M);this.strata.init(this);window.setInterval(function(){M.update(M)},M.settings.options.refresh/2);window.setInterval(function(){M.draw.update(M)},M.settings.options.refresh);window.setInterval(function(){M.decay.update(M)},M.settings.sedimentation.suspension.refresh);M.strata.update(M);this.getBodyAtMouse=function(b){var V=b.mouse.x/b.settings.options.scale;var Z=b.mouse.y/b.settings.options.scale;var Y=new b.phy.b2Vec2(V,Z);var W=new b.phy.b2AABB();var X=0.001;W.lowerBound.Set(V-X,Z-X);W.upperBound.Set(V+X,Z+X);b.mouse.selectedToken=null;b.world.QueryAABB(function(d){return T(d,b,Y)},W);return b.mouse.selectedToken};function T(W,X,V){X.mouse.selectedToken=W;if(W.GetBody().GetType()!=X.phy.b2Body.b2_staticBody){if(W.GetShape().TestPoint(W.GetBody().GetTransform(),V)){X.mouse.selectedToken=W;return false}}return true}this.handleMouseMove=function(V,W){canvasPosition=F(W.settings.DOMelement);W.mouse.x=(V.clientX-(canvasPosition.offsetLeft-this.getScrollPosition()[0]));W.mouse.y=(V.clientY-(canvasPosition.offsetTop-this.getScrollPosition()[1]))};this.getScrollPosition=function(){return Array((document.documentElement&&document.documentElement.scrollLeft)||window.pageXOffset||M.pageXOffset||document.body.scrollLeft,(document.documentElement&&document.documentElement.scrollTop)||window.pageYOffset||M.pageYOffset||document.body.scrollTop)};document.addEventListener("mousemove",function(V){S(V,M)});document.addEventListener("mouseup",function(V){U(V,M)});document.addEventListener("mousedown",function(V){R(V,M)});function P(Y,b){var W=b.getBodyAtMouse(b);if(W!=null){if(typeof(W.m_userData)!="undefined"){if(typeof(W.m_userData.callback)!="undefined"){if(typeof(W.m_userData.callback.mouseover)=="function"){var V=b.select("ID",W.m_userData.ID);W.m_userData.callback.mouseover(V)}if(typeof(W.m_userData.callback.mouseout)=="function"){var V=b.select("ID",W.m_userData.ID);var Z;var X=function(){var e=Z;var g=V;var d=b;var f=W;return function(){var h=d.getBodyAtMouse(d);var k=false;if(h!=null){if(typeof(h.m_userData)!="undefined"){if(h.m_userData.ID==g.attr("ID")){k=false}else{k=true}}else{k=true}}else{k=true}if(k){f.m_userData.callback.mouseout(g);clearInterval(Z)}}};Z=window.setInterval(X(),100)}}}}}function R(X,Y){Y.mouse.isMouseDown=true;Y.handleMouseMove(X,Y);var W=Y.getBodyAtMouse(Y);if(W!=null){if(typeof(W.m_userData)!="undefined"){if(typeof(W.m_userData.callback)!="undefined"){if(typeof(W.m_userData.callback.onclick)=="function"){var V=Y.select("ID",W.m_userData.ID);W.m_userData.callback.onclick(V)}}}}}function U(V,W){W.mouse.isMouseDown=false}function S(V,W){if(W.mouse.isMouseDown){W.mouse.isMouseDragging=true;W.mouse.x=V.clientX;W.mouse.y=V.clientY}else{W.handleMouseMove(V,W);P("move",W)}}};this.mouse.update=function(Q){if(isMouseDown&&(!mouseJoint)){var P=getBodyAtMouse();if(P){var R=new b2MouseJointDef();R.bodyA=world.GetGroundBody();R.bodyB=P;R.target.Set(mouseX,mouseY);R.collideConnected=true;R.maxForce=300*P.GetMass();mouseJoint=world.CreateJoint(R);P.SetAwake(true)}}if(mouseJoint){if(isMouseDown){mouseJoint.SetTarget(new b2Vec2(mouseX,mouseY))}else{world.DestroyJoint(mouseJoint);mouseJoint=null}}};this.update=function(P){this.world.Step(1/60,10,10);this.world.DrawDebugData();this.world.ClearForces()};var G=function(){ctx.fillStyle="rgb(200,0,0)";this.ctx.font="14pt Calibri,Geneva,Arial";this.ctx.fillText("Canvas ready for Visual Sedimentation ",10,20);window.setInterval(B.fn.vs.draw.refresh(ctx,world,this.settings),this.settings.options.refresh);console.log("draw Init ")};var F=function(R){var Q=R.offsetTop;var P=R.offsetLeft;while(R=R.offsetParent){Q+=R.offsetTop;P+=R.offsetLeft}return{offsetLeft:P,offsetTop:Q}};var I=function(){var P=function(){return Math.floor(Math.random()*65536).toString(16)};return(P()+P()+"-"+P()+"-"+P()+"-"+P()+"-"+P()+P()+P())};function K(Q){if(null==Q||"object"!=typeof Q){return Q}var R=Q.constructor();for(var P in Q){if(Q.hasOwnProperty(P)){R[P]=Q[P]}}return R}this.utile={};this.utile.GUID=I;this.utile.clone=K;this.settings=B.extend(this.settings,{}||{});this.init()};B.fn.vs=function(C){if(!arguments.length){var C={}}return this.each(function(){var D=B(this);if(D.data("VisualSedimentation")){return}var E=new A(this,C);D.data("visualSedimentation",E)})}})(jQuery);(function(A){A.fn._vs.phy={b2Vec2:Box2D.Common.Math.b2Vec2,b2AABB:Box2D.Collision.b2AABB,b2BodyDef:Box2D.Dynamics.b2BodyDef,b2Body:Box2D.Dynamics.b2Body,b2FixtureDef:Box2D.Dynamics.b2FixtureDef,b2Fixture:Box2D.Dynamics.b2Fixture,b2World:Box2D.Dynamics.b2World,b2MassData:Box2D.Collision.Shapes.b2MassData,b2PolygonShape:Box2D.Collision.Shapes.b2PolygonShape,b2CircleShape:Box2D.Collision.Shapes.b2CircleShape,b2DebugDraw:Box2D.Dynamics.b2DebugDraw,b2MouseJointDef:Box2D.Dynamics.Joints.b2MouseJointDef,b2Shape:Box2D.Collision.Shapes.b2Shape,b2DistanceJointDef:Box2D.Dynamics.Joints.b2DistanceJointDef,b2RevoluteJointDef:Box2D.Dynamics.Joints.b2RevoluteJointDef,b2Joint:Box2D.Dynamics.Joints.b2Joint,b2PrismaticJointDef:Box2D.Dynamics.Joints.b2PrismaticJointDef,b2ContactListener:Box2D.Dynamics.b2ContactListener,b2Settings:Box2D.Common.b2Settings}})(jQuery);(function(A){A.fn.vs.chart={}})(jQuery);(function(A){A.fn._vs.draw={settings:{draw:{trail:1,showLayout:false}},update:function(D){if(this.settings.draw.trail==1){D.ctx.clearRect(0,0,D.ctx.canvas.clientWidth,D.ctx.canvas.clientHeight)}else{debugDrawChart(0,0,ctx.canvas.clientWidth,ctx.canvas.clientHeight,"rgba(255,255,255,"+this.settings.draw.trail+")",ctx)}for(var B=D.world.GetBodyList();B;B=B.GetNext()){for(var C=B.GetFixtureList();C!=null;C=C.GetNext()){this.drawShape(D,C)}}if(this.settings.draw.showLayout==true){this.debugDrawChart(chart.position.x,chart.position.y,chart.position.width,chart.position.height,"rgba(255,0,0,0.2)",ctx)}},debugDrawChart:function(B,G,D,F,E,C){C.save();C.translate(0,0);C.fillStyle=E;C.beginPath();C.rect(B,G,D,F);C.closePath();C.strokeStyle="#000";C.lineWidth=0.5;C.stroke();C.restore()},clippedBackgroundImage:function(C,D,B,E){C.save();C.clip();C.drawImage(D,B-(D.height/2),E-(D.width/2),D.width,D.height);C.restore()},haveTexture:function(C){var B=false;if(typeof(C.m_userData.texture)!="undefined"){if(typeof(C.m_userData.texture.img)!="undefined"){if(C.m_userData.texture.img.complete){B=true}}}return B},drawShape:function(K,F){var Q=F.GetBody();var R=Q.GetPosition();var P=Q.GetAngle();var D=9;var C=10;var S=K.settings.options.scale;F.m_userData.x=Q.GetWorldCenter().x*S;F.m_userData.y=Q.GetWorldCenter().y*S;if(typeof(F)!="undefined"){switch(F.GetType()){case 0:switch(F.m_userData){case null:K.ctx.fillStyle="rgba(255,0,0,1)";break;default:K.ctx.fillStyle=F.m_userData.fillStyle;break}var B=F.m_shape.m_radius;if(K.settings.sedimentation.token.visible==true){K.ctx.save();K.ctx.translate(R.x*S,R.y*S);K.ctx.rotate(P);K.ctx.beginPath();var O=(B/C*D)*S;if(typeof(F.m_userData.strokeStyle)!="undefined"){K.ctx.strokeStyle=F.m_userData.strokeStyle}else{K.ctx.strokeStyle="rgba(0,0,0,0)"}if(typeof(F.m_userData.lineWidth)!="undefined"){K.ctx.lineWidth=F.m_userData.lineWidth}else{K.ctx.lineWidth=0}K.ctx.arc(0,0,O,0,Math.PI*2,true);if(this.haveTexture(F)){this.clippedBackgroundImage(K.ctx,F.m_userData.texture.img,0,0)}K.ctx.closePath();if(K.settings.options.layout==true){K.ctx.strokeStyle="#000";K.ctx.lineWidth=0.5;K.ctx.stroke()}else{if(!this.haveTexture(F)){K.ctx.fill()}K.ctx.stroke()}K.ctx.restore()}break;case 1:switch(F.m_userData){case null:K.ctx.fillStyle="rgba(255,0,0,1)";break;default:K.ctx.fillStyle=F.m_userData.fillStyle;break}var I=F.m_shape.m_vertices[0].x*S;var G=F.m_shape.m_vertices[0].y*S;var J=R.x*S-F.m_shape.m_vertices[0].x*S;var H=R.y*S-F.m_shape.m_vertices[0].y*S;K.ctx.save();K.ctx.translate(R.x*S,R.y*S);K.ctx.rotate(P);K.ctx.beginPath();if(typeof(F.m_userData.strokeStyle)!="undefined"){K.ctx.strokeStyle=F.m_userData.strokeStyle}else{K.ctx.strokeStyle=F.m_userData.fillStyle}if(typeof(F.m_userData.lineWidth)!="undefined"){K.ctx.lineWidth=F.m_userData.lineWidth}else{K.ctx.lineWidth=0}for(var N=0;N<F.m_shape.m_vertices.length;N++){var M=F.m_shape.m_vertices;K.ctx.moveTo((M[0].x)*S,(M[0].y)*S);for(var L=1;L<M.length;L++){K.ctx.lineTo((M[L].x)*S,(M[L].y)*S)}K.ctx.lineTo((M[0].x)*S,(M[0].y)*S)}K.ctx.closePath();K.ctx.fill();if(K.settings.options.layout==true){K.ctx.lineWidth=0.25;K.ctx.strokeStyle="rgb(0,0,0)";K.ctx.stroke()}else{K.ctx.stroke()}K.ctx.restore();break;case 2:break;K.ctx.fillStyle="rgb(0,0,0)"}}if(typeof(F.m_userData.callback)!="undefined"){if(typeof(F.m_userData.callback.draw)=="function"){var E=K.select("ID",F.m_userData.ID);F.m_userData.callback.draw(E)}}}}})(jQuery);(function(A){A.fn._vs.token={colorRange:function(){},init:function(B){this.colorRange=B.settings.chart.colorRange},ID:function(B){B.settings.data.tokenPast+=1;return B.settings.data.tokenPast},selectAll:function(G,D,F){var B=[];var E=false;B.flocculate=function(){var H=[];B.forEach(function(I){q=I.flocculate();H.push(q)});return H};B.attr=function(H,J,K){var I=[];B.forEach(function(L){q=L.attr(H,J,K);I.push(q)});return I};B.b2dObj=function(H,J,K){var I=[];B.forEach(function(L){q=L.myobj;I.push(q)});return I};if(typeof(F)=="undefined"&&typeof(D)=="undefined"){E=true}for(var C=G.tokens.length-1;C>=0;C--){if(G.tokens[C].attr(D)==F||E==true){B.push(G.tokens[C])}}return B},select:function(E,C,D){result=[];if(typeof(D)=="undefined"&&typeof(C)=="undefined"){return E.tokens}else{for(var B=E.tokens.length-1;B>=0;B--){if(E.tokens[B].attr(C)==D){result.push(E.tokens[B]);break}}}if(typeof(result[0])=="undefined"){return false}else{return result[0]}},addToken:function(H,G){var C={x:50,y:50,t:null,category:1,state:0,size:10,fillStyle:"###",strokeStyle:"rgba(0,0,0,0)",lineWidth:0,texture:undefined,shape:{type:"round"},userdata:{},callback:{},phy:{density:10,friction:0,restitution:0},targets:[],elbow:{}};var B=null;var D=null;var F={};F.toString=function(){return"Token ID="+this.setting.ID};if(typeof(G)=="undefined"){F.setting=C;F.setting.ID=this.ID(H)}else{F.setting=G;if(typeof(F.setting.phy)=="undefined"){F.setting.phy=C.phy}if(typeof(F.setting.t)=="undefined"){F.setting.t=H.settings.stream.now}if(typeof(F.setting.x)=="undefined"){F.setting.x=H.settings.sedimentation.incoming.point[G.category].x+(Math.random()*2)}if(typeof(F.setting.y)=="undefined"){F.setting.y=H.settings.sedimentation.incoming.point[G.category].y+(Math.random()*2)}if(typeof(F.setting.size)=="undefined"){F.setting.size=H.settings.sedimentation.token.size.original}if(typeof(F.setting.targets)=="undefined"){F.setting.targets=[]}F.setting.ID=F.setting.ID=this.ID(H);if(typeof(F.setting.state)=="undefined"){F.setting.state=0}if(typeof(F.setting.shape)=="undefined"){F.setting.shape=C.shape}}F.myobj=this.create(H,F.setting);F.flocculate=function(){H.tokens.indexOf(this);H.flocculate.destroyIt(H,this);return this};F.attr=function(I,J,K){if(typeof(J)=="undefined"){if(typeof(this[I])!="undefined"){return this[I]()}else{return this.myobj.m_userData[I]}}else{if(typeof(this[I])!="undefined"){this[I](J,K)}else{this.myobj.m_userData[I]=J}}return this};F.callback=function(I,J){if(!arguments.length){return this.myobj.m_userData.callback}if(typeof(this.myobj.m_userData.callback[I])=="function"){return this.myobj.m_userData.callback[I](J)}else{return function(K){console.log("callback undefined")}}};F.size=function(I){if(this.myobj!=null&&this.attr("state")<2){if(!arguments.length){return this.myobj.m_shape.m_radius*this.myobj.m_userData.scale}this.myobj.m_shape.m_radius=I/this.myobj.m_userData.scale}};F.b2dObj=function(){if(this.myobj!=null&&this.attr("state")<2){return this.myobj}};F.texture=function(I){if(!arguments.length){return this.myobj.m_userData.texture.img.src}console.log("texture",I);this.myobj.m_userData.texture={};this.myobj.m_userData.texture.img=new Image();this.myobj.m_userData.texture.img.src=I};H.tokens.push(F);H.decay.tokens.push(F);if(typeof(this.myobj.m_userData.callback)!="undefined"){if(typeof(this.myobj.m_userData.callback.suspension)=="function"){var E=H.select("ID",F.setting.ID);this.myobj.m_userData.callback.suspension(E)}}return F},create:function(H,C){C.scale=scale=H.settings.options.scale;var G=C.x/scale+(Math.random()*0.1);var D=C.y/scale+(Math.random()*0.1);var F=new Box2D.Dynamics.b2FixtureDef;F.density=0.1;F.friction=0;F.restitution=0;if(C.shape.type=="round"){F.shape=new Box2D.Collision.Shapes.b2CircleShape(C.size/scale)}else{if(C.shape.type=="polygons"){F=this.setPolygons(H,C,F)}else{if(C.shape.type=="box"){F.shape=new Box2D.Collision.Shapes.b2PolygonShape;F.shape.SetAsBox(C.shape.width/scale,C.shape.height/scale)}}}var B=new Box2D.Dynamics.b2BodyDef;B.type=Box2D.Dynamics.b2Body.b2_dynamicBody;B.position.x=C.x/scale;B.position.y=C.y/scale;this.myobj=H.world.CreateBody(B).CreateFixture(F);if(typeof(C.texture)!="undefined"){C.texture.img=new Image();C.texture.img.src=C.texture.src}if(typeof(C.impulse)!="undefined"){this.applyImpulse(this.myobj,C.impulse.angle,C.impulse.power)}if(typeof(C.fillStyle)=="undefined"){C.fillStyle=this.colorRange(C.category)}if(typeof(C.lineWidth)=="undefined"){C.lineWidth=0}if(typeof(C.type)=="undefined"){C.type="token"}if(typeof(C.callback)=="undefined"){C.callback={}}this.myobj.m_userData=C;this.myobj.attr=this.attr;this.myobj.m_userData.mouse={};this.myobj.m_userData.mouse.over=false;this.myobj.m_userData.mouse.down=false;this.myobj.m_userData.mouse.dragging=false;this.myobj.m_userData.mouse.statebefore=false;this.myobj.m_userData.state=1;if(C.targets.length==0&&H.settings.chart.type=="CircleLayout"){C.targets[0]={x:H.settings.sedimentation.incoming.target[C.category].x,y:H.settings.sedimentation.incoming.target[C.category].y}}if(C.targets.length>0){var E=new H.phy.b2MouseJointDef();E.bodyA=H.world.GetGroundBody();E.bodyB=this.myobj.GetBody();E.target.Set(G,D);E.collideConnected=true;E.maxForce=50*this.myobj.GetBody().GetMass();mouseJoint=H.world.CreateJoint(E);mouseJoint.SetTarget(new H.phy.b2Vec2(C.targets[0].x/scale,C.targets[0].y/scale))}return this.myobj},applyImpulse:function(D,E,C){var B=D.GetBody();B.ApplyImpulse(new Box2D.Common.Math.b2Vec2(Math.cos(E*(Math.PI/180))*C,Math.sin(E*(Math.PI/180))*C),B.GetWorldCenter())},setPolygons:function(F,D,E){E.shape=new Box2D.Collision.Shapes.b2PolygonShape;if(D.shape.points==null){D.shape.points=[{x:-1,y:-1},{x:1,y:-1},{x:-1,y:-1},{x:1,y:-1}]}for(var C=0;C<D.shape.points.length;C++){var B=new Box2D.Common.Math.b2Vec2();B.Set(D.shape.points[C].x/scale,D.shape.points[C].y/scale);D.shape.points[C]=B}E.shape.SetAsArray(D.shape.points,D.shape.points.length);return E},createDataBarBall:function(I,B,H,E,F){var G=new Box2D.Dynamics.b2FixtureDef;G.density=10;G.friction=0.5;G.restitution=0.2;G.shape=new Box2D.Collision.Shapes.b2CircleShape(E/I.settings.options.scale);var D=new Box2D.Dynamics.b2BodyDef;D.type=Box2D.Dynamics.b2Body.b2_dynamicBody;D.position.x=B/I.settings.options.scale;D.position.y=H/I.settings.options.scale;var C=I.world.CreateBody(D).CreateFixture(G);C.m_userData={type:"BarChartBall",familyID:"family",fillColor:this.colorRange(F)};return C},createBox:function(I,K,J,D,L,F,C,G){if(typeof(G)=="undefined"){G=true}var B=new b2FixtureDef;if(!G){B.density=100}B.friction=0.6;B.restitution=0.3;var E=new b2BodyDef;E.type=b2Body.b2_staticBody;E.angle=F;B.shape=new b2PolygonShape;B.shape.SetAsBox(D/scale,L/scale);E.position.Set(K/scale,J/scale);var H=I.CreateBody(E).CreateFixture(B);H.m_userData={type:"Wall",fillColor:C};console.log(H.m_userData);return H},createBoxPie:function(I,E,K,J,D,L,G,C){var F=new b2BodyDef;F.type=Box2D.Dynamics.b2Body.b2_dynamicBody;var B=new Box2D.Dynamics.b2FixtureDef;B.shape=new b2PolygonShape;B.shape.SetAsBox(D/scale,L/scale);B.density=1000000;B.friction=0.5;B.restitution=0.2;F.position.Set(K/scale,J/scale);F.angle=0;var H=I.CreateBody(F).CreateFixture(B);H.m_userData={type:"Wall",fillColor:C};return H},createBox0D:function(H,C,I,F,B,G){if(typeof(G)=="undefined"){G=true}var E=new b2BoxDef();E.restitution=-0.6;E.friction=0.3;if(!G){E.density=0.01}E.extents.Set(F,B);var D=new b2BodyDef();D.AddShape(E);D.position.Set(C,I);return H.CreateBody(D)},createHiddenBox:function(G,I,H,B,J,D){if(typeof(D)=="undefined"){D=true}var E=new b2BoxDef();E.restitution=0.6;E.friction=0.3;if(!D){E.density=1}E.extents.Set(B,J);var C=new b2BodyDef();C.AddShape(E);C.position.Set(I,H);var F=G.CreateBody(C);F.m_shapeList.visibility="hidden";console.log(F);return F},createBigBall:function(E,B,G){var F=new Box2D.Dynamics.b2FixtureDef;F.density=1000000;F.friction=0.5;F.restitution=0.2;F.shape=new Box2D.Collision.Shapes.b2CircleShape(20/30);var D=new Box2D.Dynamics.b2BodyDef;D.type=Box2D.Dynamics.b2Body.b2_dynamicBody;D.position.x=B;D.position.y=G;var C=E.CreateBody(D).CreateFixture(F);return C},createPieBox:function(G,J,I,C,K,L,D,M){M=A.extend(true,{density:10000000,friction:1,restitution:0.2,linearDamping:0,angularDamping:0,gravityScale:0,type:b2Body.b2_dynamicBody},M);var B=new b2BodyDef();var E=new b2FixtureDef;E.density=M.density;E.friction=M.friction;E.restitution=M.restitution;E.shape=new b2PolygonShape();E.shape.SetAsBox(C/scale,K/scale);B.position.Set(J/scale,I/scale);B.linearDamping=M.linearDamping;B.angularDamping=M.angularDamping;B.angle=L;B.type=M.type;var H=G.CreateBody(B);var F=H.CreateFixture(E);F.m_userData={type:"box",familyID:null,fillColor:D};return H},createDataBallTarget:function(H,L,I,M,K,N,F){var G=M/scale+(Math.random()*0.1);var C=K/scale+(Math.random()*0.1);var B=new Box2D.Dynamics.b2FixtureDef;B.density=0.1;B.friction=0;B.restitution=0;B.shape=new Box2D.Collision.Shapes.b2CircleShape(N/scale);var D=new Box2D.Dynamics.b2BodyDef;D.type=Box2D.Dynamics.b2Body.b2_dynamicBody;D.position.x=G;D.position.y=C;var E=H.CreateBody(D).CreateFixture(B);var J=new b2MouseJointDef();J.bodyA=H.GetGroundBody();J.bodyB=E.GetBody();J.target.Set(G,C);J.collideConnected=true;J.maxForce=50*E.GetBody().GetMass();mouseJoint=H.CreateJoint(J);mouseJoint.SetTarget(new b2Vec2(L/scale,I/scale));E.m_userData={type:"PieBall",familyID:F,fillColor:colorScale(F)};categorys[F].value+=1;categorys[F].joins.push(mouseJoint);return E},createDataBallPie:function(H,I,M,K,N,F){console.log(I);var G=categorys[F].incomingPoint.x/scale+(Math.random()*2/scale);var C=categorys[F].incomingPoint.y/scale;var B=new Box2D.Dynamics.b2FixtureDef;B.density=0.1;B.friction=0;B.restitution=0;B.shape=new Box2D.Collision.Shapes.b2CircleShape(N/scale);var D=new Box2D.Dynamics.b2BodyDef;D.type=Box2D.Dynamics.b2Body.b2_dynamicBody;D.position.x=G;D.position.y=C;var L=H.CreateBody(D);L.m_userData={type:"PieBall",familyID:F,fillColor:categorys[F].color};listBodies.push(L);var E=L.CreateFixture(B);var J=new b2MouseJointDef();J.bodyA=H.GetGroundBody();J.bodyB=E.GetBody();J.target.Set(G,C);J.collideConnected=true;J.maxForce=100*E.GetBody().GetMass();mouseJoint=H.CreateJoint(J);mouseJoint.SetTarget(new b2Vec2(I.position.x/scale,I.position.y/scale));E.m_userData={type:"PieBall",familyID:F,fillColor:colorScale(F)};categorys[F].value+=1;return E},createDataBall:function(H,B,G,E){var F=new Box2D.Dynamics.b2FixtureDef;F.density=1;F.friction=0.5;F.restitution=0.2;F.shape=new Box2D.Collision.Shapes.b2CircleShape(E/H.settings.options.scale);var D=new Box2D.Dynamics.b2BodyDef;D.type=Box2D.Dynamics.b2Body.b2_dynamicBody;D.position.x=B;D.position.y=G;var C=H.world.CreateBody(D).CreateFixture(F);C.m_userData={type:"PieBall",familyID:"family",fillColor:"rgb(200,0,0)"};return C},}})(jQuery);(function(A){A.fn._vs.stream={i:null,buffer:[],speed:10000/6,strategy:null,type:null,init:function(B){this.speed=B.settings.data.stream.refresh;type=B.settings.data.stream.provider},push:function(C){console.log(C);for(var B=C.length-1;B>=0;B--){buffer.push(C)}},update:function(C){if(type=="generator"){for(var B=0;B<C.settings.data.model.length;B++){C.dataFlow[B]=setInterval((function(D,E){return function(){E.settings.data.stream.now++;var F=E.chart[E.settings.chart.type](E,"token",D);E.addToken(F)}})(B,C),this.speed)}}else{if(type=="tokens"){C.dataFlow[0]=setInterval((function(D,E){return function(){E.settings.data.stream.now++;for(var F=0;F<E.settings.data.tokens.length;F++){if(E.settings.data.tokens[F].t==E.settings.data.stream.now){E.addToken(E.settings.data.tokens[F])}}}})(B,C),this.speed)}else{}}},generator:function(C,B){},test:function(B){B.tokens.push(B.token.createDataBarBall(B,(B.settings.sedimentation.incoming[i].x+(Math.random()*2)),(B.settings.sedimentation.incoming[i].y+(Math.random()*1)),B.settings.sedimentation.token.size,i))},setSpeed:function(D,C){speedFlow=C;for(var B=0;B<categorys.length;B++){window.clearInterval(dataFlow[B])}window.clearInterval(decayFlow);dataFlow(categorys)}}})(jQuery);(function(A){A.fn._vs.decay={tokens:[],update:function(G){var D=1;var J=G.settings.sedimentation.suspension.height;var K=G.settings.height;var H=G.settings.sedimentation.token.size/4;var B=G.settings.sedimentation.suspension.decay.power;var E=G.settings.options.scale;var F=G.settings.sedimentation.token.size.minimum;if(B==null){var B=0}for(var I=0;I<this.tokens.length;I++){var C=this.tokens[I].attr("size");if(B!=0){this.tokens[I].attr("size",C/B)}if(C<=F){if(G.settings.sedimentation.flocculate.strategy!=null){G.flocculate.destroyIt(G,this.tokens[I]);G.strata.update(G)}}}}}})(jQuery);(function(A){A.fn._vs.flocculate={buffer:[],init:function(C){for(var B=0;B<C.settings.data.model.length;B++){this.buffer[B]=[]}},addtobuffer:function(C,B){c=B.attr("category");bufferSize=C.settings.sedimentation.flocculate.bufferSize;this.buffer[c].push(B);C.decay.tokens.splice(C.decay.tokens.indexOf(B),1);B.attr("callback","bufferFlocculation",B);if(this.buffer[c].length>bufferSize){this.update(C,c,bufferSize)}},destroyIt:function(D,C){C.attr("callback","flocculation",C);C.attr("state",2);var B=D.world.DestroyBody(C.myobj.GetBody());return B},update:function(E,D,B){if(E.settings.sedimentation.flocculate.number==1){while(this.buffer[D].length>B){var C=this.buffer[D].shift();this.destroyIt(E,C)}}else{while(this.buffer[D].length>E.settings.sedimentation.flocculate.number){var C=this.buffer[D].shift();this.destroyIt(E,C)}}},disapear:function(C,B){window.setInterval(function(){B.update(self)},self.settings.options.refresh/2)},all:function(C){for(var B=C.decay.tokens-1;B>=0;B--){this.update(C,B,C.tokens.length)}},strategy:function(){if(flocullateBuffer.length>0){if(chart.flocullate.strategy=="Size"&&flocullateBuffer.length>=chart.flocullate.bufferSize){flocullateByArray(flocullateBuffer)}else{if(chart.flocullate.strategy=="Time"){}else{if(chart.flocullate.strategy=="Height"){}}}}}}})(jQuery);(function(A){A.fn._vs.aggregate={defaultSettings:{},strata_layers:function(H,G,B,D){var F=d3.scale.linear().domain([1,B-2]).range([Math.PI/2,2*Math.PI-Math.PI/2]);var C=d3.scale.pow().exponent(10).domain([0,B]).range([0,1]);return d3.range(G).map(function(I){var J=5*Math.random();return d3.range(B).map(function(L){if(H.settings.sedimentation.aggregation.strataType=="sin"){if(I==1){return 20}var K=5+J*5*Math.sin(F(L))+(I*50);if(K<0){return -K}else{return K}}else{if(H.settings.sedimentation.aggregation.strataType=="log"){return I+1}else{if(typeof(D)=="undefined"){D=0}return H.settings.data.strata[D][I].value}}}).map(E)});function E(J,I){return{x:I,y:Math.max(0,J)}}},init:function(L){if(typeof(L.settings.data.strata)=="undefined"||L.settings.data.strata.length==0||L.settings.data.strata[0].length==0){return}var M=L.token.colorRange;if(L.settings.chart.type=="StackedAreaChart"){var E=L.settings.chart.width/L.settings.data.model.length,O=L.settings.sedimentation.aggregation.height;var G=d3.select("#"+L.settings.DOMelement.id).append("div").attr("class","vis").style("z-index",10).append("svg").attr("width",L.settings.width).attr("height",L.settings.height).append("g").attr("transform","translate("+L.settings.chart.x+","+L.settings.chart.y+")");var Q=G.selectAll("g.gcol").data(L.settings.data.strata,function(V){return[V]}).enter().append("g").attr("transform",function(W,V){return"translate("+(V*E)+", "+(L.settings.chart.height-L.settings.sedimentation.aggregation.height)+")"}).attr("class",function(W,V){return"gcol col_"+V});var U=L.settings.data.strata.map(function(V){return{value:V[0].value}});var R=L.settings.data.strata[0].length,S=20;smx=S-1,smy=0;var D=0;var T=d3.svg.area().x(function(V){return L.settings.chart.spacer+V.x*(E-2*L.settings.chart.spacer)/smx}).y0(function(V){return(O-V.y0*D)}).y1(function(V){return(O-(V.y+V.y0)*D)});var K=[];var B=Q.selectAll("gpath").data(function(X,V){var W=d3.layout.stack().offset("expand")(L.aggregate.strata_layers(L,X.length,S,V));smy=d3.max(W,function(Y){return d3.max(Y,function(Z){return Z.y0+Z.y})});W.map(function(Y){Y.map(function(Z){Z.col=V;return Z})});return W}).enter().append("g").attr("class","gpath");B.append("path").attr("d",function(W,V){D=L.settings.chart.height-L.chart.getPosition(L)[W[0].col].y;return T(W)}).style("fill",function(W,V){if(L.settings.data.strata[W[0].col][V].texture!=null){return"url(#RectanglePattern_"+W[0].col+"_"+V+")"}else{return d3.rgb(M(W[0].col)).darker(L.settings.data.strata[W[0].col].length/2-(V+1)/2)}}).attr("class",function(W,V){return"layer"}).attr("class",function(W,V){return"col_"+W[0].col+" layer_"+V});var C=E/1;var I=C;for(var F=0;F<L.settings.data.strata.length;F++){for(var J=0;J<L.settings.data.strata[F].length;J++){if(L.settings.data.strata[F][J].texture!=null){var P=G.append("pattern").attr("id","RectanglePattern_"+F+"_"+J).attr("height",I).attr("width",C).attr("patternTransform","translate(0, 0) scale("+L.settings.data.strata[F][J].texture.size+", "+L.settings.data.strata[F][J].texture.size+") rotate(0)").attr("patternUnits","userSpaceOnUse");P.append("image").attr("x",0).attr("y",0).attr("height",I).attr("width",C).attr("xlink:href",function(){return L.settings.data.strata[F][J].texture.url})}}}}else{if(L.settings.chart.type=="CircleLayout"){var H=d3.select("#"+L.settings.DOMelement.id).append("div").attr("class","vis").attr("width",L.settings.width).attr("height",L.settings.height).append("svg").attr("width",L.settings.width).attr("height",L.settings.height);if(typeof(L.settings.chart.treeLayout)!="undefined"){for(var N=0;N<L.settings.data.model.length;N++){var U=L.settings.data.strata[N];var M=function(V){return L.token.colorRange(N)};L.aggregate.create_pie_chart(L,U,H,U[0].value,M,((N+1/2))*L.settings.chart.width/(L.settings.data.model.length)+L.settings.chart.x,L.settings.chart.y+L.settings.chart.height/6)}}else{var U=L.settings.data.strata.map(function(V){return{value:V[0].value}});console.log(L.settings.data.strata,U);var M=L.token.colorRange;L.aggregate.create_pie_chart(L,U,H,L.settings.chart.radius,M,L.settings.chart.x+L.settings.chart.width/2,L.settings.chart.y+L.settings.chart.height/2)}}}},create_pie_chart:function(O,T,K,J,P,N,M){var H=O.settings.width/O.settings.data.model.length,R=O.settings.sedimentation.aggregation.height;var G=d3.scale.linear().domain([0,O.settings.data.strata.length-1]).range([0,O.settings.width]);var F=d3.scale.linear().domain([0,d3.max(T,function(U){return U.value})]).rangeRound([0,R]);var C=O.settings.width,B=O.settings.height,I=O.settings.sedimentation.aggregation.height;labelr=J+30,donut=d3.layout.pie().sort(null),arc=d3.svg.arc().innerRadius(0).outerRadius(J);var L=Math.random();K.append("g.arcs_"+L).attr("class","arcs_"+L);var E=K.selectAll(".arcs").data(donut(T.map(function(V,U){return V.value}))).enter().append("svg:g").attr("transform","translate("+N+","+M+")");var D=0;var S=d3.svg.area().x(function(U){return O.settings.chart.spacer+U.x*(H-2*O.settings.chart.spacer)/smx}).y0(function(U){return(R-U.y0*D)}).y1(function(U){return(R-(U.y+U.y0)*D)});var Q=E.append("path").attr("fill",function(V,U){return P(U)}).attr("d",function(V,U){return arc(V)}).each(function(U){this._current=U})},update:function(K){if(typeof(K.settings.data.strata)=="undefined"||K.settings.data.strata.length==0||K.settings.data.strata[0].length==0){return}var N=K.settings.chart.width/K.settings.data.model.length;var I=K.settings.sedimentation.aggregation.height;var M=d3.scale.linear().domain([0,K.settings.data.strata.length-1]).range([0,K.settings.width]);var H=K.settings.data.strata.map(function(P){return{value:P[0].value}});var O=K.settings.data.strata.map(function(R){for(var P=0,Q=0;P<R.length;P++){Q+=R[P].value}return Q});var L=d3.scale.linear().domain([0,d3.max(O)]).range([0,K.settings.sedimentation.aggregation.height]);var E=K.settings.data.strata[0].length,F=20;smx=F-1,smy=0;var G=0;var D=d3.svg.area().x(function(P){return K.settings.chart.spacer+P.x*(N-2*K.settings.chart.spacer)/smx}).y0(function(P){return(I-P.y0*G)}).y1(function(P){return(I-(P.y+P.y0)*G)});var C=d3.select("svg");var J=C.selectAll(".gcol");J.data(K.settings.data.strata,function(Q,P){return[Q]});var B=J.selectAll(".gpath").data(function(R,P){var Q=d3.layout.stack().offset("expand")(K.aggregate.strata_layers(K,R.length,F,P));smy=d3.max(Q,function(S){return d3.max(S,function(T){return T.y0+T.y})});Q.map(function(S){S.map(function(T){T.col=P;return T})});return Q});B.select("path").transition().duration(100).attr("d",function(Q,P){K.chartUpdate(P,-L(O[P])-(I-K.settings.chart.height));G=K.settings.chart.height-K.chart.getPosition(K)[Q[0].col].y;return D(Q)})}}})(jQuery);(function($){$.fn._vs.strata={stratas:[],init:function(_this){if(_this.settings.chart.type!="StackedAreaChart"){_this.strata.create_strata(_this);return}settings=_this.settings;if((typeof(settings.data.strata)!="function")&&(typeof(settings.data.strata)=="undefined"||settings.data.strata.length==0)){for(var i=0;i<settings.data.model.length;i++){var defaultStrata={label:settings.data.model[i].label+"_"+i,category:i,value:function(t,s){return 0},};_this.strata.stratas[i]=[defaultStrata]}_this.strata.create_strata(_this);return}if(typeof settings.data.strata!="function"){if(typeof(settings.data.strata=="object")&&typeof(settings.data.strata[0])!="undefined"&&(typeof settings.data.strata[0][0].value!="undefined")&&typeof(settings.data.strata[0][0].value=="string")){var NB_STRATA=settings.data.strata[0].length;for(var i=0;i<settings.data.model.length;i++){_this.strata.stratas[i]=[];for(var n=0;n<NB_STRATA;n++){(function(a,b){var t=null;if((typeof settings.data.strata[a]!="undefined")&&(typeof settings.data.strata[a][b]!="undefined")&&(typeof settings.data.strata[a][b].texture!="undefined")){t=settings.data.strata[a][b].texture}var defaultStrata={};defaultStrata={label:settings.data.model[i].label+"_"+a,category:a,texture:t,value:function(){r=eval("f="+settings.data.strata[a][b].value);return r()}};_this.strata.stratas[a].push(defaultStrata)})(i,n)}}_this.strata.create_strata(_this);return}if(typeof(settings.data.strata[0])!="undefined"&&typeof(settings.data.strata[0][0])!="undefined"&&typeof(settings.data.strata[0][0].initValue!="undefined")){for(var c=0;c<settings.data.model.length;c++){var defaultStrata={label:settings.data.model[c].label+"_"+c,category:i,value:function(t,s){if(t.selectAll("category",s)){return settings.data.strata[s][0].initValue+t.selectAll("category",s).attr("state").filter(function(d){if(d==2){return d}}).length}else{return settings.data.strata[s][0].initValue}},};_this.strata.stratas[c]=[defaultStrata]}_this.strata.create_strata(_this);return}else{if(settings.data.strata[0].length==0){for(var i=0;i<settings.data.model.length;i++){var defaultStrata={label:settings.data.model[i].label+"_"+i,category:i,value:function(t,s){if(t.selectAll("category",s)){return t.selectAll("category",s).attr("state").filter(function(d){if(d==2){return d}}).length}else{return 0}},};_this.strata.stratas[i]=[defaultStrata]}_this.strata.create_strata(_this);return}else{var NB_STRATA=settings.data.strata[0].length;settings.data.strata_param=settings.data.strata;function fstrata(){var a=Array();for(var s=0;s<mySettings.data.model.length;s++){a.push(fstratum(s))}return a}function fstratum(a){var b=Array(NB_STRATA);for(var r=0;r<b.length;r++){b[r]=Array()}if(typeof _this!="undefined"){var tokens=_this.selectAll("category",s).attr("state").filter(function(d){if(d==2){return d}}).length;for(var k=0;k<tokens.length;k++){var tk=tokens[k];for(var r=0;r<b.length;r++){if(tk<_this.settings.stream.now-2*(r)&&tk>=_this.settings.stream.now-2*(r+1)){b[b.length-r-1].push(tk)}}}}var res=Array();for(var j=0;j<NB_STRATA;j++){var val=b[j].length;(function(v){res.push({value:function(){return v},label:"Strata "+j,category:a})})(val)}return res}_this.settings.data.strata=function(){return fstrata()};_this.strata.stratas=_this.settings.data.strata();_this.strata.create_strata(_this);return}}}if((typeof settings.data.strata=="function")||settings.data.strata[0].length>0||_this.strata.stratas.length>0){if(typeof settings.data.strata=="function"||(settings.data.strata[0].length>0&&typeof(settings.data.strata[0])=="object")){if(typeof settings.data.strata=="function"){_this.strata.stratas=settings.data.strata()}else{if(typeof settings.data.strata[0].value=="function"){for(var i=0;i<settings.data.model.length;i++){var defaultStrata={label:settings.data.model[i].label+"_"+i,category:i,initValue:settings.data.model[i].value,value:function(t,s){return settings.data.strata[i]},};_this.strata.stratas[i]=[defaultStrata]}}else{for(var i=0;i<settings.data.model.length;i++){var defaultStrata={label:settings.data.model[i].label+"_"+i,category:i,initValue:settings.data.model[i].value,value:function(t,s){if(typeof(t.selectAll("category",s).length)=="undefined"){return this.initValue}if(t.selectAll("category",s)){return this.initValue+t.selectAll("category",s).attr("state").filter(function(d){if(d==2){return d}}).length}else{return 0}},};_this.strata.stratas[i]=[defaultStrata]}}}}_this.strata.create_strata(_this)}},selectAll:function(_this,key,value){result=[];result.attr=function(key,value,param){var r=[];result.forEach(function(i){q=i.attr(key,value,param);r.push(q)});return r};if(typeof(value)=="undefined"&&typeof(key)=="undefined"){return this.stratas}else{for(var i=_this.strata.stratas.length-1;i>=0;i--){if(_this.strata.stratas[i].attr(key)==value){result.push(_this.strata.stratas[i]);break}}}if(typeof(result[0])=="undefined"){return false}else{return result[0]}},add:function(_this,setting){var strata=function(){};strata.myobj=setting;strata.attr=function(key,value,param){if(typeof(value)=="undefined"){if(typeof(this[key])!="undefined"){return this[key]()}else{return this.myobj[key]}}else{if(typeof(this[key])!="undefined"){this[key](value,param)}else{this.myobj[key]=value}}return this};return strata},remove:function(_this,key,value){},strata_layers:function(_this,n,m,p){var sn=d3.scale.linear().domain([1,m-2]).range([Math.PI/2,2*Math.PI-Math.PI/2]);var logscale=d3.scale.pow().exponent(10).domain([0,m]).range([0,1]);return d3.range(n).map(function(i){var r=5*Math.random();return d3.range(m).map(function(j){if(_this.settings.sedimentation.aggregation.strataType=="sin"){if(i==1){return 20}var x=5+r*5*Math.sin(sn(j))+(i*50);if(x<0){return -x}else{return x}}else{if(_this.settings.sedimentation.aggregation.strataType=="log"){return i+1}else{if(typeof(p)=="undefined"){p=0}return _this.strata.stratas[p][i].value(_this,p)}}}).map(stream_index)});function stream_index(d,i){return{x:i,y:Math.max(0,d)}}},create_strata:function(_this){if(_this.settings.chart.type=="StackedAreaChart"){var w=_this.settings.chart.width/_this.settings.data.model.length,h=_this.settings.sedimentation.aggregation.height;var color=_this.token.colorRange;if(typeof _this.settings.options.canvasFirst!="undefined"&&_this.settings.options.canvasFirst==false){var vis=d3.select("#"+_this.settings.DOMelement.id).insert("div",":first-child").style("position","absolute").attr("class","vis").style("z-index",10).append("svg").attr("width",_this.settings.width).attr("height",_this.settings.height).append("g").attr("transform","translate("+_this.settings.chart.x+","+_this.settings.chart.y+")")}else{var vis=d3.select("#"+_this.settings.DOMelement.id).append("div").attr("class","vis").style("z-index",10).append("svg").attr("width",_this.settings.width).attr("height",_this.settings.height).append("g").attr("transform","translate("+_this.settings.chart.x+","+_this.settings.chart.y+")")}var sn=_this.strata.stratas[0].length,sm=20;smx=sm-1,smy=0;var sum_strata=_this.strata.stratas.map(function(d,i){for(var v=0,res=0;v<d.length;v++){res+=d[v].value(_this,i)}return res});var y=d3.scale.linear().domain([0,Math.max(d3.max(sum_strata),_this.settings.sedimentation.aggregation.maxData)]).range([0,_this.settings.sedimentation.aggregation.height]);var g=vis.selectAll("g.gcol").data(_this.strata.stratas,function(d){return[d]}).enter().append("g").attr("transform",function(d,i){var align=_this.settings.sedimentation.aggregation.height;if(_this.settings.sedimentation.aggregation.invertStrata){align=2*_this.settings.sedimentation.aggregation.height-y(sum_strata[i])}return"translate("+(i*w)+", "+(_this.settings.chart.height-align)+")"}).attr("class",function(d,i){return"gcol col_"+i});var gpath=g.selectAll(".gpath").data(function(d,i){var sd=d3.layout.stack().offset("expand")(_this.strata.strata_layers(_this,d.length,sm,i));smy=d3.max(sd,function(d){return d3.max(d,function(d){return d.y0+d.y})});sd.map(function(d){d.map(function(d){d.col=i;return d})});return sd}).enter().append("g").attr("class","gpath");var area=d3.svg.area().x(function(d){return _this.settings.chart.spacer+d.x*(w-2*_this.settings.chart.spacer)/smx}).y0(function(d){return(h-d.y0*d.offshit)}).y1(function(d){return(h-(d.y+d.y0)*d.offshit)});var pathlayer=gpath.append("path").attr("d",function(d,i){_this.chartUpdate(i,-y(sum_strata[i])-(h-_this.settings.chart.height));hh=0;d.map(function(dd){dd.offshit=hh;return dd});return area(d)});pathlayer.style("fill",function(d,i){if(_this.strata.stratas[d[0].col][i].texture!=null){return"url(#RectanglePattern_"+d[0].col+"_"+i+")"}else{return d3.rgb(color(d[0].col)).darker(_this.strata.stratas[d[0].col].length/2-(i+1)/2)}}).attr("class",function(d,i){return"gcol col_"+d[0].col+" layer_"+i});var patternWidth=w/1;var patternHeight=patternWidth;if(typeof _this.settings.data.strata!="undefined"){for(var s=0;s<_this.settings.data.strata.length;s++){for(var l=0;l<_this.settings.data.strata[s].length;l++){if(_this.settings.data.strata[s][l].texture!=null){var pattern=vis.append("pattern").attr("id","RectanglePattern_"+s+"_"+l).attr("height",patternHeight).attr("width",patternWidth).attr("patternTransform","translate(0, 0) scale("+_this.settings.data.strata[s][l].texture.size+", "+_this.settings.data.strata[s][l].texture.size+") rotate(0)").attr("patternUnits","userSpaceOnUse");pattern.append("image").attr("x",0).attr("y",0).attr("height",patternHeight).attr("width",patternWidth).attr("xlink:href",function(){return _this.settings.data.strata[s][l].texture.url})}}}}}else{if(_this.settings.chart.type=="CircleLayout"){var svg=d3.select("#"+_this.settings.DOMelement.id).append("div").attr("class","vis").attr("width",_this.settings.width).attr("height",_this.settings.height).append("svg").attr("width",_this.settings.width).attr("height",_this.settings.height);if(typeof(_this.settings.chart.treeLayout)!="undefined"){for(var i=0;i<_this.settings.data.model.length;i++){var data=_this.settings.data.strata[i];var color=function(s){return _this.token.colorRange(i)};_this.strata.create_pie_chart(_this,data,svg,data[0].value,color,((i+1/2))*_this.settings.chart.width/(_this.settings.data.model.length)+_this.settings.chart.x,_this.settings.chart.y+_this.settings.chart.height/6)}}else{var data=_this.settings.data.strata.map(function(d){return{value:d[0].value}});var color=_this.token.colorRange;_this.strata.create_pie_chart(_this,data,svg,_this.settings.chart.radius,color,_this.settings.chart.x+_this.settings.chart.width/2,_this.settings.chart.y+_this.settings.chart.height/2)}}}},create_pie_chart:function(_this,data,svg,r,color,posx,posy){var w=_this.settings.width/_this.settings.data.model.length,h=_this.settings.sedimentation.aggregation.height;var x=d3.scale.linear().domain([0,_this.settings.data.strata.length-1]).range([0,_this.settings.width]);var y=d3.scale.linear().domain([0,d3.max(data,function(d){return d.value})]).rangeRound([0,h]);var wp=_this.settings.width,hp=_this.settings.height,hhp=_this.settings.sedimentation.aggregation.height;labelr=r+30,donut=d3.layout.pie().sort(null),arc=d3.svg.arc().innerRadius(0).outerRadius(r);var id=Math.random();svg.append("g.arcs_"+id).attr("class","arcs_"+id);var garcs=svg.selectAll(".arcs").data(donut(data.map(function(d,i){return d.value}))).enter().append("svg:g").attr("transform","translate("+posx+","+posy+")");var hh=0;var area=d3.svg.area().x(function(d){return _this.settings.chart.spacer+d.x*(w-2*_this.settings.chart.spacer)/smx}).y0(function(d){return(h-d.y0*hh)}).y1(function(d){return(h-(d.y+d.y0)*hh)});var arcs=garcs.append("path").attr("fill",function(d,i){return color(i)}).attr("d",function(d,i){return arc(d)}).each(function(d){this._current=d})},update:function(_this){if(typeof(_this.strata.stratas)=="undefined"||_this.strata.stratas.length==0){return}if(typeof settings.data.strata=="function"){_this.strata.stratas=settings.data.strata()}var sn=_this.strata.stratas[0].length,sm=20;smx=sm-1,smy=0;var w=_this.settings.chart.width/_this.settings.data.model.length,h=_this.settings.sedimentation.aggregation.height;var color=_this.token.colorRange;var area=d3.svg.area().x(function(d){return _this.settings.chart.spacer+d.x*(w-2*_this.settings.chart.spacer)/smx}).y0(function(d){return(h-d.y0*d.offshit)}).y1(function(d){return(h-(d.y+d.y0)*d.offshit)});var sum_strata=_this.strata.stratas.map(function(d,i){for(var v=0,res=0;v<d.length;v++){res+=d[v].value(_this,i)}return res});var y=d3.scale.linear().domain([0,Math.max(d3.max(sum_strata),_this.settings.sedimentation.aggregation.maxData)]).range([0,_this.settings.sedimentation.aggregation.height]);var vis=d3.select("#"+_this.settings.DOMelement.id);var g=vis.selectAll("g.gcol");if(_this.settings.sedimentation.aggregation.invertStrata){g.transition().duration(100).attr("transform",function(d,i){var align=_this.settings.sedimentation.aggregation.height;align=2*_this.settings.sedimentation.aggregation.height-y(sum_strata[i]);return"translate("+(i*w)+", "+(_this.settings.chart.height-(2*_this.settings.sedimentation.aggregation.height-y(sum_strata[i])))+")"})}var gpath=g.selectAll("path").data(function(d,i){var sd=d3.layout.stack().offset("expand")(_this.strata.strata_layers(_this,d.length,sm,i));smy=d3.max(sd,function(d){return d3.max(d,function(d){return d.y0+d.y})});sd.map(function(d){d.map(function(d){d.col=i;return d})});return sd});if(_this.settings.chart.type=="StackedAreaChart"){var pathlayer=vis.selectAll("path").transition().duration(100).attr("d",function(d,i){if(!_this.settings.sedimentation.aggregation.invertStrata){_this.chartUpdate(i,-y(sum_strata[i])-(h-_this.settings.chart.height));hh=_this.settings.chart.height-_this.chart.getPosition(_this)[d[0].col].y}else{_this.chartUpdate(i,-2*h+_this.settings.chart.height);hh=y(sum_strata[d[0].col])}d.map(function(dd){dd.offshit=hh;return dd});return area(d)})}}}})(jQuery);(function(A){A.fn._vs.chart.StackedAreaChart=function(F,E,D){var C;this.init=function(G){gravity=new G.phy.b2Vec2(0.001,10);G.world.m_gravity=gravity;G.chartPhySetup={grounds:[],wall:[]};this.setupChartPhysics(G)};this.setupChartPhysics=function(L){var M=L.settings.chart.spacer;var O=(L.settings.chart.width/L.settings.data.model.length);var H=M;var P=L.settings.chart.height/2+L.settings.chart.y;var N=L.settings.chart.height-L.settings.sedimentation.aggregation.height;var I=0;for(var K=0;K<L.settings.data.model.length;K++){L.settings.data.model[K].value=0;if(typeof(L.settings.data.strata)!="undefined"){if(typeof(L.settings.data.strata[K])!="undefined"){for(var J=0;J<L.settings.data.strata[K].length;J++){L.settings.data.model[K].value+=L.settings.data.strata[K][J].value}}}I+=L.settings.data.model[K].value}for(var K=0;K<L.settings.data.model.length+1;K++){var G=L.settings.chart.x+(K*O);L.chartPhySetup.wall[K]=this.createMyChartBox(L,G,P,H,L.settings.chart.height/2,"wall",L.settings.chart.wallColor);if(K<L.settings.data.model.length){L.settings.sedimentation.incoming.point[K]={x:G+(O/2),y:L.settings.y}}if(K<L.settings.data.model.length){L.chartPhySetup.grounds[K]=this.createMyChartBox(L,G+(O/2),L.settings.chart.height+L.settings.chart.y+L.settings.sedimentation.aggregation.height,O/2,L.settings.chart.height,"lift","rgba(250,250,250,0)");this.update(L,{cat:K,y:L.settings.chart.height})}}};this.token=function(J,G){var I=G;var H={x:(J.settings.sedimentation.incoming.point[I].x+(Math.random()*2)),y:(J.settings.sedimentation.incoming.point[I].y+(Math.random()*1)),t:J.now(),size:J.settings.sedimentation.token.size.original,category:I,lineWidth:0,};return H};this.createMyChartBox=function(M,P,O,Q,L,N,J){var I=M.settings.options.scale;var G=new M.phy.b2FixtureDef;G.density=1;G.friction=0.5;G.restitution=0.2;var H=new M.phy.b2BodyDef;H.type=M.phy.b2Body.b2_staticBody;G.shape=new M.phy.b2PolygonShape;G.shape.SetAsBox(Q/I,L/I);H.position.Set(P/I,O/I);var K=M.world.CreateBody(H).CreateFixture(G);K.m_userData={type:N,fillStyle:J,w:Q,h:L,x:P,y:O};return K};this.update=function(K,J){var I={cat:0,y:0};if(K.chartPhySetup.grounds[J.cat]!=null){var H=K.chartPhySetup.grounds[J.cat].GetBody();var G=H.GetWorldCenter();G.y=(J.y+K.settings.chart.height+K.settings.chart.y+K.settings.sedimentation.aggregation.height)/K.settings.options.scale;H.SetPosition(G)}};this.getPositionOld=function(I){var G=[];for(var H=0;H<I.chartPhySetup.grounds.length;H++){myElement=I.chartPhySetup.grounds[H];myBody=myElement.GetBody();G.push({x:(myBody.GetWorldCenter().x*I.settings.options.scale),y:(myBody.GetWorldCenter().y*I.settings.options.scale),a:myBody.GetAngle(),w:myElement.m_userData.w,h:myElement.m_userData.h,r:myElement.m_userData.r,})}return G};this.getPosition=function(I){var G=[];for(var H=0;H<I.chartPhySetup.grounds.length;H++){myElement=I.chartPhySetup.grounds[H];myBody=myElement.GetBody();G.push({x:(myBody.GetWorldCenter().x*I.settings.options.scale),y:(myBody.GetWorldCenter().y*I.settings.options.scale)-I.settings.chart.height-I.settings.chart.y,a:myBody.GetAngle(),w:myElement.m_userData.w,h:myElement.m_userData.h,r:myElement.m_userData.r,})}return G};if(typeof(E)!=undefined){var B=this[E](F,D);if(typeof(B)!=undefined){return B}}}})(jQuery);(function(A){A.fn._vs.chart.CircleLayout=function(I,M,Q){var H;var K;var J;var G;var N=[];var E=0;var I;this.init=function(U,S){console.log("Circle Layout Init");this._this=U;gravity=new U.phy.b2Vec2(0,0);U.world.m_gravity=gravity;U.chartPhySetup={grounds:[],wall:[]};this.treeLayout=U.settings.chart.treeLayout;for(var T=0;T<U.settings.data.model.length;T++){U.settings.data.strata[T][0].value=U.settings.data.strata[T][0].initValue}for(var T=0;T<U.settings.data.model.length;T++){U.settings.data.model[T].value=0;for(var R=0;R<U.settings.data.strata[T].length;R++){U.settings.data.model[T].value+=U.settings.data.strata[T][R].value}N.push(U.settings.data.model[T].value);E+=U.settings.data.model[T].value}if(this.treeLayout){console.log("ici");this.setupBubbleChartPhysics(U)}else{this.setupPieChartPhysics(U)}};this.setupPieChartPhysics=function(X){console.log("w",X.settings.width);var S=X.settings.chart.radius;K=X.settings.chart.width/2+X.settings.chart.x;J=X.settings.chart.height/2+X.settings.chart.y;var V=O(K,J,S,X.settings.chart.wallColor);for(var U=0;U<X.settings.data.model.length;U++){X.settings.sedimentation.incoming.target[U]={x:K,y:J}}var R=[];var T=X.settings.chart.spacer;var W=0;console.log("tdv",E);if(E==0){for(var U=0;U<X.settings.data.length;U++){N[U]=1}E=N.length}for(var U=0;U<N.length;U++){v=N[U];a2=((v/2+W)/E)*360-90;W+=v;a=(W/E)*360-90;c=L(a2,S*5,K,J);console.log(c);X.settings.sedimentation.incoming.point[U]=c;X.chartPhySetup.grounds[U]=this.createBox(X,K,J,T,S,a,S,"wall",X.settings.chart.wallColor)}console.log("w",X.settings.chart.width)};this.update=function(Y,U){console.log("update");var T={cat:0,r:0};U.r-=90;var W=(U.r+90)*(Math.PI/180);var X=L(U.r,Y.settings.chart.radius,Y.settings.chart.width/2+Y.settings.chart.x,Y.settings.chart.height/2+Y.settings.chart.y);if(Y.chartPhySetup.grounds[U.cat]!=null){var S=Y.chartPhySetup.grounds[U.cat].GetBody();var R=S.GetWorldCenter();var V=S.GetAngle();R.y=X.y/Y.settings.options.scale;R.x=X.x/Y.settings.options.scale;V=W;S.SetPosition(R);S.SetAngle(V)}};this.token=function(U,R){var T=R;var S={x:(U.settings.sedimentation.incoming.point[T].x+(Math.random()*2)),y:(U.settings.sedimentation.incoming.point[T].y+(Math.random()*1)),t:U.now(),size:U.settings.sedimentation.token.size.original,category:T,phy:{density:10,friction:0,restitution:0},targets:[{x:U.settings.sedimentation.incoming.target[T].x,y:U.settings.sedimentation.incoming.target[T].y}]};return S};function L(T,S,X,U){j=T*Math.PI/180;var R=(Math.cos(j)*S)+X;var W=(Math.sin(j)*S)+U;var V={x:R,y:W};return V}function O(W,V,R,T){var Y=I.settings.options.scale;var X=new I.phy.b2FixtureDef;X.density=1;X.friction=0.5;X.restitution=0.2;var S=new I.phy.b2BodyDef;X.shape=new I.phy.b2CircleShape(R/Y);S.position.Set(W/Y,V/Y);var U=I.world.CreateBody(S).CreateFixture(X);U.m_userData={type:"wall",familyID:null,fillStyle:T,strokeStyle:T,r:R};return U}this.createBox=function(Z,g,e,k,Y,f,R,d,W){var V=Z.settings.options.scale;var S=new Z.phy.b2FixtureDef;var b=L(f,R,g,e);S.density=1;S.friction=0.5;S.restitution=0.2;var U=new Z.phy.b2BodyDef;var T=(f+90)*(Math.PI/180);U.angle=T;U.type=Z.phy.b2Body.b2_staticBody;S.shape=new Z.phy.b2PolygonShape;S.shape.SetAsBox(k/V,Y/V);U.position.Set(b.x/V,b.y/V);var X=Z.world.CreateBody(U).CreateFixture(S);X.m_userData={type:d,fillStyle:W,w:k,h:Y,r:R};return X};this.getPosition=function(T){var R=[];for(var S=0;S<T.chartPhySetup.grounds.length;S++){myElement=T.chartPhySetup.grounds[S];myBody=myElement.GetBody();R.push({x:(myBody.GetWorldCenter().x*T.settings.options.scale),y:(myBody.GetWorldCenter().y*T.settings.options.scale),a:myBody.GetAngle(),w:myElement.m_userData.w,h:myElement.m_userData.h,r:myElement.m_userData.r,})}return R};this.setupBubbleChartPhysics=function(Y){console.log("setupBubbleChartPhysics");var V=(Y.settings.chart.width/Y.settings.data.model.length);var T=Y.settings.chart.spacer;var S=Y.settings.chart.height/2+Y.settings.y+T;var W=0;var X=0;var R=Y.settings.chart.column;for(var U=0;U<Y.settings.data.model.length;U++){X=Y.settings.chart.x+(U%R*T)+(T/2);W=Y.settings.chart.y+Math.floor(U/R)*T+(T/2);Y.settings.sedimentation.incoming.target[U]={x:X,y:W};O[U]=C(X,W,Y.settings.chart.spacer,U);Y.settings.data.model[U].incomingPoint={x:X,y:W}}};function C(b,W,X,S){console.log("CreatMyBubblePivot",b,W,X,S);var U=I.settings.options.scale;var R=new I.phy.b2FixtureDef;var Z=d3.scale.category10();R.density=10000;R.friction=0;R.restitution=0;var V=new I.phy.b2BodyDef;R.shape=new I.phy.b2CircleShape(X*U);V.position.Set(b/U,W/U);var T=I.world.CreateBody(V);var Y=T.CreateFixture(R);console.log(S,Z(S));Y.m_userData={type:"BubblePivot",familyID:S,fillStyle:I.settings.chart.wallColor};console.log(S,Y);Y.m_shape.m_radius=I.settings.data.model[S].value/U;return Y}this.getPivotPosition=function(T){if(typeof(T)!="undefined"){return this.pivot}else{var R=[];for(var S=0;S<I.settings.data.model.length;S++){R.push(I.settings.data.model[S])}return R}};function D(S,U,T){var R=O[T].GetBody();R.SetPosition(new b2Vec2(S/scale,U/scale));I.settings.data.model[T].incomingPoint.x=S;I.settings.data.model[T].incomingPoint.y=U;setFlowSpeed(speedFlow)}function B(R,U,T){for(var S=0;S<categorys[T].joins.length;S++){categorys[T].joins[S].SetTarget(new b2Vec2(R/scale,U/scale))}}function F(R,S){O[S].m_shape.m_radius=R}if(typeof(M)!=undefined){var P=this[M](I,Q);if(typeof(P)!=undefined){return P}}}})(jQuery);
\ No newline at end of file
+
+/*
+ * Main VS Code
+ * 
+ */
+(function(B){B.fn.vs=function(){};B.fn._vs={};B.fn._vs.token={};B.fn._vs.draw={};B.fn._vs.stream={};B.fn._vs.chart={};B.fn._vs.phy={};B.fn._vs.decay={};B.fn._vs.flocculate={};B.fn._vs.strata={};B.fn._vs.aggregate={};var A=function(E,O){this.token=B.fn._vs.token;this.draw=B.fn._vs.draw;this.stream=B.fn._vs.stream;this.chart=B.fn._vs.chart;this.phy=B.fn._vs.phy;this.decay=B.fn._vs.decay;this.flocculate=B.fn._vs.flocculate;this.strata=B.fn._vs.strata;this.requestAnimFrame;this.mouse={};this.mouse.x=0;this.mouse.y=0;this.mouse.isMouseDragging=false;this.mouse.isMouseDown=false;this.mouse.selectedBody=null;this.dataFlow=[];this.chartPhySetup={};this.tokens=[];this.world=null;this.ctx=null;var D=B(E);var M=this;var L=[];var N;var C;var H={x:0,y:0,width:290.5,height:300.5,DOMelement:null,chart:{x:undefined,y:undefined,width:undefined,height:undefined,colorRange:d3.scale.category10(),scale:d3.scale,type:"StackedAreaChart",spacer:5,column:3,wallColor:"rgba(230,230,230,0)",label:true,radius:10},data:{model:[{label:"Column A"},{label:"Column B"},{label:"Column C"},],strata:[[{initValue:100,label:"Strata 1 col A"}],[{initValue:20,label:"Strata 1 col B"}],[{initValue:175,label:"Strata 2 col C"}]],token:[{timestamp:1,category:1,value:1,userdata:{},callback:{}}],tokenPast:0,stream:{provider:"generator",refresh:10000/8,now:0},},sedimentation:{token:{size:{original:4,minimum:2},visible:true},incoming:{strategy:1,point:[{x:50,y:0},{x:100,y:0},{x:150,y:0}],target:[{x:50,y:0},{x:100,y:0},{x:150,y:0}]},granulate:{visible:false},flocculate:{number:1,action:"buffer",strategy:"Size",bufferSize:5,bufferTime:1000,bufferHeight:50,bufferFrameRate:25,buffer:[]},suspension:{height:null,incomming:"top",decay:{power:1.001},refresh:200},accumulation:{height:null},aggregation:{height:0,maxData:0,invertStrata:false},},options:{refresh:1000/25,panel:false,scale:30,layout:false,canvasFirst:true}};this.now=function(){return(new Date().getTime())};this.globalDecay=function(P){if(typeof(P)=="undefined"){return this.settings.sedimentation.suspension.decay.power}else{return this.settings.sedimentation.suspension.decay.power=P}};this.getWorld=function(){return this.world};this.chartUpdate=function(P,R){var Q={cat:P,y:R};this.chart[this.settings.chart.type](M,"update",Q)};this.flocculateTokens=function(P){return this.flocculate.update(M,P)};this.flocculateAll=function(){return this.flocculate.all(M)};this.addToken=function(P){return this.token.addToken(M,P)};this.selectAll=function(P,Q){return this.token.selectAll(M,P,Q)};this.select=function(P,Q){return this.token.select(M,P,Q)};this.updateAll=function(P){var Q=this.chart.updateAll(M,key,value);return Q};this.update=function(P,Q){var R=this.chart.update(M,P,Q);return R};function J(S,R){var Q={};for(var P in S){Q[P]=S[P]}for(var P in R){Q[P]=R[P]}return Q}J(H,O);if(O.data!=undefined){H.data=O.data}this.settings=B.extend(true,H,O);this.settings.DOMelement=E;if(typeof(this.settings.chart.width)=="undefined"){this.settings.chart.width=this.settings.width}if(typeof(this.settings.chart.x)=="undefined"){this.settings.chart.x=0}if(typeof(this.settings.chart.y)=="undefined"){this.settings.chart.y=0}if(typeof(this.settings.chart.height)=="undefined"){this.settings.chart.height=this.settings.height}if(typeof(this.settings.stream)=="undefined"){this.settings.stream={}}if(typeof(this.settings.stream.now)=="undefined"){this.settings.stream.now=0}if(typeof(this.settings.stream.provider)=="undefined"){this.settings.stream.provider="generator"}if(typeof(this.settings.stream.refresh)=="undefined"){this.settings.stream.refresh=1000}if(typeof(this.settings.data.tokenPast)=="undefined"){this.settings.data.tokenPast=0}if(typeof(this.settings.data.tokens)=="undefined"){this.settings.data.tokens=[]}if(typeof(this.settings.data.strata)!="undefined"&&this.settings.data.strata.length!=0){if(typeof(this.settings.sedimentation.aggregation)=="undefined"){this.settings.sedimentation.aggregation={}}if(typeof(this.settings.sedimentation.aggregation.height)=="undefined"){this.settings.sedimentation.aggregation.height=this.settings.chart.height/2}if(typeof(this.settings.sedimentation.aggregation.maxData)=="undefined"){this.settings.sedimentation.aggregation.maxData=10}}this.init=function(){this.requestAnimFrame=(function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(W,V){window.setTimeout(W,1000/60)}})();this.world=new this.phy.b2World(new this.phy.b2Vec2(0,0),true);var Q=E.appendChild(document.createElement("div"));Q.id="box_sediviz_"+I();Q.width=this.settings.width;Q.height=this.settings.height;this.settings.DOMelement=Q;C=Q.appendChild(document.createElement("canvas"));C.id="canvas";C.width=this.settings.width;C.height=this.settings.height;C.style.position="absolute";this.ctx=C.getContext("2d");this.chart[this.settings.chart.type](M,"init");this.stream.init(M);this.flocculate.init(M);this.stream.update(M);this.token.init(M);this.strata.init(this);window.setInterval(function(){M.update(M)},M.settings.options.refresh/2);window.setInterval(function(){M.draw.update(M)},M.settings.options.refresh);window.setInterval(function(){M.decay.update(M)},M.settings.sedimentation.suspension.refresh);M.strata.update(M);this.getBodyAtMouse=function(b){var V=b.mouse.x/b.settings.options.scale;var Z=b.mouse.y/b.settings.options.scale;var Y=new b.phy.b2Vec2(V,Z);var W=new b.phy.b2AABB();var X=0.001;W.lowerBound.Set(V-X,Z-X);W.upperBound.Set(V+X,Z+X);b.mouse.selectedToken=null;b.world.QueryAABB(function(d){return T(d,b,Y)},W);return b.mouse.selectedToken};function T(W,X,V){X.mouse.selectedToken=W;if(W.GetBody().GetType()!=X.phy.b2Body.b2_staticBody){if(W.GetShape().TestPoint(W.GetBody().GetTransform(),V)){X.mouse.selectedToken=W;return false}}return true}this.handleMouseMove=function(V,W){canvasPosition=F(W.settings.DOMelement);W.mouse.x=(V.clientX-(canvasPosition.offsetLeft-this.getScrollPosition()[0]));W.mouse.y=(V.clientY-(canvasPosition.offsetTop-this.getScrollPosition()[1]))};this.getScrollPosition=function(){return Array((document.documentElement&&document.documentElement.scrollLeft)||window.pageXOffset||M.pageXOffset||document.body.scrollLeft,(document.documentElement&&document.documentElement.scrollTop)||window.pageYOffset||M.pageYOffset||document.body.scrollTop)};document.addEventListener("mousemove",function(V){S(V,M)});document.addEventListener("mouseup",function(V){U(V,M)});document.addEventListener("mousedown",function(V){R(V,M)});function P(Y,b){var W=b.getBodyAtMouse(b);if(W!=null){if(typeof(W.m_userData)!="undefined"){if(typeof(W.m_userData.callback)!="undefined"){if(typeof(W.m_userData.callback.mouseover)=="function"){var V=b.select("ID",W.m_userData.ID);W.m_userData.callback.mouseover(V)}if(typeof(W.m_userData.callback.mouseout)=="function"){var V=b.select("ID",W.m_userData.ID);var Z;var X=function(){var e=Z;var g=V;var d=b;var f=W;return function(){var h=d.getBodyAtMouse(d);var k=false;if(h!=null){if(typeof(h.m_userData)!="undefined"){if(h.m_userData.ID==g.attr("ID")){k=false}else{k=true}}else{k=true}}else{k=true}if(k){f.m_userData.callback.mouseout(g);clearInterval(Z)}}};Z=window.setInterval(X(),100)}}}}}function R(X,Y){Y.mouse.isMouseDown=true;Y.handleMouseMove(X,Y);var W=Y.getBodyAtMouse(Y);if(W!=null){if(typeof(W.m_userData)!="undefined"){if(typeof(W.m_userData.callback)!="undefined"){if(typeof(W.m_userData.callback.onclick)=="function"){var V=Y.select("ID",W.m_userData.ID);W.m_userData.callback.onclick(V)}}}}}function U(V,W){W.mouse.isMouseDown=false}function S(V,W){if(W.mouse.isMouseDown){W.mouse.isMouseDragging=true;W.mouse.x=V.clientX;W.mouse.y=V.clientY}else{W.handleMouseMove(V,W);P("move",W)}}};this.mouse.update=function(Q){if(isMouseDown&&(!mouseJoint)){var P=getBodyAtMouse();if(P){var R=new b2MouseJointDef();R.bodyA=world.GetGroundBody();R.bodyB=P;R.target.Set(mouseX,mouseY);R.collideConnected=true;R.maxForce=300*P.GetMass();mouseJoint=world.CreateJoint(R);P.SetAwake(true)}}if(mouseJoint){if(isMouseDown){mouseJoint.SetTarget(new b2Vec2(mouseX,mouseY))}else{world.DestroyJoint(mouseJoint);mouseJoint=null}}};this.update=function(P){this.world.Step(1/60,10,10);this.world.DrawDebugData();this.world.ClearForces()};var G=function(){ctx.fillStyle="rgb(200,0,0)";this.ctx.font="14pt Calibri,Geneva,Arial";this.ctx.fillText("Canvas ready for Visual Sedimentation ",10,20);window.setInterval(B.fn.vs.draw.refresh(ctx,world,this.settings),this.settings.options.refresh);console.log("draw Init ")};var F=function(R){var Q=R.offsetTop;var P=R.offsetLeft;while(R=R.offsetParent){Q+=R.offsetTop;P+=R.offsetLeft}return{offsetLeft:P,offsetTop:Q}};var I=function(){var P=function(){return Math.floor(Math.random()*65536).toString(16)};return(P()+P()+"-"+P()+"-"+P()+"-"+P()+"-"+P()+P()+P())};function K(Q){if(null==Q||"object"!=typeof Q){return Q}var R=Q.constructor();for(var P in Q){if(Q.hasOwnProperty(P)){R[P]=Q[P]}}return R}this.utile={};this.utile.GUID=I;this.utile.clone=K;this.settings=B.extend(this.settings,{}||{});this.init()};B.fn.vs=function(C){if(!arguments.length){var C={}}return this.each(function(){var D=B(this);if(D.data("VisualSedimentation")){return}var E=new A(this,C);D.data("visualSedimentation",E)})}})(jQuery);(function(A){A.fn._vs.phy={b2Vec2:Box2D.Common.Math.b2Vec2,b2AABB:Box2D.Collision.b2AABB,b2BodyDef:Box2D.Dynamics.b2BodyDef,b2Body:Box2D.Dynamics.b2Body,b2FixtureDef:Box2D.Dynamics.b2FixtureDef,b2Fixture:Box2D.Dynamics.b2Fixture,b2World:Box2D.Dynamics.b2World,b2MassData:Box2D.Collision.Shapes.b2MassData,b2PolygonShape:Box2D.Collision.Shapes.b2PolygonShape,b2CircleShape:Box2D.Collision.Shapes.b2CircleShape,b2DebugDraw:Box2D.Dynamics.b2DebugDraw,b2MouseJointDef:Box2D.Dynamics.Joints.b2MouseJointDef,b2Shape:Box2D.Collision.Shapes.b2Shape,b2DistanceJointDef:Box2D.Dynamics.Joints.b2DistanceJointDef,b2RevoluteJointDef:Box2D.Dynamics.Joints.b2RevoluteJointDef,b2Joint:Box2D.Dynamics.Joints.b2Joint,b2PrismaticJointDef:Box2D.Dynamics.Joints.b2PrismaticJointDef,b2ContactListener:Box2D.Dynamics.b2ContactListener,b2Settings:Box2D.Common.b2Settings}})(jQuery);(function(A){A.fn.vs.chart={}})(jQuery);(function(A){A.fn._vs.draw={settings:{draw:{trail:1,showLayout:false}},update:function(D){if(this.settings.draw.trail==1){D.ctx.clearRect(0,0,D.ctx.canvas.clientWidth,D.ctx.canvas.clientHeight)}else{debugDrawChart(0,0,ctx.canvas.clientWidth,ctx.canvas.clientHeight,"rgba(255,255,255,"+this.settings.draw.trail+")",ctx)}for(var B=D.world.GetBodyList();B;B=B.GetNext()){for(var C=B.GetFixtureList();C!=null;C=C.GetNext()){this.drawShape(D,C)}}if(this.settings.draw.showLayout==true){this.debugDrawChart(chart.position.x,chart.position.y,chart.position.width,chart.position.height,"rgba(255,0,0,0.2)",ctx)}},debugDrawChart:function(B,G,D,F,E,C){C.save();C.translate(0,0);C.fillStyle=E;C.beginPath();C.rect(B,G,D,F);C.closePath();C.strokeStyle="#000";C.lineWidth=0.5;C.stroke();C.restore()},showTexture:function(C,B){if(typeof(C.m_userData.texture)!=="undefined"&&typeof(C.m_userData.texture.pattern)!=="undefined"){B.fillStyle=C.m_userData.texture.pattern;B.fill()}},drawShape:function(K,F){var Q=F.GetBody();var R=Q.GetPosition();var P=Q.GetAngle();var D=9;var C=10;var S=K.settings.options.scale;F.m_userData.x=Q.GetWorldCenter().x*S;F.m_userData.y=Q.GetWorldCenter().y*S;if(typeof(F)!="undefined"){switch(F.GetType()){case 0:switch(F.m_userData){case null:K.ctx.fillStyle="rgba(255,0,0,1)";break;default:K.ctx.fillStyle=F.m_userData.fillStyle;break}var B=F.m_shape.m_radius;if(K.settings.sedimentation.token.visible==true){K.ctx.save();K.ctx.translate(R.x*S,R.y*S);K.ctx.rotate(P);K.ctx.beginPath();var O=(B/C*D)*S;if(typeof(F.m_userData.strokeStyle)!="undefined"){K.ctx.strokeStyle=F.m_userData.strokeStyle}else{K.ctx.strokeStyle="rgba(0,0,0,0)"}if(typeof(F.m_userData.lineWidth)!="undefined"){K.ctx.lineWidth=F.m_userData.lineWidth}else{K.ctx.lineWidth=0}K.ctx.arc(0,0,O,0,Math.PI*2,true);K.ctx.closePath();if(K.settings.options.layout==true){K.ctx.strokeStyle="#000";K.ctx.lineWidth=0.5;K.ctx.stroke()}else{K.ctx.fill();K.ctx.stroke();this.showTexture(F,K.ctx)}K.ctx.restore()}break;case 1:switch(F.m_userData){case null:K.ctx.fillStyle="rgba(255,0,0,1)";break;default:K.ctx.fillStyle=F.m_userData.fillStyle;break}var I=F.m_shape.m_vertices[0].x*S;var G=F.m_shape.m_vertices[0].y*S;var J=R.x*S-F.m_shape.m_vertices[0].x*S;var H=R.y*S-F.m_shape.m_vertices[0].y*S;K.ctx.save();K.ctx.translate(R.x*S,R.y*S);K.ctx.rotate(P);K.ctx.beginPath();if(typeof(F.m_userData.strokeStyle)!="undefined"){K.ctx.strokeStyle=F.m_userData.strokeStyle}else{K.ctx.strokeStyle=F.m_userData.fillStyle}if(typeof(F.m_userData.lineWidth)!="undefined"){K.ctx.lineWidth=F.m_userData.lineWidth}else{K.ctx.lineWidth=0}for(var N=0;N<F.m_shape.m_vertices.length;N++){var M=F.m_shape.m_vertices;K.ctx.moveTo((M[0].x)*S,(M[0].y)*S);for(var L=1;L<M.length;L++){K.ctx.lineTo((M[L].x)*S,(M[L].y)*S)}K.ctx.lineTo((M[0].x)*S,(M[0].y)*S)}K.ctx.closePath();K.ctx.fill();this.showTexture(F,K.ctx);if(K.settings.options.layout==true){K.ctx.lineWidth=0.25;K.ctx.strokeStyle="rgb(0,0,0)";K.ctx.stroke()}else{K.ctx.stroke()}K.ctx.restore();break;case 2:break;K.ctx.fillStyle="rgb(0,0,0)"}}if(typeof(F.m_userData.callback)!="undefined"){if(typeof(F.m_userData.callback.draw)=="function"){var E=K.select("ID",F.m_userData.ID);F.m_userData.callback.draw(E)}}}}})(jQuery);(function(A){A.fn._vs.token={colorRange:function(){},init:function(B){this.colorRange=B.settings.chart.colorRange},ID:function(B){B.settings.data.tokenPast+=1;return B.settings.data.tokenPast},selectAll:function(G,D,F){var B=[];var E=false;B.flocculate=function(){var H=[];B.forEach(function(I){q=I.flocculate();H.push(q)});return H};B.attr=function(H,J,K){var I=[];B.forEach(function(L){q=L.attr(H,J,K);I.push(q)});return I};B.b2dObj=function(H,J,K){var I=[];B.forEach(function(L){q=L.myobj;I.push(q)});return I};if(typeof(F)=="undefined"&&typeof(D)=="undefined"){E=true}for(var C=G.tokens.length-1;C>=0;C--){if(G.tokens[C].attr(D)==F||E==true){B.push(G.tokens[C])}}return B},select:function(E,C,D){result=[];if(typeof(D)=="undefined"&&typeof(C)=="undefined"){return E.tokens}else{for(var B=E.tokens.length-1;B>=0;B--){if(E.tokens[B].attr(C)==D){result.push(E.tokens[B]);break}}}if(typeof(result[0])=="undefined"){return false}else{return result[0]}},addToken:function(H,G){var C={x:50,y:50,t:null,category:1,state:0,size:10,fillStyle:"###",strokeStyle:"rgba(0,0,0,0)",lineWidth:0,texture:undefined,shape:{type:"round"},userdata:{},callback:{},phy:{density:10,friction:0,restitution:0},targets:[],elbow:{}};var B=null;var D=null;var F={};F.toString=function(){return"Token ID="+this.setting.ID};if(typeof(G)=="undefined"){F.setting=C;F.setting.ID=this.ID(H)}else{F.setting=G;if(typeof(F.setting.phy)=="undefined"){F.setting.phy=C.phy}if(typeof(F.setting.t)=="undefined"){F.setting.t=H.settings.stream.now}if(typeof(F.setting.x)=="undefined"){F.setting.x=H.settings.sedimentation.incoming.point[G.category].x+(Math.random()*2)}if(typeof(F.setting.y)=="undefined"){F.setting.y=H.settings.sedimentation.incoming.point[G.category].y+(Math.random()*2)}if(typeof(F.setting.size)=="undefined"){F.setting.size=H.settings.sedimentation.token.size.original}if(typeof(F.setting.targets)=="undefined"){F.setting.targets=[]}F.setting.ID=F.setting.ID=this.ID(H);if(typeof(F.setting.state)=="undefined"){F.setting.state=0}if(typeof(F.setting.shape)=="undefined"){F.setting.shape=C.shape}}F.myobj=this.create(H,F.setting);F.flocculate=function(){H.tokens.indexOf(this);H.flocculate.destroyIt(H,this);return this};F.attr=function(I,J,K){if(typeof(J)=="undefined"){if(typeof(this[I])!="undefined"){return this[I]()}else{return this.myobj.m_userData[I]}}else{if(typeof(this[I])!="undefined"){this[I](J,K)}else{this.myobj.m_userData[I]=J}}return this};F.callback=function(I,J){if(!arguments.length){return this.myobj.m_userData.callback}if(typeof(this.myobj.m_userData.callback[I])=="function"){return this.myobj.m_userData.callback[I](J)}else{return function(K){console.log("callback undefined")}}};F.size=function(I){if(this.myobj!=null&&this.attr("state")<2){if(!arguments.length){return this.myobj.m_shape.m_radius*this.myobj.m_userData.scale}this.myobj.m_shape.m_radius=I/this.myobj.m_userData.scale}};F.b2dObj=function(){if(this.myobj!=null&&this.attr("state")<2){return this.myobj}};F.texture=function(J){if(!arguments.length){return this.myobj.m_userData.texture.img.src}console.log("texture",J);var I={};I.img=new Image();I.img.onload=function(){I.pattern=document.createElement("canvas").getContext("2d").createPattern(I.img,"repeat")};I.img.src=J;this.myobj.m_userData.texture=I};H.tokens.push(F);H.decay.tokens.push(F);if(typeof(this.myobj.m_userData.callback)!="undefined"){if(typeof(this.myobj.m_userData.callback.suspension)=="function"){var E=H.select("ID",F.setting.ID);this.myobj.m_userData.callback.suspension(E)}}return F},create:function(I,D){D.scale=scale=I.settings.options.scale;var H=D.x/scale+(Math.random()*0.1);var E=D.y/scale+(Math.random()*0.1);var G=new Box2D.Dynamics.b2FixtureDef;G.density=0.1;G.friction=0;G.restitution=0;if(D.shape.type=="round"){G.shape=new Box2D.Collision.Shapes.b2CircleShape(D.size/scale)}else{if(D.shape.type=="polygons"){G=this.setPolygons(I,D,G)}else{if(D.shape.type=="box"){G.shape=new Box2D.Collision.Shapes.b2PolygonShape;G.shape.SetAsBox(D.shape.width/scale,D.shape.height/scale)}}}var C=new Box2D.Dynamics.b2BodyDef;C.type=Box2D.Dynamics.b2Body.b2_dynamicBody;C.position.x=D.x/scale;C.position.y=D.y/scale;this.myobj=I.world.CreateBody(C).CreateFixture(G);if(typeof(D.texture)!="undefined"){var B=D.texture;B.img=new Image();B.img.onload=function(){B.pattern=document.createElement("canvas").getContext("2d").createPattern(B.img,"repeat")};B.img.src=B.src}if(typeof(D.impulse)!="undefined"){this.applyImpulse(this.myobj,D.impulse.angle,D.impulse.power)}if(typeof(D.fillStyle)=="undefined"){D.fillStyle=this.colorRange(D.category)}if(typeof(D.lineWidth)=="undefined"){D.lineWidth=0}if(typeof(D.type)=="undefined"){D.type="token"}if(typeof(D.callback)=="undefined"){D.callback={}}this.myobj.m_userData=D;this.myobj.attr=this.attr;this.myobj.m_userData.mouse={};this.myobj.m_userData.mouse.over=false;this.myobj.m_userData.mouse.down=false;this.myobj.m_userData.mouse.dragging=false;this.myobj.m_userData.mouse.statebefore=false;this.myobj.m_userData.state=1;if(D.targets.length==0&&I.settings.chart.type=="CircleLayout"){D.targets[0]={x:I.settings.sedimentation.incoming.target[D.category].x,y:I.settings.sedimentation.incoming.target[D.category].y}}if(D.targets.length>0){var F=new I.phy.b2MouseJointDef();F.bodyA=I.world.GetGroundBody();F.bodyB=this.myobj.GetBody();F.target.Set(H,E);F.collideConnected=true;F.maxForce=50*this.myobj.GetBody().GetMass();mouseJoint=I.world.CreateJoint(F);mouseJoint.SetTarget(new I.phy.b2Vec2(D.targets[0].x/scale,D.targets[0].y/scale))}return this.myobj},applyImpulse:function(D,E,C){var B=D.GetBody();B.ApplyImpulse(new Box2D.Common.Math.b2Vec2(Math.cos(E*(Math.PI/180))*C,Math.sin(E*(Math.PI/180))*C),B.GetWorldCenter())},setPolygons:function(F,D,E){E.shape=new Box2D.Collision.Shapes.b2PolygonShape;if(D.shape.points==null){D.shape.points=[{x:-1,y:-1},{x:1,y:-1},{x:-1,y:-1},{x:1,y:-1}]}for(var C=0;C<D.shape.points.length;C++){var B=new Box2D.Common.Math.b2Vec2();B.Set(D.shape.points[C].x/scale,D.shape.points[C].y/scale);D.shape.points[C]=B}E.shape.SetAsArray(D.shape.points,D.shape.points.length);return E},createDataBarBall:function(I,B,H,E,F){var G=new Box2D.Dynamics.b2FixtureDef;G.density=10;G.friction=0.5;G.restitution=0.2;G.shape=new Box2D.Collision.Shapes.b2CircleShape(E/I.settings.options.scale);var D=new Box2D.Dynamics.b2BodyDef;D.type=Box2D.Dynamics.b2Body.b2_dynamicBody;D.position.x=B/I.settings.options.scale;D.position.y=H/I.settings.options.scale;var C=I.world.CreateBody(D).CreateFixture(G);C.m_userData={type:"BarChartBall",familyID:"family",fillColor:this.colorRange(F)};return C},createBox:function(I,K,J,D,L,F,C,G){if(typeof(G)=="undefined"){G=true}var B=new b2FixtureDef;if(!G){B.density=100}B.friction=0.6;B.restitution=0.3;var E=new b2BodyDef;E.type=b2Body.b2_staticBody;E.angle=F;B.shape=new b2PolygonShape;B.shape.SetAsBox(D/scale,L/scale);E.position.Set(K/scale,J/scale);var H=I.CreateBody(E).CreateFixture(B);H.m_userData={type:"Wall",fillColor:C};console.log(H.m_userData);return H},createBoxPie:function(I,E,K,J,D,L,G,C){var F=new b2BodyDef;F.type=Box2D.Dynamics.b2Body.b2_dynamicBody;var B=new Box2D.Dynamics.b2FixtureDef;B.shape=new b2PolygonShape;B.shape.SetAsBox(D/scale,L/scale);B.density=1000000;B.friction=0.5;B.restitution=0.2;F.position.Set(K/scale,J/scale);F.angle=0;var H=I.CreateBody(F).CreateFixture(B);H.m_userData={type:"Wall",fillColor:C};return H},createBox0D:function(H,C,I,F,B,G){if(typeof(G)=="undefined"){G=true}var E=new b2BoxDef();E.restitution=-0.6;E.friction=0.3;if(!G){E.density=0.01}E.extents.Set(F,B);var D=new b2BodyDef();D.AddShape(E);D.position.Set(C,I);return H.CreateBody(D)},createHiddenBox:function(G,I,H,B,J,D){if(typeof(D)=="undefined"){D=true}var E=new b2BoxDef();E.restitution=0.6;E.friction=0.3;if(!D){E.density=1}E.extents.Set(B,J);var C=new b2BodyDef();C.AddShape(E);C.position.Set(I,H);var F=G.CreateBody(C);F.m_shapeList.visibility="hidden";console.log(F);return F},createBigBall:function(E,B,G){var F=new Box2D.Dynamics.b2FixtureDef;F.density=1000000;F.friction=0.5;F.restitution=0.2;F.shape=new Box2D.Collision.Shapes.b2CircleShape(20/30);var D=new Box2D.Dynamics.b2BodyDef;D.type=Box2D.Dynamics.b2Body.b2_dynamicBody;D.position.x=B;D.position.y=G;var C=E.CreateBody(D).CreateFixture(F);return C},createPieBox:function(G,J,I,C,K,L,D,M){M=A.extend(true,{density:10000000,friction:1,restitution:0.2,linearDamping:0,angularDamping:0,gravityScale:0,type:b2Body.b2_dynamicBody},M);var B=new b2BodyDef();var E=new b2FixtureDef;E.density=M.density;E.friction=M.friction;E.restitution=M.restitution;E.shape=new b2PolygonShape();E.shape.SetAsBox(C/scale,K/scale);B.position.Set(J/scale,I/scale);B.linearDamping=M.linearDamping;B.angularDamping=M.angularDamping;B.angle=L;B.type=M.type;var H=G.CreateBody(B);var F=H.CreateFixture(E);F.m_userData={type:"box",familyID:null,fillColor:D};return H},createDataBallTarget:function(H,L,I,M,K,N,F){var G=M/scale+(Math.random()*0.1);var C=K/scale+(Math.random()*0.1);var B=new Box2D.Dynamics.b2FixtureDef;B.density=0.1;B.friction=0;B.restitution=0;B.shape=new Box2D.Collision.Shapes.b2CircleShape(N/scale);var D=new Box2D.Dynamics.b2BodyDef;D.type=Box2D.Dynamics.b2Body.b2_dynamicBody;D.position.x=G;D.position.y=C;var E=H.CreateBody(D).CreateFixture(B);var J=new b2MouseJointDef();J.bodyA=H.GetGroundBody();J.bodyB=E.GetBody();J.target.Set(G,C);J.collideConnected=true;J.maxForce=50*E.GetBody().GetMass();mouseJoint=H.CreateJoint(J);mouseJoint.SetTarget(new b2Vec2(L/scale,I/scale));E.m_userData={type:"PieBall",familyID:F,fillColor:colorScale(F)};categorys[F].value+=1;categorys[F].joins.push(mouseJoint);return E},createDataBallPie:function(H,I,M,K,N,F){console.log(I);var G=categorys[F].incomingPoint.x/scale+(Math.random()*2/scale);var C=categorys[F].incomingPoint.y/scale;var B=new Box2D.Dynamics.b2FixtureDef;B.density=0.1;B.friction=0;B.restitution=0;B.shape=new Box2D.Collision.Shapes.b2CircleShape(N/scale);var D=new Box2D.Dynamics.b2BodyDef;D.type=Box2D.Dynamics.b2Body.b2_dynamicBody;D.position.x=G;D.position.y=C;var L=H.CreateBody(D);L.m_userData={type:"PieBall",familyID:F,fillColor:categorys[F].color};listBodies.push(L);var E=L.CreateFixture(B);var J=new b2MouseJointDef();J.bodyA=H.GetGroundBody();J.bodyB=E.GetBody();J.target.Set(G,C);J.collideConnected=true;J.maxForce=100*E.GetBody().GetMass();mouseJoint=H.CreateJoint(J);mouseJoint.SetTarget(new b2Vec2(I.position.x/scale,I.position.y/scale));E.m_userData={type:"PieBall",familyID:F,fillColor:colorScale(F)};categorys[F].value+=1;return E},createDataBall:function(H,B,G,E){var F=new Box2D.Dynamics.b2FixtureDef;F.density=1;F.friction=0.5;F.restitution=0.2;F.shape=new Box2D.Collision.Shapes.b2CircleShape(E/H.settings.options.scale);var D=new Box2D.Dynamics.b2BodyDef;D.type=Box2D.Dynamics.b2Body.b2_dynamicBody;D.position.x=B;D.position.y=G;var C=H.world.CreateBody(D).CreateFixture(F);C.m_userData={type:"PieBall",familyID:"family",fillColor:"rgb(200,0,0)"};return C},}})(jQuery);(function(A){A.fn._vs.stream={i:null,buffer:[],speed:10000/6,strategy:null,type:null,init:function(B){this.speed=B.settings.data.stream.refresh;type=B.settings.data.stream.provider},push:function(C){console.log(C);for(var B=C.length-1;B>=0;B--){buffer.push(C)}},update:function(C){if(type=="generator"){for(var B=0;B<C.settings.data.model.length;B++){C.dataFlow[B]=setInterval((function(D,E){return function(){E.settings.data.stream.now++;var F=E.chart[E.settings.chart.type](E,"token",D);E.addToken(F)}})(B,C),this.speed)}}else{if(type=="tokens"){C.dataFlow[0]=setInterval((function(D,E){return function(){E.settings.data.stream.now++;for(var F=0;F<E.settings.data.tokens.length;F++){if(E.settings.data.tokens[F].t==E.settings.data.stream.now){E.addToken(E.settings.data.tokens[F])}}}})(B,C),this.speed)}else{}}},generator:function(C,B){},test:function(B){B.tokens.push(B.token.createDataBarBall(B,(B.settings.sedimentation.incoming[i].x+(Math.random()*2)),(B.settings.sedimentation.incoming[i].y+(Math.random()*1)),B.settings.sedimentation.token.size,i))},setSpeed:function(D,C){speedFlow=C;for(var B=0;B<categorys.length;B++){window.clearInterval(dataFlow[B])}window.clearInterval(decayFlow);dataFlow(categorys)}}})(jQuery);(function(A){A.fn._vs.decay={tokens:[],update:function(G){var D=1;var J=G.settings.sedimentation.suspension.height;var K=G.settings.height;var H=G.settings.sedimentation.token.size/4;var B=G.settings.sedimentation.suspension.decay.power;var E=G.settings.options.scale;var F=G.settings.sedimentation.token.size.minimum;if(B==null){var B=0}for(var I=0;I<this.tokens.length;I++){var C=this.tokens[I].attr("size");if(B!=0){this.tokens[I].attr("size",C/B)}if(C<=F){if(G.settings.sedimentation.flocculate.strategy!=null){G.flocculate.destroyIt(G,this.tokens[I]);G.strata.update(G)}}}}}})(jQuery);(function(A){A.fn._vs.flocculate={buffer:[],init:function(C){for(var B=0;B<C.settings.data.model.length;B++){this.buffer[B]=[]}},addtobuffer:function(C,B){c=B.attr("category");bufferSize=C.settings.sedimentation.flocculate.bufferSize;this.buffer[c].push(B);C.decay.tokens.splice(C.decay.tokens.indexOf(B),1);B.attr("callback","bufferFlocculation",B);if(this.buffer[c].length>bufferSize){this.update(C,c,bufferSize)}},destroyIt:function(D,C){C.attr("callback","flocculation",C);C.attr("state",2);var B=D.world.DestroyBody(C.myobj.GetBody());return B},update:function(E,D,B){if(E.settings.sedimentation.flocculate.number==1){while(this.buffer[D].length>B){var C=this.buffer[D].shift();this.destroyIt(E,C)}}else{while(this.buffer[D].length>E.settings.sedimentation.flocculate.number){var C=this.buffer[D].shift();this.destroyIt(E,C)}}},disapear:function(C,B){window.setInterval(function(){B.update(self)},self.settings.options.refresh/2)},all:function(C){for(var B=C.decay.tokens-1;B>=0;B--){this.update(C,B,C.tokens.length)}},strategy:function(){if(flocullateBuffer.length>0){if(chart.flocullate.strategy=="Size"&&flocullateBuffer.length>=chart.flocullate.bufferSize){flocullateByArray(flocullateBuffer)}else{if(chart.flocullate.strategy=="Time"){}else{if(chart.flocullate.strategy=="Height"){}}}}}}})(jQuery);(function(A){A.fn._vs.aggregate={defaultSettings:{},strata_layers:function(H,G,B,D){var F=d3.scale.linear().domain([1,B-2]).range([Math.PI/2,2*Math.PI-Math.PI/2]);var C=d3.scale.pow().exponent(10).domain([0,B]).range([0,1]);return d3.range(G).map(function(I){var J=5*Math.random();return d3.range(B).map(function(L){if(H.settings.sedimentation.aggregation.strataType=="sin"){if(I==1){return 20}var K=5+J*5*Math.sin(F(L))+(I*50);if(K<0){return -K}else{return K}}else{if(H.settings.sedimentation.aggregation.strataType=="log"){return I+1}else{if(typeof(D)=="undefined"){D=0}return H.settings.data.strata[D][I].value}}}).map(E)});function E(J,I){return{x:I,y:Math.max(0,J)}}},init:function(L){if(typeof(L.settings.data.strata)=="undefined"||L.settings.data.strata.length==0||L.settings.data.strata[0].length==0){return}var M=L.token.colorRange;if(L.settings.chart.type=="StackedAreaChart"){var E=L.settings.chart.width/L.settings.data.model.length,O=L.settings.sedimentation.aggregation.height;var G=d3.select("#"+L.settings.DOMelement.id).append("div").attr("class","vis").style("z-index",10).append("svg").attr("width",L.settings.width).attr("height",L.settings.height).append("g").attr("transform","translate("+L.settings.chart.x+","+L.settings.chart.y+")");var Q=G.selectAll("g.gcol").data(L.settings.data.strata,function(V){return[V]}).enter().append("g").attr("transform",function(W,V){return"translate("+(V*E)+", "+(L.settings.chart.height-L.settings.sedimentation.aggregation.height)+")"}).attr("class",function(W,V){return"gcol col_"+V});var U=L.settings.data.strata.map(function(V){return{value:V[0].value}});var R=L.settings.data.strata[0].length,S=20;smx=S-1,smy=0;var D=0;var T=d3.svg.area().x(function(V){return L.settings.chart.spacer+V.x*(E-2*L.settings.chart.spacer)/smx}).y0(function(V){return(O-V.y0*D)}).y1(function(V){return(O-(V.y+V.y0)*D)});var K=[];var B=Q.selectAll("gpath").data(function(X,V){var W=d3.layout.stack().offset("expand")(L.aggregate.strata_layers(L,X.length,S,V));smy=d3.max(W,function(Y){return d3.max(Y,function(Z){return Z.y0+Z.y})});W.map(function(Y){Y.map(function(Z){Z.col=V;return Z})});return W}).enter().append("g").attr("class","gpath");B.append("path").attr("d",function(W,V){D=L.settings.chart.height-L.chart.getPosition(L)[W[0].col].y;return T(W)}).style("fill",function(W,V){if(L.settings.data.strata[W[0].col][V].texture!=null){return"url(#RectanglePattern_"+W[0].col+"_"+V+")"}else{return d3.rgb(M(W[0].col)).darker(L.settings.data.strata[W[0].col].length/2-(V+1)/2)}}).attr("class",function(W,V){return"layer"}).attr("class",function(W,V){return"col_"+W[0].col+" layer_"+V});var C=E/1;var I=C;for(var F=0;F<L.settings.data.strata.length;F++){for(var J=0;J<L.settings.data.strata[F].length;J++){if(L.settings.data.strata[F][J].texture!=null){var P=G.append("pattern").attr("id","RectanglePattern_"+F+"_"+J).attr("height",I).attr("width",C).attr("patternTransform","translate(0, 0) scale("+L.settings.data.strata[F][J].texture.size+", "+L.settings.data.strata[F][J].texture.size+") rotate(0)").attr("patternUnits","userSpaceOnUse");P.append("image").attr("x",0).attr("y",0).attr("height",I).attr("width",C).attr("xlink:href",function(){return L.settings.data.strata[F][J].texture.url})}}}}else{if(L.settings.chart.type=="CircleLayout"){var H=d3.select("#"+L.settings.DOMelement.id).append("div").attr("class","vis").attr("width",L.settings.width).attr("height",L.settings.height).append("svg").attr("width",L.settings.width).attr("height",L.settings.height);if(typeof(L.settings.chart.treeLayout)!="undefined"){for(var N=0;N<L.settings.data.model.length;N++){var U=L.settings.data.strata[N];var M=function(V){return L.token.colorRange(N)};L.aggregate.create_pie_chart(L,U,H,U[0].value,M,((N+1/2))*L.settings.chart.width/(L.settings.data.model.length)+L.settings.chart.x,L.settings.chart.y+L.settings.chart.height/6)}}else{var U=L.settings.data.strata.map(function(V){return{value:V[0].value}});console.log(L.settings.data.strata,U);var M=L.token.colorRange;L.aggregate.create_pie_chart(L,U,H,L.settings.chart.radius,M,L.settings.chart.x+L.settings.chart.width/2,L.settings.chart.y+L.settings.chart.height/2)}}}},create_pie_chart:function(O,T,K,J,P,N,M){var H=O.settings.width/O.settings.data.model.length,R=O.settings.sedimentation.aggregation.height;var G=d3.scale.linear().domain([0,O.settings.data.strata.length-1]).range([0,O.settings.width]);var F=d3.scale.linear().domain([0,d3.max(T,function(U){return U.value})]).rangeRound([0,R]);var C=O.settings.width,B=O.settings.height,I=O.settings.sedimentation.aggregation.height;labelr=J+30,donut=d3.layout.pie().sort(null),arc=d3.svg.arc().innerRadius(0).outerRadius(J);var L=Math.random();K.append("g.arcs_"+L).attr("class","arcs_"+L);var E=K.selectAll(".arcs").data(donut(T.map(function(V,U){return V.value}))).enter().append("svg:g").attr("transform","translate("+N+","+M+")");var D=0;var S=d3.svg.area().x(function(U){return O.settings.chart.spacer+U.x*(H-2*O.settings.chart.spacer)/smx}).y0(function(U){return(R-U.y0*D)}).y1(function(U){return(R-(U.y+U.y0)*D)});var Q=E.append("path").attr("fill",function(V,U){return P(U)}).attr("d",function(V,U){return arc(V)}).each(function(U){this._current=U})},update:function(K){if(typeof(K.settings.data.strata)=="undefined"||K.settings.data.strata.length==0||K.settings.data.strata[0].length==0){return}var N=K.settings.chart.width/K.settings.data.model.length;var I=K.settings.sedimentation.aggregation.height;var M=d3.scale.linear().domain([0,K.settings.data.strata.length-1]).range([0,K.settings.width]);var H=K.settings.data.strata.map(function(P){return{value:P[0].value}});var O=K.settings.data.strata.map(function(R){for(var P=0,Q=0;P<R.length;P++){Q+=R[P].value}return Q});var L=d3.scale.linear().domain([0,d3.max(O)]).range([0,K.settings.sedimentation.aggregation.height]);var E=K.settings.data.strata[0].length,F=20;smx=F-1,smy=0;var G=0;var D=d3.svg.area().x(function(P){return K.settings.chart.spacer+P.x*(N-2*K.settings.chart.spacer)/smx}).y0(function(P){return(I-P.y0*G)}).y1(function(P){return(I-(P.y+P.y0)*G)});var C=d3.select("svg");var J=C.selectAll(".gcol");J.data(K.settings.data.strata,function(Q,P){return[Q]});var B=J.selectAll(".gpath").data(function(R,P){var Q=d3.layout.stack().offset("expand")(K.aggregate.strata_layers(K,R.length,F,P));smy=d3.max(Q,function(S){return d3.max(S,function(T){return T.y0+T.y})});Q.map(function(S){S.map(function(T){T.col=P;return T})});return Q});B.select("path").transition().duration(100).attr("d",function(Q,P){K.chartUpdate(P,-L(O[P])-(I-K.settings.chart.height));G=K.settings.chart.height-K.chart.getPosition(K)[Q[0].col].y;return D(Q)})}}})(jQuery);(function($){$.fn._vs.strata={stratas:[],init:function(_this){if(_this.settings.chart.type!="StackedAreaChart"){_this.strata.create_strata(_this);return}settings=_this.settings;if((typeof(settings.data.strata)!="function")&&(typeof(settings.data.strata)=="undefined"||settings.data.strata.length==0)){for(var i=0;i<settings.data.model.length;i++){var defaultStrata={label:settings.data.model[i].label+"_"+i,category:i,value:function(t,s){return 0},};_this.strata.stratas[i]=[defaultStrata]}_this.strata.create_strata(_this);return}if(typeof settings.data.strata!="function"){if(typeof(settings.data.strata=="object")&&typeof(settings.data.strata[0])!="undefined"&&(typeof settings.data.strata[0][0].value!="undefined")&&typeof(settings.data.strata[0][0].value=="string")){var NB_STRATA=settings.data.strata[0].length;for(var i=0;i<settings.data.model.length;i++){_this.strata.stratas[i]=[];for(var n=0;n<NB_STRATA;n++){(function(a,b){var t=null;if((typeof settings.data.strata[a]!="undefined")&&(typeof settings.data.strata[a][b]!="undefined")&&(typeof settings.data.strata[a][b].texture!="undefined")){t=settings.data.strata[a][b].texture}var defaultStrata={};defaultStrata={label:settings.data.model[i].label+"_"+a,category:a,texture:t,value:function(){r=eval("f="+settings.data.strata[a][b].value);return r()}};_this.strata.stratas[a].push(defaultStrata)})(i,n)}}_this.strata.create_strata(_this);return}if(typeof(settings.data.strata[0])!="undefined"&&typeof(settings.data.strata[0][0])!="undefined"&&typeof(settings.data.strata[0][0].initValue!="undefined")){for(var c=0;c<settings.data.model.length;c++){var defaultStrata={label:settings.data.model[c].label+"_"+c,category:i,value:function(t,s){if(t.selectAll("category",s)){return settings.data.strata[s][0].initValue+t.selectAll("category",s).attr("state").filter(function(d){if(d==2){return d}}).length}else{return settings.data.strata[s][0].initValue}},};_this.strata.stratas[c]=[defaultStrata]}_this.strata.create_strata(_this);return}else{if(settings.data.strata[0].length==0){for(var i=0;i<settings.data.model.length;i++){var defaultStrata={label:settings.data.model[i].label+"_"+i,category:i,value:function(t,s){if(t.selectAll("category",s)){return t.selectAll("category",s).attr("state").filter(function(d){if(d==2){return d}}).length}else{return 0}},};_this.strata.stratas[i]=[defaultStrata]}_this.strata.create_strata(_this);return}else{var NB_STRATA=settings.data.strata[0].length;settings.data.strata_param=settings.data.strata;function fstrata(){var a=Array();for(var s=0;s<mySettings.data.model.length;s++){a.push(fstratum(s))}return a}function fstratum(a){var b=Array(NB_STRATA);for(var r=0;r<b.length;r++){b[r]=Array()}if(typeof _this!="undefined"){var tokens=_this.selectAll("category",s).attr("state").filter(function(d){if(d==2){return d}}).length;for(var k=0;k<tokens.length;k++){var tk=tokens[k];for(var r=0;r<b.length;r++){if(tk<_this.settings.stream.now-2*(r)&&tk>=_this.settings.stream.now-2*(r+1)){b[b.length-r-1].push(tk)}}}}var res=Array();for(var j=0;j<NB_STRATA;j++){var val=b[j].length;(function(v){res.push({value:function(){return v},label:"Strata "+j,category:a})})(val)}return res}_this.settings.data.strata=function(){return fstrata()};_this.strata.stratas=_this.settings.data.strata();_this.strata.create_strata(_this);return}}}if((typeof settings.data.strata=="function")||settings.data.strata[0].length>0||_this.strata.stratas.length>0){if(typeof settings.data.strata=="function"||(settings.data.strata[0].length>0&&typeof(settings.data.strata[0])=="object")){if(typeof settings.data.strata=="function"){_this.strata.stratas=settings.data.strata()}else{if(typeof settings.data.strata[0].value=="function"){for(var i=0;i<settings.data.model.length;i++){var defaultStrata={label:settings.data.model[i].label+"_"+i,category:i,initValue:settings.data.model[i].value,value:function(t,s){return settings.data.strata[i]},};_this.strata.stratas[i]=[defaultStrata]}}else{for(var i=0;i<settings.data.model.length;i++){var defaultStrata={label:settings.data.model[i].label+"_"+i,category:i,initValue:settings.data.model[i].value,value:function(t,s){if(typeof(t.selectAll("category",s).length)=="undefined"){return this.initValue}if(t.selectAll("category",s)){return this.initValue+t.selectAll("category",s).attr("state").filter(function(d){if(d==2){return d}}).length}else{return 0}},};_this.strata.stratas[i]=[defaultStrata]}}}}_this.strata.create_strata(_this)}},selectAll:function(_this,key,value){result=[];result.attr=function(key,value,param){var r=[];result.forEach(function(i){q=i.attr(key,value,param);r.push(q)});return r};if(typeof(value)=="undefined"&&typeof(key)=="undefined"){return this.stratas}else{for(var i=_this.strata.stratas.length-1;i>=0;i--){if(_this.strata.stratas[i].attr(key)==value){result.push(_this.strata.stratas[i]);break}}}if(typeof(result[0])=="undefined"){return false}else{return result[0]}},add:function(_this,setting){var strata=function(){};strata.myobj=setting;strata.attr=function(key,value,param){if(typeof(value)=="undefined"){if(typeof(this[key])!="undefined"){return this[key]()}else{return this.myobj[key]}}else{if(typeof(this[key])!="undefined"){this[key](value,param)}else{this.myobj[key]=value}}return this};return strata},remove:function(_this,key,value){},strata_layers:function(_this,n,m,p){var sn=d3.scale.linear().domain([1,m-2]).range([Math.PI/2,2*Math.PI-Math.PI/2]);var logscale=d3.scale.pow().exponent(10).domain([0,m]).range([0,1]);return d3.range(n).map(function(i){var r=5*Math.random();return d3.range(m).map(function(j){if(_this.settings.sedimentation.aggregation.strataType=="sin"){if(i==1){return 20}var x=5+r*5*Math.sin(sn(j))+(i*50);if(x<0){return -x}else{return x}}else{if(_this.settings.sedimentation.aggregation.strataType=="log"){return i+1}else{if(typeof(p)=="undefined"){p=0}return _this.strata.stratas[p][i].value(_this,p)}}}).map(stream_index)});function stream_index(d,i){return{x:i,y:Math.max(0,d)}}},create_strata:function(_this){if(_this.settings.chart.type=="StackedAreaChart"){var w=_this.settings.chart.width/_this.settings.data.model.length,h=_this.settings.sedimentation.aggregation.height;var color=_this.token.colorRange;if(typeof _this.settings.options.canvasFirst!="undefined"&&_this.settings.options.canvasFirst==false){var vis=d3.select("#"+_this.settings.DOMelement.id).insert("div",":first-child").style("position","absolute").attr("class","vis").style("z-index",10).append("svg").attr("width",_this.settings.width).attr("height",_this.settings.height).append("g").attr("transform","translate("+_this.settings.chart.x+","+_this.settings.chart.y+")")}else{var vis=d3.select("#"+_this.settings.DOMelement.id).append("div").attr("class","vis").style("z-index",10).append("svg").attr("width",_this.settings.width).attr("height",_this.settings.height).append("g").attr("transform","translate("+_this.settings.chart.x+","+_this.settings.chart.y+")")}var sn=_this.strata.stratas[0].length,sm=20;smx=sm-1,smy=0;var sum_strata=_this.strata.stratas.map(function(d,i){for(var v=0,res=0;v<d.length;v++){res+=d[v].value(_this,i)}return res});var y=d3.scale.linear().domain([0,Math.max(d3.max(sum_strata),_this.settings.sedimentation.aggregation.maxData)]).range([0,_this.settings.sedimentation.aggregation.height]);var g=vis.selectAll("g.gcol").data(_this.strata.stratas,function(d){return[d]}).enter().append("g").attr("transform",function(d,i){var align=_this.settings.sedimentation.aggregation.height;if(_this.settings.sedimentation.aggregation.invertStrata){align=2*_this.settings.sedimentation.aggregation.height-y(sum_strata[i])}return"translate("+(i*w)+", "+(_this.settings.chart.height-align)+")"}).attr("class",function(d,i){return"gcol col_"+i});var gpath=g.selectAll(".gpath").data(function(d,i){var sd=d3.layout.stack().offset("expand")(_this.strata.strata_layers(_this,d.length,sm,i));smy=d3.max(sd,function(d){return d3.max(d,function(d){return d.y0+d.y})});sd.map(function(d){d.map(function(d){d.col=i;return d})});return sd}).enter().append("g").attr("class","gpath");var area=d3.svg.area().x(function(d){return _this.settings.chart.spacer+d.x*(w-2*_this.settings.chart.spacer)/smx}).y0(function(d){return(h-d.y0*d.offshit)}).y1(function(d){return(h-(d.y+d.y0)*d.offshit)});var pathlayer=gpath.append("path").attr("d",function(d,i){_this.chartUpdate(i,-y(sum_strata[i])-(h-_this.settings.chart.height));hh=0;d.map(function(dd){dd.offshit=hh;return dd});return area(d)});pathlayer.style("fill",function(d,i){if(_this.strata.stratas[d[0].col][i].texture!=null){return"url(#RectanglePattern_"+d[0].col+"_"+i+")"}else{return d3.rgb(color(d[0].col)).darker(_this.strata.stratas[d[0].col].length/2-(i+1)/2)}}).attr("class",function(d,i){return"gcol col_"+d[0].col+" layer_"+i});var patternWidth=w/1;var patternHeight=patternWidth;if(typeof _this.settings.data.strata!="undefined"){for(var s=0;s<_this.settings.data.strata.length;s++){for(var l=0;l<_this.settings.data.strata[s].length;l++){if(_this.settings.data.strata[s][l].texture!=null){var pattern=vis.append("pattern").attr("id","RectanglePattern_"+s+"_"+l).attr("height",patternHeight).attr("width",patternWidth).attr("patternTransform","translate(0, 0) scale("+_this.settings.data.strata[s][l].texture.size+", "+_this.settings.data.strata[s][l].texture.size+") rotate(0)").attr("patternUnits","userSpaceOnUse");pattern.append("image").attr("x",0).attr("y",0).attr("height",patternHeight).attr("width",patternWidth).attr("xlink:href",function(){return _this.settings.data.strata[s][l].texture.url})}}}}}else{if(_this.settings.chart.type=="CircleLayout"){var svg=d3.select("#"+_this.settings.DOMelement.id).append("div").attr("class","vis").attr("width",_this.settings.width).attr("height",_this.settings.height).append("svg").attr("width",_this.settings.width).attr("height",_this.settings.height);if(typeof(_this.settings.chart.treeLayout)!="undefined"){for(var i=0;i<_this.settings.data.model.length;i++){var data=_this.settings.data.strata[i];var color=function(s){return _this.token.colorRange(i)};_this.strata.create_pie_chart(_this,data,svg,data[0].value,color,((i+1/2))*_this.settings.chart.width/(_this.settings.data.model.length)+_this.settings.chart.x,_this.settings.chart.y+_this.settings.chart.height/6)}}else{var data=_this.settings.data.strata.map(function(d){return{value:d[0].value}});var color=_this.token.colorRange;_this.strata.create_pie_chart(_this,data,svg,_this.settings.chart.radius,color,_this.settings.chart.x+_this.settings.chart.width/2,_this.settings.chart.y+_this.settings.chart.height/2)}}}},create_pie_chart:function(_this,data,svg,r,color,posx,posy){var w=_this.settings.width/_this.settings.data.model.length,h=_this.settings.sedimentation.aggregation.height;var x=d3.scale.linear().domain([0,_this.settings.data.strata.length-1]).range([0,_this.settings.width]);var y=d3.scale.linear().domain([0,d3.max(data,function(d){return d.value})]).rangeRound([0,h]);var wp=_this.settings.width,hp=_this.settings.height,hhp=_this.settings.sedimentation.aggregation.height;labelr=r+30,donut=d3.layout.pie().sort(null),arc=d3.svg.arc().innerRadius(0).outerRadius(r);var id=Math.random();svg.append("g.arcs_"+id).attr("class","arcs_"+id);var garcs=svg.selectAll(".arcs").data(donut(data.map(function(d,i){return d.value}))).enter().append("svg:g").attr("transform","translate("+posx+","+posy+")");var hh=0;var area=d3.svg.area().x(function(d){return _this.settings.chart.spacer+d.x*(w-2*_this.settings.chart.spacer)/smx}).y0(function(d){return(h-d.y0*hh)}).y1(function(d){return(h-(d.y+d.y0)*hh)});var arcs=garcs.append("path").attr("fill",function(d,i){return color(i)}).attr("d",function(d,i){return arc(d)}).each(function(d){this._current=d})},update:function(_this){if(typeof(_this.strata.stratas)=="undefined"||_this.strata.stratas.length==0){return}if(typeof settings.data.strata=="function"){_this.strata.stratas=settings.data.strata()}var sn=_this.strata.stratas[0].length,sm=20;smx=sm-1,smy=0;var w=_this.settings.chart.width/_this.settings.data.model.length,h=_this.settings.sedimentation.aggregation.height;var color=_this.token.colorRange;var area=d3.svg.area().x(function(d){return _this.settings.chart.spacer+d.x*(w-2*_this.settings.chart.spacer)/smx}).y0(function(d){return(h-d.y0*d.offshit)}).y1(function(d){return(h-(d.y+d.y0)*d.offshit)});var sum_strata=_this.strata.stratas.map(function(d,i){for(var v=0,res=0;v<d.length;v++){res+=d[v].value(_this,i)}return res});var y=d3.scale.linear().domain([0,Math.max(d3.max(sum_strata),_this.settings.sedimentation.aggregation.maxData)]).range([0,_this.settings.sedimentation.aggregation.height]);var vis=d3.select("#"+_this.settings.DOMelement.id);var g=vis.selectAll("g.gcol");if(_this.settings.sedimentation.aggregation.invertStrata){g.transition().duration(100).attr("transform",function(d,i){var align=_this.settings.sedimentation.aggregation.height;align=2*_this.settings.sedimentation.aggregation.height-y(sum_strata[i]);return"translate("+(i*w)+", "+(_this.settings.chart.height-(2*_this.settings.sedimentation.aggregation.height-y(sum_strata[i])))+")"})}var gpath=g.selectAll("path").data(function(d,i){var sd=d3.layout.stack().offset("expand")(_this.strata.strata_layers(_this,d.length,sm,i));smy=d3.max(sd,function(d){return d3.max(d,function(d){return d.y0+d.y})});sd.map(function(d){d.map(function(d){d.col=i;return d})});return sd});if(_this.settings.chart.type=="StackedAreaChart"){var pathlayer=vis.selectAll("path").transition().duration(100).attr("d",function(d,i){if(!_this.settings.sedimentation.aggregation.invertStrata){_this.chartUpdate(i,-y(sum_strata[i])-(h-_this.settings.chart.height));hh=_this.settings.chart.height-_this.chart.getPosition(_this)[d[0].col].y}else{_this.chartUpdate(i,-2*h+_this.settings.chart.height);hh=y(sum_strata[d[0].col])}d.map(function(dd){dd.offshit=hh;return dd});return area(d)})}}}})(jQuery);(function(A){A.fn._vs.chart.StackedAreaChart=function(F,E,D){var C;this.init=function(G){gravity=new G.phy.b2Vec2(0.001,10);G.world.m_gravity=gravity;G.chartPhySetup={grounds:[],wall:[]};this.setupChartPhysics(G)};this.setupChartPhysics=function(L){var M=L.settings.chart.spacer;var O=(L.settings.chart.width/L.settings.data.model.length);var H=M;var P=L.settings.chart.height/2+L.settings.chart.y;var N=L.settings.chart.height-L.settings.sedimentation.aggregation.height;var I=0;for(var K=0;K<L.settings.data.model.length;K++){L.settings.data.model[K].value=0;if(typeof(L.settings.data.strata)!="undefined"){if(typeof(L.settings.data.strata[K])!="undefined"){for(var J=0;J<L.settings.data.strata[K].length;J++){L.settings.data.model[K].value+=L.settings.data.strata[K][J].value}}}I+=L.settings.data.model[K].value}for(var K=0;K<L.settings.data.model.length+1;K++){var G=L.settings.chart.x+(K*O);L.chartPhySetup.wall[K]=this.createMyChartBox(L,G,P,H,L.settings.chart.height/2,"wall",L.settings.chart.wallColor);if(K<L.settings.data.model.length){L.settings.sedimentation.incoming.point[K]={x:G+(O/2),y:L.settings.y}}if(K<L.settings.data.model.length){L.chartPhySetup.grounds[K]=this.createMyChartBox(L,G+(O/2),L.settings.chart.height+L.settings.chart.y+L.settings.sedimentation.aggregation.height,O/2,L.settings.chart.height,"lift","rgba(250,250,250,0)");this.update(L,{cat:K,y:L.settings.chart.height})}}};this.token=function(J,G){var I=G;var H={x:(J.settings.sedimentation.incoming.point[I].x+(Math.random()*2)),y:(J.settings.sedimentation.incoming.point[I].y+(Math.random()*1)),t:J.now(),size:J.settings.sedimentation.token.size.original,category:I,lineWidth:0,};return H};this.createMyChartBox=function(M,P,O,Q,L,N,J){var I=M.settings.options.scale;var G=new M.phy.b2FixtureDef;G.density=1;G.friction=0.5;G.restitution=0.2;var H=new M.phy.b2BodyDef;H.type=M.phy.b2Body.b2_staticBody;G.shape=new M.phy.b2PolygonShape;G.shape.SetAsBox(Q/I,L/I);H.position.Set(P/I,O/I);var K=M.world.CreateBody(H).CreateFixture(G);K.m_userData={type:N,fillStyle:J,w:Q,h:L,x:P,y:O};return K};this.update=function(K,J){var I={cat:0,y:0};if(K.chartPhySetup.grounds[J.cat]!=null){var H=K.chartPhySetup.grounds[J.cat].GetBody();var G=H.GetWorldCenter();G.y=(J.y+K.settings.chart.height+K.settings.chart.y+K.settings.sedimentation.aggregation.height)/K.settings.options.scale;H.SetPosition(G)}};this.getPositionOld=function(I){var G=[];for(var H=0;H<I.chartPhySetup.grounds.length;H++){myElement=I.chartPhySetup.grounds[H];myBody=myElement.GetBody();G.push({x:(myBody.GetWorldCenter().x*I.settings.options.scale),y:(myBody.GetWorldCenter().y*I.settings.options.scale),a:myBody.GetAngle(),w:myElement.m_userData.w,h:myElement.m_userData.h,r:myElement.m_userData.r,})}return G};this.getPosition=function(I){var G=[];for(var H=0;H<I.chartPhySetup.grounds.length;H++){myElement=I.chartPhySetup.grounds[H];myBody=myElement.GetBody();G.push({x:(myBody.GetWorldCenter().x*I.settings.options.scale),y:(myBody.GetWorldCenter().y*I.settings.options.scale)-I.settings.chart.height-I.settings.chart.y,a:myBody.GetAngle(),w:myElement.m_userData.w,h:myElement.m_userData.h,r:myElement.m_userData.r,})}return G};if(typeof(E)!=undefined){var B=this[E](F,D);if(typeof(B)!=undefined){return B}}}})(jQuery);(function(A){A.fn._vs.chart.CircleLayout=function(I,M,Q){var H;var K;var J;var G;var N=[];var E=0;var I;this.init=function(U,S){console.log("Circle Layout Init");this._this=U;gravity=new U.phy.b2Vec2(0,0);U.world.m_gravity=gravity;U.chartPhySetup={grounds:[],wall:[]};this.treeLayout=U.settings.chart.treeLayout;for(var T=0;T<U.settings.data.model.length;T++){U.settings.data.strata[T][0].value=U.settings.data.strata[T][0].initValue}for(var T=0;T<U.settings.data.model.length;T++){U.settings.data.model[T].value=0;for(var R=0;R<U.settings.data.strata[T].length;R++){U.settings.data.model[T].value+=U.settings.data.strata[T][R].value}N.push(U.settings.data.model[T].value);E+=U.settings.data.model[T].value}if(this.treeLayout){console.log("ici");this.setupBubbleChartPhysics(U)}else{this.setupPieChartPhysics(U)}};this.setupPieChartPhysics=function(X){console.log("w",X.settings.width);var S=X.settings.chart.radius;K=X.settings.chart.width/2+X.settings.chart.x;J=X.settings.chart.height/2+X.settings.chart.y;var V=O(K,J,S,X.settings.chart.wallColor);for(var U=0;U<X.settings.data.model.length;U++){X.settings.sedimentation.incoming.target[U]={x:K,y:J}}var R=[];var T=X.settings.chart.spacer;var W=0;console.log("tdv",E);if(E==0){for(var U=0;U<X.settings.data.length;U++){N[U]=1}E=N.length}for(var U=0;U<N.length;U++){v=N[U];a2=((v/2+W)/E)*360-90;W+=v;a=(W/E)*360-90;c=L(a2,S*5,K,J);console.log(c);X.settings.sedimentation.incoming.point[U]=c;X.chartPhySetup.grounds[U]=this.createBox(X,K,J,T,S,a,S,"wall",X.settings.chart.wallColor)}console.log("w",X.settings.chart.width)};this.update=function(Y,U){console.log("update");var T={cat:0,r:0};U.r-=90;var W=(U.r+90)*(Math.PI/180);var X=L(U.r,Y.settings.chart.radius,Y.settings.chart.width/2+Y.settings.chart.x,Y.settings.chart.height/2+Y.settings.chart.y);if(Y.chartPhySetup.grounds[U.cat]!=null){var S=Y.chartPhySetup.grounds[U.cat].GetBody();var R=S.GetWorldCenter();var V=S.GetAngle();R.y=X.y/Y.settings.options.scale;R.x=X.x/Y.settings.options.scale;V=W;S.SetPosition(R);S.SetAngle(V)}};this.token=function(U,R){var T=R;var S={x:(U.settings.sedimentation.incoming.point[T].x+(Math.random()*2)),y:(U.settings.sedimentation.incoming.point[T].y+(Math.random()*1)),t:U.now(),size:U.settings.sedimentation.token.size.original,category:T,phy:{density:10,friction:0,restitution:0},targets:[{x:U.settings.sedimentation.incoming.target[T].x,y:U.settings.sedimentation.incoming.target[T].y}]};return S};function L(T,S,X,U){j=T*Math.PI/180;var R=(Math.cos(j)*S)+X;var W=(Math.sin(j)*S)+U;var V={x:R,y:W};return V}function O(W,V,R,T){var Y=I.settings.options.scale;var X=new I.phy.b2FixtureDef;X.density=1;X.friction=0.5;X.restitution=0.2;var S=new I.phy.b2BodyDef;X.shape=new I.phy.b2CircleShape(R/Y);S.position.Set(W/Y,V/Y);var U=I.world.CreateBody(S).CreateFixture(X);U.m_userData={type:"wall",familyID:null,fillStyle:T,strokeStyle:T,r:R};return U}this.createBox=function(Z,g,e,k,Y,f,R,d,W){var V=Z.settings.options.scale;var S=new Z.phy.b2FixtureDef;var b=L(f,R,g,e);S.density=1;S.friction=0.5;S.restitution=0.2;var U=new Z.phy.b2BodyDef;var T=(f+90)*(Math.PI/180);U.angle=T;U.type=Z.phy.b2Body.b2_staticBody;S.shape=new Z.phy.b2PolygonShape;S.shape.SetAsBox(k/V,Y/V);U.position.Set(b.x/V,b.y/V);var X=Z.world.CreateBody(U).CreateFixture(S);X.m_userData={type:d,fillStyle:W,w:k,h:Y,r:R};return X};this.getPosition=function(T){var R=[];for(var S=0;S<T.chartPhySetup.grounds.length;S++){myElement=T.chartPhySetup.grounds[S];myBody=myElement.GetBody();R.push({x:(myBody.GetWorldCenter().x*T.settings.options.scale),y:(myBody.GetWorldCenter().y*T.settings.options.scale),a:myBody.GetAngle(),w:myElement.m_userData.w,h:myElement.m_userData.h,r:myElement.m_userData.r,})}return R};this.setupBubbleChartPhysics=function(Y){console.log("setupBubbleChartPhysics");var V=(Y.settings.chart.width/Y.settings.data.model.length);var T=Y.settings.chart.spacer;var S=Y.settings.chart.height/2+Y.settings.y+T;var W=0;var X=0;var R=Y.settings.chart.column;for(var U=0;U<Y.settings.data.model.length;U++){X=Y.settings.chart.x+(U%R*T)+(T/2);W=Y.settings.chart.y+Math.floor(U/R)*T+(T/2);Y.settings.sedimentation.incoming.target[U]={x:X,y:W};O[U]=C(X,W,Y.settings.chart.spacer,U);Y.settings.data.model[U].incomingPoint={x:X,y:W}}};function C(b,W,X,S){console.log("CreatMyBubblePivot",b,W,X,S);var U=I.settings.options.scale;var R=new I.phy.b2FixtureDef;var Z=d3.scale.category10();R.density=10000;R.friction=0;R.restitution=0;var V=new I.phy.b2BodyDef;R.shape=new I.phy.b2CircleShape(X*U);V.position.Set(b/U,W/U);var T=I.world.CreateBody(V);var Y=T.CreateFixture(R);console.log(S,Z(S));Y.m_userData={type:"BubblePivot",familyID:S,fillStyle:I.settings.chart.wallColor};console.log(S,Y);Y.m_shape.m_radius=I.settings.data.model[S].value/U;return Y}this.getPivotPosition=function(T){if(typeof(T)!="undefined"){return this.pivot}else{var R=[];for(var S=0;S<I.settings.data.model.length;S++){R.push(I.settings.data.model[S])}return R}};function D(S,U,T){var R=O[T].GetBody();R.SetPosition(new b2Vec2(S/scale,U/scale));I.settings.data.model[T].incomingPoint.x=S;I.settings.data.model[T].incomingPoint.y=U;setFlowSpeed(speedFlow)}function B(R,U,T){for(var S=0;S<categorys[T].joins.length;S++){categorys[T].joins[S].SetTarget(new b2Vec2(R/scale,U/scale))}}function F(R,S){O[S].m_shape.m_radius=R}if(typeof(M)!=undefined){var P=this[M](I,Q);if(typeof(P)!=undefined){return P}}}})(jQuery);
\ No newline at end of file