//Copyright 2012, etc. /** * almond 0.1.2 Copyright (c) 2011, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/almond for details */ // Underscore.js 1.4.1 // http://underscorejs.org // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. // Underscore may be freely distributed under the MIT license. /* Zepto 1.0rc1 - polyfill zepto event detect fx ajax form - zeptojs.com/license */ // (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc. // Backbone may be freely distributed under the MIT license. // For all details and documentation: // http://backbonejs.org (function(e,t){typeof define=="function"&&define.amd?define(["jquery","underscore","backbone"],t):e.Map=t(e.$,e._,e.Backbone)})(this,function($,_,Backbone){var requirejs,require,define;(function(e){function a(e,t){var n=t&&t.split("/"),i=r.map,s=i&&i["*"]||{},o,u,a,f,l,c,h,p,d,v;if(e&&e.charAt(0)==="."&&t){n=n.slice(0,n.length-1),e=n.concat(e.split("/"));for(p=0;v=e[p];p++)if(v===".")e.splice(p,1),p-=1;else if(v===".."){if(p===1&&(e[2]===".."||e[0]===".."))return!0;p>0&&(e.splice(p-1,2),p-=2)}e=e.join("/")}if((n||s)&&i){o=e.split("/");for(p=o.length;p>0;p-=1){u=o.slice(0,p).join("/");if(n)for(d=n.length;d>0;d-=1){a=i[n.slice(0,d).join("/")];if(a){a=a[u];if(a){f=a,l=p;break}}}if(f)break;!c&&s&&s[u]&&(c=s[u],h=p)}!f&&c&&(f=c,l=h),f&&(o.splice(0,l,f),e=o.join("/"))}return e}function f(t,n){return function(){return u.apply(e,s.call(arguments,0).concat([t,n]))}}function l(e){return function(t){return a(t,e)}}function c(e){return function(n){t[e]=n}}function h(r){if(n.hasOwnProperty(r)){var s=n[r];delete n[r],i[r]=!0,o.apply(e,s)}if(!t.hasOwnProperty(r))throw new Error("No "+r);return t[r]}function p(e,t){var n,r,i=e.indexOf("!");return i!==-1?(n=a(e.slice(0,i),t),e=e.slice(i+1),r=h(n),r&&r.normalize?e=r.normalize(e,l(t)):e=a(e,t)):e=a(e,t),{f:n?n+"!"+e:e,n:e,p:r}}function d(e){return function(){return r&&r.config&&r.config[e]||{}}}var t={},n={},r={},i={},s=[].slice,o,u;o=function(r,s,o,u){var a=[],l,v,m,g,y,b;u=u||r;if(typeof o=="function"){s=!s.length&&o.length?["require","exports","module"]:s;for(b=0;b2;if(d&&e.reduce===d)return r&&(t=T.bind(t,r)),i?e.reduce(t,n):e.reduce(t);N(e,function(e,s,o){i?n=t.call(r,n,e,s,o):(n=e,i=!0)});if(!i)throw new TypeError("Reduce of empty array with no initial value");return n},T.reduceRight=T.foldr=function(e,t,n,r){var i=arguments.length>2;if(v&&e.reduceRight===v)return r&&(t=T.bind(t,r)),arguments.length>2?e.reduceRight(t,n):e.reduceRight(t);var s=e.length;if(s!==+s){var o=T.keys(e);s=o.length}N(e,function(u,a,f){a=o?o[--s]:--s,i?n=t.call(r,n,e[a],a,f):(n=e[a],i=!0)});if(!i)throw new TypeError("Reduce of empty array with no initial value");return n},T.find=T.detect=function(e,t,n){var r;return C(e,function(e,i,s){if(t.call(n,e,i,s))return r=e,!0}),r},T.filter=T.select=function(e,t,n){var r=[];return m&&e.filter===m?e.filter(t,n):(N(e,function(e,i,s){t.call(n,e,i,s)&&(r[r.length]=e)}),r)},T.reject=function(e,t,n){var r=[];return N(e,function(e,i,s){t.call(n,e,i,s)||(r[r.length]=e)}),r},T.every=T.all=function(e,t,r){t||(t=T.identity);var i=!0;return g&&e.every===g?e.every(t,r):(N(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n}),!!i)};var C=T.some=T.any=function(e,t,r){t||(t=T.identity);var i=!1;return y&&e.some===y?e.some(t,r):(N(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n}),!!i)};T.contains=T.include=function(e,t){var n=!1;return b&&e.indexOf===b?e.indexOf(t)!=-1:(n=C(e,function(e){return e===t}),n)},T.invoke=function(e,t){var n=u.call(arguments,2);return T.map(e,function(e){return(T.isFunction(t)?t:e[t]).apply(e,n)})},T.pluck=function(e,t){return T.map(e,function(e){return e[t]})},T.where=function(e,t){return T.isEmpty(t)?[]:T.filter(e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})},T.max=function(e,t,n){if(!t&&T.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&T.isEmpty(e))return-Infinity;var r={computed:-Infinity};return N(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>=r.computed&&(r={value:e,computed:o})}),r.value},T.min=function(e,t,n){if(!t&&T.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&T.isEmpty(e))return Infinity;var r={computed:Infinity};return N(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;or||n===void 0)return 1;if(n>>1;n.call(r,e[u])=0})})},T.difference=function(e){var t=a.apply(r,u.call(arguments,1));return T.filter(e,function(e){return!T.contains(t,e)})},T.zip=function(){var e=u.call(arguments),t=T.max(T.pluck(e,"length")),n=new Array(t);for(var r=0;r=0;n--)t=[e[n].apply(this,t)];return t[0]}},T.after=function(e,t){return e<=0?t():function(){if(--e<1)return t.apply(this,arguments)}},T.keys=S||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)T.has(e,n)&&(t[t.length]=n);return t},T.values=function(e){var t=[];for(var n in e)T.has(e,n)&&t.push(e[n]);return t},T.pairs=function(e){var t=[];for(var n in e)T.has(e,n)&&t.push([n,e[n]]);return t},T.invert=function(e){var t={};for(var n in e)T.has(e,n)&&(t[e[n]]=n);return t},T.functions=T.methods=function(e){var t=[];for(var n in e)T.isFunction(e[n])&&t.push(n);return t.sort()},T.extend=function(e){return N(u.call(arguments,1),function(t){for(var n in t)e[n]=t[n]}),e},T.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));return N(n,function(n){n in e&&(t[n]=e[n])}),t},T.omit=function(e){var t={},n=a.apply(r,u.call(arguments,1));for(var i in e)T.contains(n,i)||(t[i]=e[i]);return t},T.defaults=function(e){return N(u.call(arguments,1),function(t){for(var n in t)e[n]==null&&(e[n]=t[n])}),e},T.clone=function(e){return T.isObject(e)?T.isArray(e)?e.slice():T.extend({},e):e},T.tap=function(e,t){return t(e),e};var M=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof T&&(e=e._wrapped),t instanceof T&&(t=t._wrapped);var i=l.call(e);if(i!=l.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;n.push(e),r.push(t);var o=0,u=!0;if(i=="[object Array]"){o=e.length,u=o==t.length;if(u)while(o--)if(!(u=M(e[o],t[o],n,r)))break}else{var a=e.constructor,f=t.constructor;if(a!==f&&!(T.isFunction(a)&&a instanceof a&&T.isFunction(f)&&f instanceof f))return!1;for(var c in e)if(T.has(e,c)){o++;if(!(u=T.has(t,c)&&M(e[c],t[c],n,r)))break}if(u){for(c in t)if(T.has(t,c)&&!(o--))break;u=!o}}return n.pop(),r.pop(),u};T.isEqual=function(e,t){return M(e,t,[],[])},T.isEmpty=function(e){if(e==null)return!0;if(T.isArray(e)||T.isString(e))return e.length===0;for(var t in e)if(T.has(e,t))return!1;return!0},T.isElement=function(e){return!!e&&e.nodeType===1},T.isArray=E||function(e){return l.call(e)=="[object Array]"},T.isObject=function(e){return e===Object(e)},N(["Arguments","Function","String","Number","Date","RegExp"],function(e){T["is"+e]=function(t){return l.call(t)=="[object "+e+"]"}}),T.isArguments(arguments)||(T.isArguments=function(e){return!!e&&!!T.has(e,"callee")}),typeof /./!="function"&&(T.isFunction=function(e){return typeof e=="function"}),T.isFinite=function(e){return T.isNumber(e)&&isFinite(e)},T.isNaN=function(e){return T.isNumber(e)&&e!=+e},T.isBoolean=function(e){return e===!0||e===!1||l.call(e)=="[object Boolean]"},T.isNull=function(e){return e===null},T.isUndefined=function(e){return e===void 0},T.has=function(e,t){return c.call(e,t)},T.noConflict=function(){return e._=t,this},T.identity=function(e){return e},T.times=function(e,t,n){for(var r=0;r":">",'"':""","'":"'","/":"/"}};_.unescape=T.invert(_.escape);var D={escape:new RegExp("["+T.keys(_.escape).join("")+"]","g"),unescape:new RegExp("("+T.keys(_.unescape).join("|")+")","g")};T.each(["escape","unescape"],function(e){T[e]=function(t){return t==null?"":(""+t).replace(D[e],function(t){return _[e][t]})}}),T.result=function(e,t){if(e==null)return null;var n=e[t];return T.isFunction(n)?n.call(e):n},T.mixin=function(e){N(T.functions(e),function(t){var n=T[t]=e[t];T.prototype[t]=function(){var e=[this._wrapped];return o.apply(e,arguments),F.call(this,n.apply(T,e))}})};var P=0;T.uniqueId=function(e){var t=P++;return e?e+t:t},T.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var H=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},j=/\\|'|\r|\n|\t|\u2028|\u2029/g;T.template=function(e,t,n){n=T.defaults({},n,T.templateSettings);var r=new RegExp([(n.escape||H).source,(n.interpolate||H).source,(n.evaluate||H).source].join("|")+"|$","g"),i=0,s="__p+='";e.replace(r,function(t,n,r,o,u){s+=e.slice(i,u).replace(j,function(e){return"\\"+B[e]}),s+=n?"'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?"'+\n((__t=("+r+"))==null?'':__t)+\n'":o?"';\n"+o+"\n__p+='":"",i=u+t.length}),s+="';\n",n.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{var o=new Function(n.variable||"obj","_",s)}catch(u){throw u.source=s,u}if(t)return o(t,T);var a=function(e){return o.call(this,e,T)};return a.source="function("+(n.variable||"obj")+"){\n"+s+"}",a},T.chain=function(e){return T(e).chain()};var F=function(e){return this._chain?T(e).chain():e};T.mixin(T),N(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];T.prototype[e]=function(){var n=this._wrapped;return t.apply(n,arguments),(e=="shift"||e=="splice")&&n.length===0&&delete n[0],F.call(this,n)}}),N(["concat","join","slice"],function(e){var t=r[e];T.prototype[e]=function(){return F.call(this,t.apply(this._wrapped,arguments))}}),T.extend(T.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),typeof define=="function"&&define.amd&&define("underscore",[],function(){return T})}.call(this),function(e){String.prototype.trim===e&&(String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}),Array.prototype.reduce===e&&(Array.prototype.reduce=function(t){if(this===void 0||this===null)throw new TypeError;var n=Object(this),r=n.length>>>0,i=0,s;if(typeof t!="function")throw new TypeError;if(r==0&&arguments.length==1)throw new TypeError;if(arguments.length>=2)s=arguments[1];else do{if(i in n){s=n[i++];break}if(++i>=r)throw new TypeError}while(!0);while(i0?n.fn.concat.apply([],e):e}function B(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function j(e){return e in f?f[e]:f[e]=new RegExp("(^|\\s)"+e+"(\\s|$)")}function F(e,t){return typeof t=="number"&&!c[B(e)]?t+"px":t}function I(e){var t,n;return a[e]||(t=u.createElement(e),u.body.appendChild(t),n=l(t,"").getPropertyValue("display"),t.parentNode.removeChild(t),n=="none"&&(n="block"),a[e]=n),a[e]}function q(e){return"children"in e?s.call(e.children):n.map(e.childNodes,function(e){if(e.nodeType==1)return e})}function R(n,r,i){for(t in r)i&&M(r[t])?(M(n[t])||(n[t]={}),R(n[t],r[t],i)):r[t]!==e&&(n[t]=r[t])}function U(t,r){return r===e?n(t):n(t).filter(r)}function z(e,t,n,r){return A(t)?t.call(e,n,r):t}function W(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function X(t,n){var r=t.className,i=r&&r.baseVal!==e;if(n===e)return i?r.baseVal:r;i?r.baseVal=n:t.className=n}function V(e){var t;try{return e?e=="true"||(e=="false"?!1:e=="null"?null:isNaN(t=Number(e))?/^[\[\{]/.test(e)?n.parseJSON(e):e:t):e}catch(r){return e}}function $(e,t){t(e);for(var n in e.childNodes)$(e.childNodes[n],t)}var e,t,n,r,i=[],s=i.slice,o=i.filter,u=window.document,a={},f={},l=u.defaultView.getComputedStyle,c={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},h=/^\s*<(\w+|!)[^>]*>/,p=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,d=/^(?:body|html)$/i,v=["val","css","html","text","data","width","height","offset"],m=["after","prepend","before","append"],g=u.createElement("table"),y=u.createElement("tr"),b={tr:u.createElement("tbody"),tbody:g,thead:g,tfoot:g,td:y,th:y,"*":u.createElement("div")},w=/complete|loaded|interactive/,E=/^\.([\w-]+)$/,S=/^#([\w-]*)$/,x=/^[\w-]+$/,T={}.toString,N={},C,k,L=u.createElement("div");return N.matches=function(e,t){if(!e||e.nodeType!==1)return!1;var n=e.webkitMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.matchesSelector;if(n)return n.call(e,t);var r,i=e.parentNode,s=!i;return s&&(i=L).appendChild(e),r=~N.qsa(i,t).indexOf(e),s&&L.removeChild(e),r},C=function(e){return e.replace(/-+(.)?/g,function(e,t){return t?t.toUpperCase():""})},k=function(e){return o.call(e,function(t,n){return e.indexOf(t)==n})},N.fragment=function(t,r,i){t.replace&&(t=t.replace(p,"<$1>")),r===e&&(r=h.test(t)&&RegExp.$1),r in b||(r="*");var o,u,a=b[r];return a.innerHTML=""+t,u=n.each(s.call(a.childNodes),function(){a.removeChild(this)}),M(i)&&(o=n(u),n.each(i,function(e,t){v.indexOf(e)>-1?o[e](t):o.attr(e,t)})),u},N.Z=function(e,t){return e=e||[],e.__proto__=arguments.callee.prototype,e.selector=t||"",e},N.isZ=function(e){return e instanceof N.Z},N.init=function(t,r){if(!t)return N.Z();if(A(t))return n(u).ready(t);if(N.isZ(t))return t;var i;if(_(t))i=P(t);else if(O(t))i=[M(t)?n.extend({},t):t],t=null;else if(h.test(t))i=N.fragment(t.trim(),RegExp.$1,r),t=null;else{if(r!==e)return n(r).find(t);i=N.qsa(u,t)}return N.Z(i,t)},n=function(e,t){return N.init(e,t)},n.extend=function(e){var t,n=s.call(arguments,1);return typeof e=="boolean"&&(t=e,e=n.shift()),n.forEach(function(n){R(e,n,t)}),e},N.qsa=function(e,t){var n;return e===u&&S.test(t)?(n=e.getElementById(RegExp.$1))?[n]:[]:e.nodeType!==1&&e.nodeType!==9?[]:s.call(E.test(t)?e.getElementsByClassName(RegExp.$1):x.test(t)?e.getElementsByTagName(t):e.querySelectorAll(t))},n.contains=function(e,t){return e!==t&&e.contains(t)},n.isFunction=A,n.isObject=O,n.isArray=_,n.isPlainObject=M,n.inArray=function(e,t,n){return i.indexOf.call(t,e,n)},n.camelCase=C,n.trim=function(e){return e.trim()},n.uuid=0,n.support={},n.expr={},n.map=function(e,t){var n,r=[],i,s;if(D(e))for(i=0;i0&&N.matches(this[0],e)},not:function(t){var r=[];if(A(t)&&t.call!==e)this.each(function(e){t.call(this,e)||r.push(this)});else{var i=typeof t=="string"?this.filter(t):D(t)&&A(t.item)?s.call(t):n(t);this.forEach(function(e){i.indexOf(e)<0&&r.push(e)})}return n(r)},has:function(e){return this.filter(function(){return O(e)?n.contains(this,e):n(this).find(e).size()})},eq:function(e){return e===-1?this.slice(e):this.slice(e,+e+1)},first:function(){var e=this[0];return e&&!O(e)?e:n(e)},last:function(){var e=this[this.length-1];return e&&!O(e)?e:n(e)},find:function(e){var t;return this.length==1?t=n(N.qsa(this[0],e)):t=this.map(function(){return N.qsa(this,e)}),t},closest:function(e,t){var r=this[0];while(r&&!N.matches(r,e))r=r!==t&&r!==u&&r.parentNode;return n(r)},parents:function(e){var t=[],r=this;while(r.length>0)r=n.map(r,function(e){if((e=e.parentNode)&&e!==u&&t.indexOf(e)<0)return t.push(e),e});return U(t,e)},parent:function(e){return U(k(this.pluck("parentNode")),e)},children:function(e){return U(this.map(function(){return q(this)}),e)},contents:function(){return this.map(function(){return s.call(this.childNodes)})},siblings:function(e){return U(this.map(function(e,t){return o.call(q(t.parentNode),function(e){return e!==t})}),e)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(e){return n.map(this,function(t){return t[e]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display=null),l(this,"").getPropertyValue("display")=="none"&&(this.style.display=I(this.nodeName))})},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){var t=A(e);if(this[0]&&!t)var r=n(e).get(0),i=r.parentNode||this.length>1;return this.each(function(s){n(this).wrapAll(t?e.call(this,s):i?r.cloneNode(!0):r)})},wrapAll:function(e){if(this[0]){n(this[0]).before(e=n(e));var t;while((t=e.children()).length)e=t.first();n(e).append(this)}return this},wrapInner:function(e){var t=A(e);return this.each(function(r){var i=n(this),s=i.contents(),o=t?e.call(this,r):e;s.length?s.wrapAll(o):i.append(o)})},unwrap:function(){return this.parent().each(function(){n(this).replaceWith(n(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var r=n(this);(t===e?r.css("display")=="none":t)?r.show():r.hide()})},prev:function(e){return n(this.pluck("previousElementSibling")).filter(e||"*")},next:function(e){return n(this.pluck("nextElementSibling")).filter(e||"*")},html:function(t){return t===e?this.length>0?this[0].innerHTML:null:this.each(function(e){var r=this.innerHTML;n(this).empty().append(z(this,t,e,r))})},text:function(t){return t===e?this.length>0?this[0].textContent:null:this.each(function(){this.textContent=t})},attr:function(n,r){var i;return typeof n=="string"&&r===e?this.length==0||this[0].nodeType!==1?e:n=="value"&&this[0].nodeName=="INPUT"?this.val():!(i=this[0].getAttribute(n))&&n in this[0]?this[0][n]:i:this.each(function(e){if(this.nodeType!==1)return;if(O(n))for(t in n)W(this,t,n[t]);else W(this,n,z(this,r,e,this.getAttribute(n)))})},removeAttr:function(e){return this.each(function(){this.nodeType===1&&W(this,e)})},prop:function(t,n){return n===e?this[0]?this[0][t]:e:this.each(function(e){this[t]=z(this,n,e,this[t])})},data:function(t,n){var r=this.attr("data-"+B(t),n);return r!==null?V(r):e},val:function(t){return t===e?this.length>0?this[0].multiple?n(this[0]).find("option").filter(function(e){return this.selected}).pluck("value"):this[0].value:e:this.each(function(e){this.value=z(this,t,e,this.value)})},offset:function(){if(this.length==0)return null;var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:e.width,height:e.height}},css:function(n,r){if(arguments.length<2&&typeof n=="string")return this.length==0?e:this[0].style[C(n)]||l(this[0],"").getPropertyValue(n);var i="";for(t in n)!n[t]&&n[t]!==0?this.each(function(){this.style.removeProperty(B(t))}):i+=B(t)+":"+F(t,n[t])+";";return typeof n=="string"&&(!r&&r!==0?this.each(function(){this.style.removeProperty(B(n))}):i=B(n)+":"+F(n,r)),this.each(function(){this.style.cssText+=";"+i})},index:function(e){return e?this.indexOf(n(e)[0]):this.parent().children().indexOf(this[0])},hasClass:function(e){return this.length<1?!1:j(e).test(X(this[0]))},addClass:function(e){return this.each(function(t){r=[];var i=X(this),s=z(this,e,t,i);s.split(/\s+/g).forEach(function(e){n(this).hasClass(e)||r.push(e)},this),r.length&&X(this,i+(i?" ":"")+r.join(" "))})},removeClass:function(t){return this.each(function(n){if(t===e)return X(this,"");r=X(this),z(this,t,n,r).split(/\s+/g).forEach(function(e){r=r.replace(j(e)," ")}),X(this,r.trim())})},toggleClass:function(t,r){return this.each(function(i){var s=z(this,t,i,X(this));(r===e?!n(this).hasClass(s):r)?n(this).addClass(s):n(this).removeClass(s)})},scrollTop:function(){if(!this.length)return;return"scrollTop"in this[0]?this[0].scrollTop:this[0].scrollY},position:function(){if(!this.length)return;var e=this[0],t=this.offsetParent(),r=this.offset(),i=d.test(t[0].nodeName)?{top:0,left:0}:t.offset();return r.top-=parseFloat(n(e).css("margin-top"))||0,r.left-=parseFloat(n(e).css("margin-left"))||0,i.top+=parseFloat(n(t[0]).css("border-top-width"))||0,i.left+=parseFloat(n(t[0]).css("border-left-width"))||0,{top:r.top-i.top,left:r.left-i.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||u.body;while(e&&!d.test(e.nodeName)&&n(e).css("position")=="static")e=e.offsetParent;return e})}},["width","height"].forEach(function(t){n.fn[t]=function(r){var i,s=t.replace(/./,function(e){return e[0].toUpperCase()});return r===e?this[0]==window?window["inner"+s]:this[0]==u?u.documentElement["offset"+s]:(i=this.offset())&&i[t]:this.each(function(e){var i=n(this);i.css(t,z(this,r,e,i[t]()))})}}),m.forEach(function(e,t){var r=t%2;n.fn[e]=function(){var e=n.map(arguments,function(e){return O(e)?e:N.fragment(e)}),i,s=this.length>1;return e.length<1?this:this.each(function(o,u){i=r?u:u.parentNode,u=t==0?u.nextSibling:t==1?u.firstChild:t==2?u:null,e.forEach(function(e){if(s)e=e.cloneNode(!0);else if(!i)return n(e).remove();$(i.insertBefore(e,u),function(e){e.nodeName!=null&&e.nodeName.toUpperCase()==="SCRIPT"&&(!e.type||e.type==="text/javascript")&&!e.src&&window.eval.call(window,e.innerHTML)})})})},n.fn[r?e+"To":"insert"+(t?"Before":"After")]=function(t){return n(t)[e](this),this}}),N.Z.prototype=n.fn,N.uniq=k,N.deserializeValue=V,n.zepto=N,n}();window.Zepto=Zepto,"$"in window||(window.$=Zepto),function(e){function o(e){return e._zid||(e._zid=r++)}function u(e,t,r,i){t=a(t);if(t.ns)var s=f(t.ns);return(n[o(e)]||[]).filter(function(e){return e&&(!t.e||e.e==t.e)&&(!t.ns||s.test(e.ns))&&(!r||o(e.fn)===o(r))&&(!i||e.sel==i)})}function a(e){var t=(""+e).split(".");return{e:t[0],ns:t.slice(1).sort().join(" ")}}function f(e){return new RegExp("(?:^| )"+e.replace(" "," .* ?")+"(?: |$)")}function l(t,n,r){e.isObject(t)?e.each(t,r):t.split(/\s/).forEach(function(e){r(e,n)})}function c(e,t){return e.del&&(e.e=="focus"||e.e=="blur")||!!t}function h(e){return s[e]||e}function p(t,r,i,u,f,p){var d=o(t),v=n[d]||(n[d]=[]);l(r,i,function(n,r){var i=a(n);i.fn=r,i.sel=u,i.e in s&&(r=function(t){var n=t.relatedTarget;if(!n||n!==this&&!e.contains(this,n))return i.fn.apply(this,arguments)}),i.del=f&&f(r,n);var o=i.del||r;i.proxy=function(e){var n=o.apply(t,[e].concat(e.data));return n===!1&&(e.preventDefault(),e.stopPropagation()),n},i.i=v.length,v.push(i),t.addEventListener(h(i.e),i.proxy,c(i,p))})}function d(e,t,r,i,s){var a=o(e);l(t||"",r,function(t,r){u(e,t,r,i).forEach(function(t){delete n[a][t.i],e.removeEventListener(h(t.e),t.proxy,c(t,s))})})}function b(t){var n,r={originalEvent:t};for(n in t)!g.test(n)&&t[n]!==undefined&&(r[n]=t[n]);return e.each(y,function(e,n){r[e]=function(){return this[n]=v,t[e].apply(t,arguments)},r[n]=m}),r}function w(e){if(!("defaultPrevented"in e)){e.defaultPrevented=!1;var t=e.preventDefault;e.preventDefault=function(){this.defaultPrevented=!0,t.call(this)}}}var t=e.zepto.qsa,n={},r=1,i={},s={mouseenter:"mouseover",mouseleave:"mouseout"};i.click=i.mousedown=i.mouseup=i.mousemove="MouseEvents",e.event={add:p,remove:d},e.proxy=function(t,n){if(e.isFunction(t)){var r=function(){return t.apply(n,arguments)};return r._zid=o(t),r}if(typeof n=="string")return e.proxy(t[n],t);throw new TypeError("expected function")},e.fn.bind=function(e,t){return this.each(function(){p(this,e,t)})},e.fn.unbind=function(e,t){return this.each(function(){d(this,e,t)})},e.fn.one=function(e,t){return this.each(function(n,r){p(this,e,t,null,function(e,t){return function(){var n=e.apply(r,arguments);return d(r,t,e),n}})})};var v=function(){return!0},m=function(){return!1},g=/^([A-Z]|layer[XY]$)/,y={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};e.fn.delegate=function(t,n,r){return this.each(function(i,s){p(s,n,r,t,function(n){return function(r){var i,o=e(r.target).closest(t,s).get(0);if(o)return i=e.extend(b(r),{currentTarget:o,liveFired:s}),n.apply(o,[i].concat([].slice.call(arguments,1)))}})})},e.fn.undelegate=function(e,t,n){return this.each(function(){d(this,t,n,e)})},e.fn.live=function(t,n){return e(document.body).delegate(this.selector,t,n),this},e.fn.die=function(t,n){return e(document.body).undelegate(this.selector,t,n),this},e.fn.on=function(t,n,r){return!n||e.isFunction(n)?this.bind(t,n||r):this.delegate(n,t,r)},e.fn.off=function(t,n,r){return!n||e.isFunction(n)?this.unbind(t,n||r):this.undelegate(n,t,r)},e.fn.trigger=function(t,n){if(typeof t=="string"||e.isPlainObject(t))t=e.Event(t);return w(t),t.data=n,this.each(function(){"dispatchEvent"in this&&this.dispatchEvent(t)})},e.fn.triggerHandler=function(t,n){var r,i;return this.each(function(s,o){r=b(typeof t=="string"?e.Event(t):t),r.data=n,r.target=o,e.each(u(o,t.type||t),function(e,t){i=t.proxy(r);if(r.isImmediatePropagationStopped())return!1})}),i},"focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(t){e.fn[t]=function(e){return e?this.bind(t,e):this.trigger(t)}}),["focus","blur"].forEach(function(t){e.fn[t]=function(e){return e?this.bind(t,e):this.each(function(){try{this[t]()}catch(e){}}),this}}),e.Event=function(e,t){typeof e!="string"&&(t=e,e=t.type);var n=document.createEvent(i[e]||"Events"),r=!0;if(t)for(var s in t)s=="bubbles"?r=!!t[s]:n[s]=t[s];return n.initEvent(e,r,!0,null,null,null,null,null,null,null,null,null,null,null,null),n.isDefaultPrevented=function(){return this.defaultPrevented},n}}(Zepto),function(e){function t(e){var t=this.os={},n=this.browser={},r=e.match(/WebKit\/([\d.]+)/),i=e.match(/(Android)\s+([\d.]+)/),s=e.match(/(iPad).*OS\s([\d_]+)/),o=!s&&e.match(/(iPhone\sOS)\s([\d_]+)/),u=e.match(/(webOS|hpwOS)[\s\/]([\d.]+)/),a=u&&e.match(/TouchPad/),f=e.match(/Kindle\/([\d.]+)/),l=e.match(/Silk\/([\d._]+)/),c=e.match(/(BlackBerry).*Version\/([\d.]+)/),h=e.match(/Chrome\/([\d.]+)/)||e.match(/CriOS\/([\d.]+)/);if(n.webkit=!!r)n.version=r[1];i&&(t.android=!0,t.version=i[2]),o&&(t.ios=t.iphone=!0,t.version=o[2].replace(/_/g,".")),s&&(t.ios=t.ipad=!0,t.version=s[2].replace(/_/g,".")),u&&(t.webos=!0,t.version=u[2]),a&&(t.touchpad=!0),c&&(t.blackberry=!0,t.version=c[2]),f&&(t.kindle=!0,t.version=f[1]),l&&(n.silk=!0,n.version=l[1]),!l&&t.android&&e.match(/Kindle Fire/)&&(n.silk=!0),h&&(n.chrome=!0,n.version=h[1])}t.call(e,navigator.userAgent),e.__detect=t}(Zepto),function(e,t){function y(e){return b(e.replace(/([a-z])([A-Z])/,"$1-$2"))}function b(e){return e.toLowerCase()}function w(e){return r?r+e:b(e)}var n="",r,i,s,o={Webkit:"webkit",Moz:"",O:"o",ms:"MS"},u=window.document,a=u.createElement("div"),f=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,l,c,h,p,d,v,m,g={};e.each(o,function(e,i){if(a.style[e+"TransitionProperty"]!==t)return n="-"+b(e)+"-",r=i,!1}),l=n+"transform",g[c=n+"transition-property"]=g[h=n+"transition-duration"]=g[p=n+"transition-timing-function"]=g[d=n+"animation-name"]=g[v=n+"animation-duration"]=g[m=n+"animation-timing-function"]="",e.fx={off:r===t&&a.style.transitionProperty===t,speeds:{_default:400,fast:200,slow:600},cssPrefix:n,transitionEnd:w("TransitionEnd"),animationEnd:w("AnimationEnd")},e.fn.animate=function(t,n,r,i){return e.isObject(n)&&(r=n.easing,i=n.complete,n=n.duration),n&&(n=(typeof n=="number"?n:e.fx.speeds[n]||e.fx.speeds._default)/1e3),this.anim(t,n,r,i)},e.fn.anim=function(n,r,i,s){var o,u={},a,b="",w=this,E,S=e.fx.transitionEnd;r===t&&(r=.4),e.fx.off&&(r=0);if(typeof n=="string")u[d]=n,u[v]=r+"s",u[m]=i||"linear",S=e.fx.animationEnd;else{a=[];for(o in n)f.test(o)?b+=o+"("+n[o]+") ":(u[o]=n[o],a.push(y(o)));b&&(u[l]=b,a.push(l)),r>0&&typeof n=="object"&&(u[c]=a.join(", "),u[h]=r+"s",u[p]=i||"linear")}return E=function(t){if(typeof t!="undefined"){if(t.target!==t.currentTarget)return;e(t.target).unbind(S,arguments.callee)}e(this).css(g),s&&s.call(this)},r>0&&this.bind(S,E),this.size()&&this.get(0).clientLeft,this.css(u),r<=0&&setTimeout(function(){w.each(function(){E.call(this)})},0),this},a=null}(Zepto),function($){function triggerAndReturn(e,t,n){var r=$.Event(t);return $(e).trigger(r,n),!r.defaultPrevented}function triggerGlobal(e,t,n,r){if(e.global)return triggerAndReturn(t||document,n,r)}function ajaxStart(e){e.global&&$.active++===0&&triggerGlobal(e,null,"ajaxStart")}function ajaxStop(e){e.global&&!--$.active&&triggerGlobal(e,null,"ajaxStop")}function ajaxBeforeSend(e,t){var n=t.context;if(t.beforeSend.call(n,e,t)===!1||triggerGlobal(t,n,"ajaxBeforeSend",[e,t])===!1)return!1;triggerGlobal(t,n,"ajaxSend",[e,t])}function ajaxSuccess(e,t,n){var r=n.context,i="success";n.success.call(r,e,i,t),triggerGlobal(n,r,"ajaxSuccess",[t,n,e]),ajaxComplete(i,t,n)}function ajaxError(e,t,n,r){var i=r.context;r.error.call(i,n,t,e),triggerGlobal(r,i,"ajaxError",[n,r,e]),ajaxComplete(t,n,r)}function ajaxComplete(e,t,n){var r=n.context;n.complete.call(r,t,e),triggerGlobal(n,r,"ajaxComplete",[t,n]),ajaxStop(n)}function empty(){}function mimeToDataType(e){return e&&(e==htmlType?"html":e==jsonType?"json":scriptTypeRE.test(e)?"script":xmlTypeRE.test(e)&&"xml")||"text"}function appendQuery(e,t){return(e+"&"+t).replace(/[&?]{1,2}/,"?")}function serializeData(e){e.processData&&isObject(e.data)&&(e.data=$.param(e.data,e.traditional)),e.data&&(!e.type||e.type.toUpperCase()=="GET")&&(e.url=appendQuery(e.url,e.data))}function serialize(e,t,n,r){var i=$.isArray(t);$.each(t,function(t,s){r&&(t=n?r:r+"["+(i?"":t)+"]"),!r&&i?e.add(s.name,s.value):(n?$.isArray(s):isObject(s))?serialize(e,s,n,t):e.add(t,s)})}var jsonpID=0,isObject=$.isObject,document=window.document,key,name,rscript=/)<[^<]*)*<\/script>/gi,scriptTypeRE=/^(?:text|application)\/javascript/i,xmlTypeRE=/^(?:text|application)\/xml/i,jsonType="application/json",htmlType="text/html",blankRE=/^\s*$/;$.active=0,$.ajaxJSONP=function(e){if("type"in e){var t="jsonp"+ ++jsonpID,n=document.createElement("script"),r=function(){$(n).remove(),t in window&&(window[t]=empty),ajaxComplete("abort",i,e)},i={abort:r},s;return e.error&&(n.onerror=function(){i.abort(),e.error()}),window[t]=function(r){clearTimeout(s),$(n).remove(),delete window[t],ajaxSuccess(r,i,e)},serializeData(e),n.src=e.url.replace(/=\?/,"="+t),$("head").append(n),e.timeout>0&&(s=setTimeout(function(){i.abort(),ajaxComplete("timeout",i,e)},e.timeout)),i}return $.ajax(e)},$.ajaxSettings={type:"GET",beforeSend:empty,success:empty,error:empty,complete:empty,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript",json:jsonType,xml:"application/xml, text/xml",html:htmlType,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0},$.ajax=function(options){var settings=$.extend({},options||{});for(key in $.ajaxSettings)settings[key]===undefined&&(settings[key]=$.ajaxSettings[key]);ajaxStart(settings),settings.crossDomain||(settings.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(settings.url)&&RegExp.$2!=window.location.host);var dataType=settings.dataType,hasPlaceholder=/=\?/.test(settings.url);if(dataType=="jsonp"||hasPlaceholder)return hasPlaceholder||(settings.url=appendQuery(settings.url,"callback=?")),$.ajaxJSONP(settings);settings.url||(settings.url=window.location.toString()),serializeData(settings);var mime=settings.accepts[dataType],baseHeaders={},protocol=/^([\w-]+:)\/\//.test(settings.url)?RegExp.$1:window.location.protocol,xhr=$.ajaxSettings.xhr(),abortTimeout;settings.crossDomain||(baseHeaders["X-Requested-With"]="XMLHttpRequest"),mime&&(baseHeaders.Accept=mime,mime.indexOf(",")>-1&&(mime=mime.split(",",2)[0]),xhr.overrideMimeType&&xhr.overrideMimeType(mime));if(settings.contentType||settings.contentType!==!1&&settings.data&&settings.type.toUpperCase()!="GET")baseHeaders["Content-Type"]=settings.contentType||"application/x-www-form-urlencoded";settings.headers=$.extend(baseHeaders,settings.headers||{}),xhr.onreadystatechange=function(){if(xhr.readyState==4){clearTimeout(abortTimeout);var result,error=!1;if(xhr.status>=200&&xhr.status<300||xhr.status==304||xhr.status==0&&protocol=="file:"){dataType=dataType||mimeToDataType(xhr.getResponseHeader("content-type")),result=xhr.responseText;try{dataType=="script"?(1,eval)(result):dataType=="xml"?result=xhr.responseXML:dataType=="json"&&(result=blankRE.test(result)?null:$.parseJSON(result))}catch(e){error=e}error?ajaxError(error,"parsererror",xhr,settings):ajaxSuccess(result,xhr,settings)}else ajaxError(null,"error",xhr,settings)}};var async="async"in settings?settings.async:!0;xhr.open(settings.type,settings.url,async);for(name in settings.headers)xhr.setRequestHeader(name,settings.headers[name]);return ajaxBeforeSend(xhr,settings)===!1?(xhr.abort(),!1):(settings.timeout>0&&(abortTimeout=setTimeout(function(){xhr.onreadystatechange=empty,xhr.abort(),ajaxError(null,"timeout",xhr,settings)},settings.timeout)),xhr.send(settings.data?settings.data:null),xhr)},$.get=function(e,t){return $.ajax({url:e,success:t})},$.post=function(e,t,n,r){return $.isFunction(t)&&(r=r||n,n=t,t=null),$.ajax({type:"POST",url:e,data:t,success:n,dataType:r})},$.getJSON=function(e,t){return $.ajax({url:e,success:t,dataType:"json"})},$.fn.load=function(e,t){if(!this.length)return this;var n=this,r=e.split(/\s/),i;return r.length>1&&(e=r[0],i=r[1]),$.get(e,function(e){n.html(i?$("
").html(e.replace(rscript,"")).find(i):e),t&&t.apply(n,arguments)}),this};var escape=encodeURIComponent;$.param=function(e,t){var n=[];return n.add=function(e,t){this.push(escape(e)+"="+escape(t))},serialize(n,e,t),n.join("&").replace(/%20/g,"+")}}(Zepto),function(e){e.fn.serializeArray=function(){var t=[],n;return e(Array.prototype.slice.call(this.get(0).elements)).each(function(){n=e(this);var r=n.attr("type");this.nodeName.toLowerCase()!="fieldset"&&!this.disabled&&r!="submit"&&r!="reset"&&r!="button"&&(r!="radio"&&r!="checkbox"||this.checked)&&t.push({name:n.attr("name"),value:n.val()})}),t},e.fn.serialize=function(){var e=[];return this.serializeArray().forEach(function(t){e.push(encodeURIComponent(t.name)+"="+encodeURIComponent(t.value))}),e.join("&")},e.fn.submit=function(t){if(t)this.bind("submit",t);else if(this.length){var n=e.Event("submit");this.eq(0).trigger(n),n.defaultPrevented||this.get(0).submit()}return this}}(Zepto),define("jquery",function(e){return function(){var t,n;return t||e.$}}(this)),function(e,t){typeof exports!="undefined"?t(e,exports,require("underscore")):typeof define=="function"&&define.amd?define("backbone",["underscore","jquery","exports"],function(n,r,i){e.Backbone=t(e,i,n,r)}):e.Backbone=t(e,{},e._,e.jQuery||e.Zepto||e.ender)}(this,function(e,t,n,r){var i=e.Backbone,s=Array.prototype.slice,o=Array.prototype.splice;t.VERSION="0.9.2",t.setDomLibrary=function(e){r=e},t.noConflict=function(){return e.Backbone=i,t},t.emulateHTTP=!1,t.emulateJSON=!1;var u=/\s+/,a=t.Events={on:function(e,t,n){var r,i,s,o,a;if(!t)return this;e=e.split(u),r=this._callbacks||(this._callbacks={});while(i=e.shift())a=r[i],s=a?a.tail:{},s.next=o={},s.context=n,s.callback=t,r[i]={tail:o,next:a?a.next:s};return this},off:function(e,t,r){var i,s,o,a,f,l;if(!(s=this._callbacks))return;if(!(e||t||r))return delete this._callbacks,this;e=e?e.split(u):n.keys(s);while(i=e.shift()){o=s[i],delete s[i];if(!o||!t&&!r)continue;a=o.tail;while((o=o.next)!==a)f=o.callback,l=o.context,(t&&f!==t||r&&l!==r)&&this.on(i,f,l)}return this},trigger:function(e){var t,n,r,i,o,a,f;if(!(r=this._callbacks))return this;a=r.all,e=e.split(u),f=s.call(arguments,1);while(t=e.shift()){if(n=r[t]){i=n.tail;while((n=n.next)!==i)n.callback.apply(n.context||this,f)}if(n=a){i=n.tail,o=[t].concat(f);while((n=n.next)!==i)n.callback.apply(n.context||this,o)}}return this}};a.bind=a.on,a.unbind=a.off;var f=t.Model=function(e,t){var r;e||(e={}),t&&t.parse&&(e=this.parse(e));if(r=C(this,"defaults"))e=n.extend({},r,e);t&&t.collection&&(this.collection=t.collection),this.attributes={},this._escapedAttributes={},this.cid=n.uniqueId("c"),this.changed={},this._silent={},this._pending={},this.set(e,{silent:!0}),this.changed={},this._silent={},this._pending={},this._previousAttributes=n.clone(this.attributes),this.initialize.apply(this,arguments)};n.extend(f.prototype,a,{changed:null,_silent:null,_pending:null,idAttribute:"id",initialize:function(){},toJSON:function(e){return n.clone(this.attributes)},get:function(e){return this.attributes[e]},escape:function(e){var t;if(t=this._escapedAttributes[e])return t;var r=this.get(e);return this._escapedAttributes[e]=n.escape(r==null?"":""+r)},has:function(e){return this.get(e)!=null},set:function(e,t,r){var i,s,o;n.isObject(e)||e==null?(i=e,r=t):(i={},i[e]=t),r||(r={});if(!i)return this;i instanceof f&&(i=i.attributes);if(r.unset)for(s in i)i[s]=void 0;if(!this._validate(i,r))return!1;this.idAttribute in i&&(this.id=i[this.idAttribute]);var u=r.changes={},a=this.attributes,l=this._escapedAttributes,c=this._previousAttributes||{};for(s in i){o=i[s];if(!n.isEqual(a[s],o)||r.unset&&n.has(a,s))delete l[s],(r.silent?this._silent:u)[s]=!0;r.unset?delete a[s]:a[s]=o,!n.isEqual(c[s],o)||n.has(a,s)!=n.has(c,s)?(this.changed[s]=o,r.silent||(this._pending[s]=!0)):(delete this.changed[s],delete this._pending[s])}return r.silent||this.change(r),this},unset:function(e,t){return(t||(t={})).unset=!0,this.set(e,null,t)},clear:function(e){return(e||(e={})).unset=!0,this.set(n.clone(this.attributes),e)},fetch:function(e){e=e?n.clone(e):{};var r=this,i=e.success;return e.success=function(t,n,s){if(!r.set(r.parse(t,s),e))return!1;i&&i(r,t)},e.error=t.wrapError(e.error,r,e),(this.sync||t.sync).call(this,"read",this,e)},save:function(e,r,i){var s,o;n.isObject(e)||e==null?(s=e,i=r):(s={},s[e]=r),i=i?n.clone(i):{};if(i.wait){if(!this._validate(s,i))return!1;o=n.clone(this.attributes)}var u=n.extend({},i,{silent:!0});if(s&&!this.set(s,i.wait?u:i))return!1;var a=this,f=i.success;i.success=function(e,t,r){var o=a.parse(e,r);i.wait&&(delete i.wait,o=n.extend(s||{},o));if(!a.set(o,i))return!1;f?f(a,e):a.trigger("sync",a,e,i)},i.error=t.wrapError(i.error,a,i);var l=this.isNew()?"create":"update",c=(this.sync||t.sync).call(this,l,this,i);return i.wait&&this.set(o,u),c},destroy:function(e){e=e?n.clone(e):{};var r=this,i=e.success,s=function(){r.trigger("destroy",r,r.collection,e)};if(this.isNew())return s(),!1;e.success=function(t){e.wait&&s(),i?i(r,t):r.trigger("sync",r,t,e)},e.error=t.wrapError(e.error,r,e);var o=(this.sync||t.sync).call(this,"delete",this,e);return e.wait||s(),o},url:function(){var e=C(this,"urlRoot")||C(this.collection,"url")||k();return this.isNew()?e:e+(e.charAt(e.length-1)=="/"?"":"/")+encodeURIComponent(this.id)},parse:function(e,t){return e},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return this.id==null},change:function(e){e||(e={});var t=this._changing;this._changing=!0;for(var r in this._silent)this._pending[r]=!0;var i=n.extend({},e.changes,this._silent);this._silent={};for(var r in i)this.trigger("change:"+r,this,this.get(r),e);if(t)return this;while(!n.isEmpty(this._pending)){this._pending={},this.trigger("change",this,e);for(var r in this.changed){if(this._pending[r]||this._silent[r])continue;delete this.changed[r]}this._previousAttributes=n.clone(this.attributes)}return this._changing=!1,this},hasChanged:function(e){return arguments.length?n.has(this.changed,e):!n.isEmpty(this.changed)},changedAttributes:function(e){if(!e)return this.hasChanged()?n.clone(this.changed):!1;var t,r=!1,i=this._previousAttributes;for(var s in e){if(n.isEqual(i[s],t=e[s]))continue;(r||(r={}))[s]=t}return r},previous:function(e){return!arguments.length||!this._previousAttributes?null:this._previousAttributes[e]},previousAttributes:function(){return n.clone(this._previousAttributes)},isValid:function(){return!this.validate(this.attributes)},_validate:function(e,t){if(t.silent||!this.validate)return!0;e=n.extend({},this.attributes,e);var r=this.validate(e,t);return r?(t&&t.error?t.error(this,r,t):this.trigger("error",this,r,t),!1):!0}});var l=t.Collection=function(e,t){t||(t={}),t.model&&(this.model=t.model),t.comparator&&(this.comparator=t.comparator),this._reset(),this.initialize.apply(this,arguments),e&&this.reset(e,{silent:!0,parse:t.parse})};n.extend(l.prototype,a,{model:f,initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},add:function(e,t){var r,i,s,u,a,f,l={},c={},h=[];t||(t={}),e=n.isArray(e)?e.slice():[e];for(r=0,s=e.length;r').hide().appendTo("body")[0].contentWindow,this.navigate(t)),this._hasPushState?r(window).bind("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!s?r(window).bind("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=t;var o=window.location,u=o.pathname==this.options.root;if(this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!u)return this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment),!0;this._wantsPushState&&this._hasPushState&&u&&o.hash&&(this.fragment=this.getHash().replace(g,""),window.history.replaceState({},document.title,o.protocol+"//"+o.host+this.options.root+this.fragment));if(!this.options.silent)return this.loadUrl()},stop:function(){r(window).unbind("popstate",this.checkUrl).unbind("hashchange",this.checkUrl),clearInterval(this._checkUrlInterval),m.started=!1},route:function(e,t){this.handlers.unshift({route:e,callback:t})},checkUrl:function(e){var t=this.getFragment();t==this.fragment&&this.iframe&&(t=this.getFragment(this.getHash(this.iframe)));if(t==this.fragment)return!1;this.iframe&&this.navigate(t),this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(e){var t=this.fragment=this.getFragment(e),r=n.any(this.handlers,function(e){if(e.route.test(t))return e.callback(t),!0});return r},navigate:function(e,t){if(!m.started)return!1;if(!t||t===!0)t={trigger:t};var n=(e||"").replace(g,"");if(this.fragment==n)return;this._hasPushState?(n.indexOf(this.options.root)!=0&&(n=this.options.root+n),this.fragment=n,window.history[t.replace?"replaceState":"pushState"]({},document.title,n)):this._wantsHashChange?(this.fragment=n,this._updateHash(window.location,n,t.replace),this.iframe&&n!=this.getFragment(this.getHash(this.iframe))&&(t.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,n,t.replace))):window.location.assign(this.options.root+e),t.trigger&&this.loadUrl(e)},_updateHash:function(e,t,n){n?e.replace(e.toString().replace(/(javascript:|#).*$/,"")+"#"+t):e.hash=t}});var b=t.View=function(e){this.cid=n.uniqueId("view"),this._configure(e||{}),this._ensureElement(),this.initialize.apply(this,arguments),this.delegateEvents()},w=/^(\S+)\s*(.*)$/,E=["model","collection","el","id","attributes","className","tagName"];n.extend(b.prototype,a,{tagName:"div",$:function(e){return this.$el.find(e)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this},make:function(e,t,n){var i=document.createElement(e);return t&&r(i).attr(t),n!=null&&r(i).html(n),i},setElement:function(e,t){return this.$el&&this.undelegateEvents(),this.$el=e instanceof r?e:r(e),this.el=this.$el[0],t!==!1&&this.delegateEvents(),this},delegateEvents:function(e){if(!e&&!(e=C(this,"events")))return;this.undelegateEvents();for(var t in e){var r=e[t];n.isFunction(r)||(r=this[e[t]]);if(!r)throw new Error('Method "'+e[t]+'" does not exist');var i=t.match(w),s=i[1],o=i[2];r=n.bind(r,this),s+=".delegateEvents"+this.cid,o===""?this.$el.bind(s,r):this.$el.delegate(o,s,r)}},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+this.cid)},_configure:function(e){this.options&&(e=n.extend({},this.options,e));for(var t=0,r=E.length;t8?function(e){return e/n}:function(e){return e*n},symbol:e}}function Q(e){return function(t){return t<=0?0:t>=1?1:e(t)}}function G(e){return function(t){return 1-e(1-t)}}function Y(e){return function(t){return.5*(t<.5?e(2*t):2-e(2-2*t))}}function Z(e){return e*e}function et(e){return e*e*e}function tt(e){if(e<=0)return 0;if(e>=1)return 1;var t=e*e,n=t*e;return 4*(e<.5?n:3*(e-t)+n-.75)}function nt(e){return function(t){return Math.pow(t,e)}}function rt(e){return 1-Math.cos(e*o/2)}function it(e){return Math.pow(2,10*(e-1))}function st(e){return 1-Math.sqrt(1-e*e)}function ot(e,t){var n;return arguments.length<2&&(t=.45),arguments.length?n=t/(2*o)*Math.asin(1/e):(e=1,n=t/4),function(r){return 1+e*Math.pow(2,10*-r)*Math.sin((r-n)*2*o/t)}}function ut(e){return e||(e=1.70158),function(t){return t*t*((e+1)*t-e)}}function at(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375}function ft(){d3.event.stopPropagation(),d3.event.preventDefault()}function lt(){var e=d3.event,t;while(t=e.sourceEvent)e=t;return e}function ct(e){var t=new j,n=0,r=arguments.length;while(++n360?e-=360:e<0&&(e+=360),e<60?r+(i-r)*e/60:e<180?i:e<240?r+(i-r)*(240-e)/60:r}function o(e){return Math.round(s(e)*255)}var r,i;return e%=360,e<0&&(e+=360),t=t<0?0:t>1?1:t,n=n<0?0:n>1?1:n,i=n<=.5?n*(1+t):n+t-n*t,r=2*n-i,St(o(e+120),o(e),o(e-120))}function Bt(e,t,n){return new jt(e,t,n)}function jt(e,t,n){this.h=e,this.c=t,this.l=n}function It(e,t,n){return qt(n,Math.cos(e*=a)*t,Math.sin(e)*t)}function qt(e,t,n){return new Rt(e,t,n)}function Rt(e,t,n){this.l=e,this.a=t,this.b=n}function $t(e,t,n){var r=(e+16)/116,i=r+t/500,s=r-n/200;return i=Kt(i)*zt,r=Kt(r)*Wt,s=Kt(s)*Xt,St(Gt(3.2404542*i-1.5371385*r-.4985314*s),Gt(-0.969266*i+1.8760108*r+.041556*s),Gt(.0556434*i-.2040259*r+1.0572252*s))}function Jt(e,t,n){return Bt(Math.atan2(n,t)/o*180,Math.sqrt(t*t+n*n),e)}function Kt(e){return e>.206893034?e*e*e:(e-4/29)/7.787037}function Qt(e){return e>.008856?Math.pow(e,1/3):7.787037*e+4/29}function Gt(e){return Math.round(255*(e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055))}function Yt(e){return g(e,sn),e}function on(e){return function(){return Zt(e,this)}}function un(e){return function(){return en(e,this)}}function an(e,t){function n(){this.removeAttribute(e)}function r(){this.removeAttributeNS(e.space,e.local)}function i(){this.setAttribute(e,t)}function s(){this.setAttributeNS(e.space,e.local,t)}function o(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}function u(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}return e=d3.ns.qualify(e),t==null?e.local?r:n:typeof t=="function"?e.local?u:o:e.local?s:i}function fn(e){return new RegExp("(?:^|\\s+)"+d3.requote(e)+"(?:\\s+|$)","g")}function ln(e,t){function r(){var r=-1;while(++r0&&(e=e.substring(0,i)),t?o:s}function yn(e,t){for(var n=0,r=e.length;nn?v():(i.active=n,f.start.call(e,u,t),s.tween.forEach(function(n,r){(r=r.call(e,u,t))&&h.push(r)}),d(r)||d3.timer(d,0,o),1)}function d(r){if(i.active!==n)return v();var s=(r-l)/c,o=a(s),p=h.length;while(p>0)h[--p].call(e,o);if(s>=1)return v(),f.end.call(e,u,t),1}function v(){return--i.count?delete i[n]:delete e.__transition__,1}var u=e.__data__,a=s.ease,f=s.event,l=s.delay,c=s.duration,h=[];return l<=r?p(r):d3.timer(p,l,o),1},0,o),s}}function Ln(e){return e==null&&(e=""),function(){this.textContent=e}}function An(e,t,n,r){var i=e.id;return yn(e,typeof n=="function"?function(e,s,o){e.__transition__[i].tween.set(t,r(n.call(e,e.__data__,s,o)))}:(n=r(n),function(e){e.__transition__[i].tween.set(t,n)}))}function Hn(){var e,t=Date.now(),n=_n;while(n)e=t-n.then,e>=n.delay&&(n.flush=n.callback(e)),n=n.next;var r=Bn()-t;r>24?(isFinite(r)&&(clearTimeout(Pn),Pn=setTimeout(Hn,r)),Dn=0):(Dn=1,jn(Hn))}function Bn(){var e=null,t=_n,n=Infinity;while(t)t.flush?(delete Mn[t.callback.id],t=e?e.next=t.next:_n=t.next):(n=Math.min(n,t.then+t.delay),t=(e=t).next);return n}function In(e,t){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();if(Fn<0&&(window.scrollX||window.scrollY)){n=d3.select(document.body).append("svg").style("position","absolute").style("top",0).style("left",0);var i=n[0][0].getScreenCTM();Fn=!i.f&&!i.e,n.remove()}return Fn?(r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}var s=e.getBoundingClientRect();return[t.clientX-s.left-e.clientLeft,t.clientY-s.top-e.clientTop]}function qn(){}function Rn(e){var t=e[0],n=e[e.length-1];return t2?Yn:Gn,a=r?wt:bt;return i=o(e,t,a,n),s=o(t,e,a,d3.interpolate),u}function u(e){return i(e)}var i,s;return u.invert=function(e){return s(e)},u.domain=function(t){return arguments.length?(e=t.map(Number),o()):e},u.range=function(e){return arguments.length?(t=e,o()):t},u.rangeRound=function(e){return u.range(e).interpolate(d3.interpolateRound)},u.clamp=function(e){return arguments.length?(r=e,o()):r},u.interpolate=function(e){return arguments.length?(n=e,o()):n},u.ticks=function(t){return Kn(e,t)},u.tickFormat=function(t){return Qn(e,t)},u.nice=function(){return zn(e,$n),o()},u.copy=function(){return Xn(e,t,n,r)},o()}function Vn(e,t){return d3.rebind(e,t,"range","rangeRound","interpolate","clamp")}function $n(e){return e=Math.pow(10,Math.round(Math.log(e)/Math.LN10)-1),e&&{floor:function(t){return Math.floor(t/e)*e},ceil:function(t){return Math.ceil(t/e)*e}}}function Jn(e,t){var n=Rn(e),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),s=t/r*i;return s<=.15?i*=10:s<=.35?i*=5:s<=.75&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+i*.5,n[2]=i,n}function Kn(e,t){return d3.range.apply(d3,Jn(e,t))}function Qn(e,t){return d3.format(",."+Math.max(0,-Math.floor(Math.log(Jn(e,t)[2])/Math.LN10+.01))+"f")}function Gn(e,t,n,r){var i=n(e[0],e[1]),s=r(t[0],t[1]);return function(e){return s(i(e))}}function Yn(e,t,n,r){var i=[],s=[],o=0,u=Math.min(e.length,t.length)-1;e[u]0;f--)i.push(n(s)*f)}else{for(;sa;o--);i=i.slice(s,o)}return i},r.tickFormat=function(e,i){arguments.length<2&&(i=er);if(!arguments.length)return i;var s=Math.max(.1,e/r.ticks().length),o=t===nr?(u=-1e-12,Math.floor):(u=1e-12,Math.ceil),u;return function(e){return e/n(o(t(e)+u))<=s?i(e):""}},r.copy=function(){return Zn(e.copy(),t)},Vn(r,e)}function tr(e){return Math.log(e<0?0:e)/Math.LN10}function nr(e){return-Math.log(e>0?0:-e)/Math.LN10}function rr(e,t){function i(t){return e(n(t))}var n=ir(t),r=ir(1/t);return i.invert=function(t){return r(e.invert(t))},i.domain=function(t){return arguments.length?(e.domain(t.map(n)),i):e.domain().map(r)},i.ticks=function(e){return Kn(i.domain(),e)},i.tickFormat=function(e){return Qn(i.domain(),e)},i.nice=function(){return i.domain(zn(i.domain(),$n))},i.exponent=function(e){if(!arguments.length)return t;var s=i.domain();return n=ir(t=e),r=ir(1/t),i.domain(s)},i.copy=function(){return rr(e.copy(),t)},Vn(i,e)}function ir(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function sr(e,t){function s(t){return r[((n.get(t)||n.set(t,e.push(t)))-1)%r.length]}function o(t,n){return d3.range(e.length).map(function(e){return t+n*e})}var n,r,i;return s.domain=function(r){if(!arguments.length)return e;e=[],n=new y;var i=-1,o=r.length,u;while(++i1){u=t[1],s=e[a],a++,r+="C"+(i[0]+o[0])+","+(i[1]+o[1])+","+(s[0]-u[0])+","+(s[1]-u[1])+","+s[0]+","+s[1];for(var f=2;f9&&(s=n*3/Math.sqrt(s),o[u]=s*r,o[u+1]=s*i));u=-1;while(++u<=a)s=(e[Math.min(a,u+1)][0]-e[Math.max(0,u-1)][0])/(6*(1+o[u]*o[u])),t.push([s||0,o[u]*s||0]);return t}function Xr(e){return e.length<3?Tr(e):e[0]+Mr(e,Wr(e))}function Vr(e){var t,n=-1,r=e.length,i,s;while(++n1){var r=Rn(e.domain()),i,s=-1,o=t.length,u=(t[1]-t[0])/++n,a,f;while(++s0;)(f=+t[s]-a*u)>=r[0]&&i.push(f);for(--s,a=0;++ar&&(n=t,r=i);return n}function Oi(e){return e.reduce(Mi,0)}function Mi(e,t){return e+t[1]}function _i(e,t){return Di(e,Math.ceil(Math.log(t.length)/Math.LN2+1))}function Di(e,t){var n=-1,r=+e[0],i=(e[1]-r)/t,s=[];while(++n<=t)s[n]=i*n+r;return s}function Pi(e){return[d3.min(e),d3.max(e)]}function Hi(e,t){return d3.rebind(e,t,"sort","children","value"),e.nodes=e,e.links=Ii,e}function Bi(e){return e.children}function ji(e){return e.value}function Fi(e,t){return t.value-e.value}function Ii(e){return d3.merge(e.map(function(e){return(e.children||[]).map(function(t){return{source:e,target:t}})}))}function qi(e,t){return e.value-t.value}function Ri(e,t){var n=e._pack_next;e._pack_next=t,t._pack_prev=e,t._pack_next=n,n._pack_prev=t}function Ui(e,t){e._pack_next=t,t._pack_prev=e}function zi(e,t){var n=t.x-e.x,r=t.y-e.y,i=e.r+t.r;return i*i-n*n-r*r>.001}function Wi(e){function p(e){n=Math.min(e.x-e.r,n),r=Math.max(e.x+e.r,r),i=Math.min(e.y-e.r,i),s=Math.max(e.y+e.r,s)}if(!(t=e.children)||!(h=t.length))return;var t,n=Infinity,r=-Infinity,i=Infinity,s=-Infinity,o,u,a,f,l,c,h;t.forEach(Xi),o=t[0],o.x=-o.r,o.y=0,p(o);if(h>1){u=t[1],u.x=u.r,u.y=0,p(u);if(h>2){a=t[2],Ji(o,u,a),p(a),Ri(o,a),o._pack_prev=a,Ri(a,u),u=o._pack_next;for(f=3;f0&&(e=r)}return e}function rs(e,t){return e.x-t.x}function is(e,t){return t.x-e.x}function ss(e,t){return e.depth-t.depth}function os(e,t){function n(e,r){var i=e.children;if(i&&(a=i.length)){var s,o=null,u=-1,a;while(++u=0)s=r[i]._tree,s.prelim+=t,s.mod+=t,t+=s.shift+(n+=s.change)}function as(e,t,n){e=e._tree,t=t._tree;var r=n/(t.number-e.number);e.change+=r,t.change-=r,t.shift+=n,t.prelim+=n,t.mod+=n}function fs(e,t,n){return e._tree.ancestor.parent==t.parent?e._tree.ancestor:n}function ls(e){return{x:e.x,y:e.y,dx:e.dx,dy:e.dy}}function cs(e,t){var n=e.x+t[3],r=e.y+t[0],i=e.dx-t[1]-t[3],s=e.dy-t[0]-t[2];return i<0&&(n+=i/2,i=0),s<0&&(r+=s/2,s=0),{x:n,y:r,dx:i,dy:s}}function hs(e,t){function i(e,n){return d3.xhr(e,t,n).response(s)}function s(e){return i.parse(e.responseText)}function o(t){return t.map(u).join(e)}function u(e){return n.test(e)?'"'+e.replace(/\"/g,'""')+'"':e}var n=new RegExp('["'+e+"\n]"),r=e.charCodeAt(0);return i.parse=function(e){var t;return i.parseRows(e,function(e){if(t)return t(e);t=new Function("d","return {"+e.map(function(e,t){return JSON.stringify(e)+": d["+t+"]"}).join(",")+"}")})},i.parseRows=function(e,t){function c(){if(u>=o)return i;if(l)return l=!1,n;var t=u;if(e.charCodeAt(t)===34){var s=t;while(s++4*t&&m--){var E=o+p,S=a+d,x=f+v,T=Math.sqrt(E*E+S*S+x*x),N=Math.asin(x/=T),C=Math.abs(Math.abs(x)-1)t||Math.abs((y*O+b*M)/w-.5)>.3)i(n,r,s,o,a,f,L,A,C,E/=T,S/=T,x,m,g),g.point(L,A),i(L,A,C,E,S,x,l,c,h,p,d,v,m,g)}}var t=.5,n=16;return r.precision=function(e){return arguments.length?(n=(t=e*e)>0&&16,r):Math.sqrt(t)},r}function ks(e,t){function o(e,t){var n=Math.sqrt(i-2*r*Math.sin(t))/r;return[n*Math.sin(e*=r),s-n*Math.cos(e)]}var n=Math.sin(e),r=(n+Math.sin(t))/2,i=1+n*(2*r-n),s=Math.sqrt(i)/r;return o.invert=function(e,t){var n=s-t;return[Math.atan2(e,n)/r,Math.asin((i-(e*e+n*n)*r*r)/(2*r))]},o}function Os(e){function o(e,s){er&&(r=e),si&&(i=s)}function u(){s.point=s.lineEnd=qn}var t,n,r,i,s={point:o,lineStart:qn,lineEnd:qn,polygonStart:function(){s.lineEnd=u},polygonEnd:function(){s.point=o}};return function(o){return i=r=-(t=n=Infinity),d3.geo.stream(o,e(s)),[[t,n],[r,i]]}}function js(e,t){if(Ms)return;++_s,e*=a;var n=Math.cos(t*=a);Ds+=(n*Math.cos(e)-Ds)/_s,Ps+=(n*Math.sin(e)-Ps)/_s,Hs+=(Math.sin(t)-Hs)/_s}function Fs(){var e,t;Ms=1,Is(),Ms=2;var n=Bs.point;Bs.point=function(r,i){n(e=r,t=i)},Bs.lineEnd=function(){Bs.point(e,t),qs(),Bs.lineEnd=qs}}function Is(){function r(r,i){r*=a;var s=Math.cos(i*=a),o=s*Math.cos(r),u=s*Math.sin(r),f=Math.sin(i),l=Math.atan2(Math.sqrt((l=t*f-n*u)*l+(l=n*o-e*f)*l+(l=e*u-t*o)*l),e*o+t*u+n*f);_s+=l,Ds+=l*(e+(e=o)),Ps+=l*(t+(t=u)),Hs+=l*(n+(n=f))}var e,t,n;if(Ms>1)return;Ms<1&&(Ms=1,_s=Ds=Ps=Hs=0),Bs.point=function(i,s){i*=a;var o=Math.cos(s*=a);e=o*Math.cos(i),t=o*Math.sin(i),n=Math.sin(s),Bs.point=r}}function qs(){Bs.point=js}function Rs(e,t){var n=Math.cos(e),r=Math.sin(e);return function(i,s,u,a){if(i!=null){i=Us(n,i),s=Us(n,s);if(u>0?is)i+=u*2*o}else i=e+u*2*o,s=e;var f;for(var l=u*t,c=i;u>0?c>s:c1&&e&2&&t.push(t.pop().concat(t.shift())),c.push(t.filter($s))}var i=t(r),s={point:o,lineStart:f,lineEnd:l,polygonStart:function(){s.point=y,s.lineStart=b,s.lineEnd=w,d=!1,p=h=0,c=[],r.polygonStart()},polygonEnd:function(){s.point=o,s.lineStart=f,s.lineEnd=l,c=d3.merge(c);if(c.length)Ws(c,n,r);else if(h<-u||d&&p<-u)r.lineStart(),n(null,null,1,r),r.lineEnd();r.polygonEnd(),c=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}},c,h,p,d,v=Js(),m=t(v),g;return s}}function Ws(e,t,n){var r=[],i=[];e.forEach(function(e){var t=e.length;if(t<=1)return;var n=e[0],s=e[t-1],o={point:n,points:e,other:null,visited:!1,entry:!0,subject:!0},u={point:n,points:[n],other:o,visited:!1,entry:!1,subject:!1};o.other=u,r.push(o),i.push(u),o={point:s,points:[s],other:null,visited:!1,entry:!1,subject:!0},u={point:s,points:[s],other:o,visited:!1,entry:!0,subject:!1},o.other=u,r.push(o),i.push(u)}),i.sort(Vs),Xs(r),Xs(i);if(!r.length)return;var s=r[0],o,u,a;for(;;){o=s;while(o.visited)if((o=o.next)===s)return;u=o.points,n.lineStart();do{o.visited=o.other.visited=!0;if(o.entry){if(o.subject)for(var f=0;f=0;)n.point((a=u[f])[0],a[1])}else t(o.point,o.prev.point,-1,n);o=o.prev}o=o.other,u=o.points}while(!o.visited);n.lineEnd()}}function Xs(e){if(!(t=e.length))return;var t,n=0,r=e[0],i;while(++n1}function Js(){var e=[],t;return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:qn,buffer:function(){var n=e;return e=[],t=null,n}}}function Ks(e,t){if(!(n=e.length))return 0;var n,r=0,i=0,s=e[0],a=s[0],f=s[1],l=Math.cos(f),c=Math.atan2(t*Math.sin(a)*l,Math.sin(f)),h=1-t*Math.cos(a)*l,p=c,d,v;while(++r2&&(i+=4*(d-c)):Math.abs(h-2)0?o:-o,l=Math.abs(s-t);Math.abs(l-o)0?o/2:-o/2),e.point(r,n),e.lineEnd(),e.lineStart(),e.point(f,n),e.point(s,n),i=0):r!==f&&l>=o&&(Math.abs(t-r)u?Math.atan((Math.sin(t)*(s=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(t))*Math.sin(e))/(i*s*o)):(t+r)/2}function Zs(e,t,n,r){var i;if(e==null)i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i),r.point(o,0),r.point(o,-i),r.point(0,-i),r.point(-o,-i),r.point(-o,0),r.point(-o,i);else if(Math.abs(e[0]-t[0])>u){var s=(e[0]n}function s(e){var t,n,r,s;return{lineStart:function(){r=n=!1,s=1},point:function(a,f){var l=[a,f],c,h=i(a,f);!t&&(r=n=h)&&e.lineStart();if(h!==n){c=o(t,l);if(bs(t,c)||bs(l,c))l[0]+=u,l[1]+=u,h=i(l[0],l[1])}h!==n&&(s=0,(n=h)?(e.lineStart(),c=o(l,t),e.point(c[0],c[1])):(c=o(t,l),e.point(c[0],c[1]),e.lineEnd()),t=c),h&&(!t||!bs(t,l))&&e.point(l[0],l[1]),t=l},lineEnd:function(){n&&e.lineEnd(),t=null},clean:function(){return s|(r&&n)<<1}}}function o(e,t){var r=ws(e,0),i=ws(t,0),s=[1,0,0],o=Ss(r,i),u=Es(o,o),a=o[0],f=u-a*a;if(!f)return e;var l=n*u/f,c=-n*a/f,h=Ss(s,o),p=Ts(s,l),d=Ts(o,c);xs(p,d);var v=h,m=Es(p,v),g=Es(v,v),y=Math.sqrt(m*m-g*(Es(p,p)-1)),b=Ts(v,(-m-y)/g);return xs(b,p),ys(b)}var t=e*a,n=Math.cos(t),r=Rs(t,6*a);return zs(i,s,r)}function to(e,t){function n(n,r){return n=e(n,r),t(n[0],n[1])}return e.invert&&t.invert&&(n.invert=function(n,r){return n=t.invert(n,r),n&&e.invert(n[0],n[1])}),n}function no(e,t){return[e,t]}function io(e,t,n){var r=d3.range(e,t-u,n).concat(t);return function(e){return r.map(function(t){return[e,t]})}}function so(e,t,n){var r=d3.range(e,t-u,n).concat(t);return function(e){return r.map(function(t){return[t,e]})}}function oo(e,t,n,r){function v(e){var t=Math.sin(e*=p)*d,n=Math.sin(p-e)*d,r=n*f+t*c,i=n*l+t*h,o=n*s+t*u;return[Math.atan2(i,r)/a,Math.atan2(o,Math.sqrt(r*r+i*i))/a]}var i=Math.cos(t),s=Math.sin(t),o=Math.cos(r),u=Math.sin(r),f=i*Math.cos(e),l=i*Math.sin(e),c=o*Math.cos(n),h=o*Math.sin(n),p=Math.acos(Math.max(-1,Math.min(1,s*u+i*o*Math.cos(n-e)))),d=1/Math.sin(p);return v.distance=p,v}function uo(e,t){return[e/(2*o),Math.max(-0.5,Math.min(.5,Math.log(Math.tan(o/4+t/2))/(2*o)))]}function fo(e){return"m0,"+e+"a"+e+","+e+" 0 1,1 0,"+ -2*e+"a"+e+","+e+" 0 1,1 0,"+2*e+"z"}function lo(e){var t=Cs(function(t,n){return e([t*f,n*f])});return function(e){return e=t(e),{point:function(t,n){e.point(t*a,n*a)},sphere:function(){e.sphere()},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}}}}function co(){function r(n,r){t.push("M",n,",",r,e)}function i(e,r){t.push("M",e,",",r),n.point=s}function s(e,n){t.push("L",e,",",n)}function o(){n.point=r}function u(){t.push("Z")}var e=fo(4.5),t=[],n={point:r,lineStart:function(){n.point=i},lineEnd:o,polygonStart:function(){n.lineEnd=u},polygonEnd:function(){n.lineEnd=o,n.point=r},pointRadius:function(t){return e=fo(t),n},result:function(){if(t.length){var e=t.join("");return t=[],e}}};return n}function ho(e){function r(n,r){e.moveTo(n,r),e.arc(n,r,t,0,2*o)}function i(t,r){e.moveTo(t,r),n.point=s}function s(t,n){e.lineTo(t,n)}function u(){n.point=r}function a(){e.closePath()}var t=4.5,n={point:r,lineStart:function(){n.point=i},lineEnd:u,polygonStart:function(){n.lineEnd=a},polygonEnd:function(){n.lineEnd=u,n.point=r},pointRadius:function(e){return t=e,n},result:qn};return n}function go(){function i(e,t){vo+=r*e-n*t,n=e,r=t}var e,t,n,r;mo.point=function(s,o){mo.point=i,e=n=s,t=r=o},mo.lineEnd=function(){i(e,t)}}function bo(e,t){if(Ms)return;Ds+=e,Ps+=t,++Hs}function wo(){function n(n,r){var i=n-e,s=r-t,o=Math.sqrt(i*i+s*s);Ds+=o*(e+n)/2,Ps+=o*(t+r)/2,Hs+=o,e=n,t=r}var e,t;if(Ms!==1){if(!(Ms<1))return;Ms=1,Ds=Ps=Hs=0}yo.point=function(r,i){yo.point=n,e=r,t=i}}function Eo(){yo.point=bo}function So(){function i(e,t){var i=r*e-n*t;Ds+=i*(n+e),Ps+=i*(r+t),Hs+=i*3,n=e,r=t}var e,t,n,r;Ms<2&&(Ms=2,Ds=Ps=Hs=0),yo.point=function(s,o){yo.point=i,e=n=s,t=r=o},yo.lineEnd=function(){i(e,t)}}function Co(){function l(e,t){e*=a,t*=a;if(Math.abs(Math.abs(i)-o/2)-o||h>o?-4:4)*Math.atan(Math.sqrt(Math.abs(Math.tan(v)*Math.tan(v-d/2)*Math.tan(v-o/4-i/2)*Math.tan(v-o/4-t/2))))}n=r,r=e,i=t,s=l,f=c}var e,t,n,r,i,s,f;No.point=function(o,u){No.point=l,n=r=(e=o)*a,i=(t=u)*a,s=Math.cos(i),f=Math.sin(i)},No.lineEnd=function(){l(e,t)}}function ko(e){return Lo(function(){return e})()}function Lo(e){function b(e){return e=r(e[0]*a,e[1]*a),[e[0]*s+v,m-e[1]*s]}function w(e){return e=r.invert((e[0]-v)/s,(m-e[1])/s),e&&[e[0]*f,e[1]*f]}function E(){r=to(n=Oo(h,p,d),t);var e=t(l,c);return v=o-e[0]*s,m=u+e[1]*s,b}var t,n,r,i=Cs(function(e,n){return e=t(e,n),[e[0]*s+v,m-e[1]*s]}),s=150,o=480,u=250,l=0,c=0,h=0,p=0,d=0,v,m,g=Qs,y=null;return b.stream=function(e){return Ao(n,g(i(e)))},b.clipAngle=function(e){return arguments.length?(g=e==null?(y=e,Qs):eo(y=+e),b):y},b.scale=function(e){return arguments.length?(s=+e,E()):s},b.translate=function(e){return arguments.length?(o=+e[0],u=+e[1],E()):[o,u]},b.center=function(e){return arguments.length?(l=e[0]%360*a,c=e[1]%360*a,E()):[l*f,c*f]},b.rotate=function(e){return arguments.length?(h=e[0]%360*a,p=e[1]%360*a,d=e.length>2?e[2]%360*a:0,E()):[h*f,p*f,d*f]},d3.rebind(b,i,"precision"),function(){return t=e.apply(this,arguments),b.invert=t.invert&&w,E()}}function Ao(e,t){return{point:function(n,r){r=e(n*a,r*a),n=r[0],t.point(n>o?n-2*o:n<-o?n+2*o:n,r[1])},sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Oo(e,t,n){return e?t||n?to(_o(e),Do(t,n)):_o(e):t||n?Do(t,n):no}function Mo(e){return function(t,n){return t+=e,[t>o?t-2*o:t<-o?t+2*o:t,n]}}function _o(e){var t=Mo(e);return t.invert=Mo(-e),t}function Do(e,t){function o(e,t){var o=Math.cos(t),u=Math.cos(e)*o,a=Math.sin(e)*o,f=Math.sin(t),l=f*n+u*r;return[Math.atan2(a*i-l*s,u*n-f*r),Math.asin(Math.max(-1,Math.min(1,l*i+a*s)))]}var n=Math.cos(e),r=Math.sin(e),i=Math.cos(t),s=Math.sin(t);return o.invert=function(e,t){var o=Math.cos(t),u=Math.cos(e)*o,a=Math.sin(e)*o,f=Math.sin(t),l=f*i-a*s;return[Math.atan2(a*i+f*s,u*n+l*r),Math.asin(Math.max(-1,Math.min(1,l*n-u*r)))]},o}function Ho(e,t){function n(t,n){var r=Math.cos(t),i=Math.cos(n),s=e(r*i);return[s*i*Math.sin(t),s*Math.sin(n)]}return n.invert=function(e,n){var r=Math.sqrt(e*e+n*n),i=t(r),s=Math.sin(i),o=Math.cos(i);return[Math.atan2(e*s,r*o),Math.asin(r&&n*s/r)]},n}function Bo(e,t,n,r){var i,s,o,u,a,f,l;return i=r[e],s=i[0],o=i[1],i=r[t],u=i[0],a=i[1],i=r[n],f=i[0],l=i[1],(l-o)*(u-s)-(a-o)*(f-s)>0}function jo(e,t,n){return(n[0]-t[0])*(e[1]-t[1])<(n[1]-t[1])*(e[0]-t[0])}function Fo(e,t,n,r){var i=e[0],s=n[0],o=t[0]-i,u=r[0]-s,a=e[1],f=n[1],l=t[1]-a,c=r[1]-f,h=(u*(a-f)-c*(i-s))/(c*o-u*l);return[i+h*o,a+h*l]}function qo(e,t){var n={list:e.map(function(e,t){return{index:t,x:e[0],y:e[1]}}).sort(function(e,t){return e.yt.y?1:e.xt.x?1:0}),bottomSite:null},r={list:[],leftEnd:null,rightEnd:null,init:function(){r.leftEnd=r.createHalfEdge(null,"l"),r.rightEnd=r.createHalfEdge(null,"l"),r.leftEnd.r=r.rightEnd,r.rightEnd.l=r.leftEnd,r.list.unshift(r.leftEnd,r.rightEnd)},createHalfEdge:function(e,t){return{edge:e,side:t,vertex:null,l:null,r:null}},insert:function(e,t){t.l=e,t.r=e.r,e.r.l=t,e.r=t},leftBound:function(e){var t=r.leftEnd;do t=t.r;while(t!=r.rightEnd&&i.rightOf(t,e));return t=t.l,t},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?n.bottomSite:e.edge.region[e.side]},rightRegion:function(e){return e.edge==null?n.bottomSite:e.edge.region[Io[e.side]]}},i={bisect:function(e,t){var n={region:{l:e,r:t},ep:{l:null,r:null}},r=t.x-e.x,i=t.y-e.y,s=r>0?r:-r,o=i>0?i:-i;return n.c=e.x*r+e.y*i+(r*r+i*i)*.5,s>o?(n.a=1,n.b=i/r,n.c/=r):(n.b=1,n.a=r/i,n.c/=i),n},intersect:function(e,t){var n=e.edge,r=t.edge;if(!n||!r||n.region.r==r.region.r)return null;var i=n.a*r.b-n.b*r.a;if(Math.abs(i)<1e-10)return null;var s=(n.c*r.b-r.c*n.b)/i,o=(r.c*n.a-n.c*r.a)/i,u=n.region.r,a=r.region.r,f,l;u.y=l.region.r.x;return c&&f.side==="l"||!c&&f.side==="r"?null:{x:s,y:o}},rightOf:function(e,t){var n=e.edge,r=n.region.r,i=t.x>r.x;if(i&&e.side==="l")return 1;if(!i&&e.side==="r")return 0;if(n.a===1){var s=t.y-r.y,o=t.x-r.x,u=0,a=0;!i&&n.b<0||i&&n.b>=0?a=u=s>=n.b*o:(a=t.x+t.y*n.b>n.c,n.b<0&&(a=!a),a||(u=1));if(!u){var f=r.x-n.region.l.x;a=n.b*(o*o-s*s)h*h+p*p}return e.side==="l"?a:!a},endPoint:function(e,n,r){e.ep[n]=r;if(!e.ep[Io[n]])return;t(e)},distance:function(e,t){var n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}},s={list:[],insert:function(e,t,n){e.vertex=t,e.ystar=t.y+n;for(var r=0,i=s.list,o=i.length;ru.ystar||e.ystar==u.ystar&&t.x>u.vertex.x)continue;break}i.splice(r,0,e)},del:function(e){for(var t=0,n=s.list,r=n.length;td.y&&(v=p,p=d,d=v,b="r"),y=i.bisect(p,d),h=r.createHalfEdge(y,b),r.insert(l,h),i.endPoint(y,Io[b],g),m=i.intersect(l,h),m&&(s.del(l),s.insert(l,m,i.distance(m,p))),m=i.intersect(h,c),m&&s.insert(h,m,i.distance(m,p))}}for(a=r.right(r.leftEnd);a!=r.rightEnd;a=r.right(a))t(a.edge)}function Ro(){return{leaf:!0,nodes:[],point:null}}function Uo(e,t,n,r,i,s){if(!e(t,n,r,i,s)){var o=(n+i)*.5,u=(r+s)*.5,a=t.nodes;a[0]&&Uo(e,a[0],n,r,o,u),a[1]&&Uo(e,a[1],o,r,i,u),a[2]&&Uo(e,a[2],n,u,o,s),a[3]&&Uo(e,a[3],o,u,i,s)}}function Xo(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function eu(e,t,n,r){var i,s,o=0,u=t.length,a=n.length;while(o=a)return-1;i=t.charCodeAt(o++);if(i===37){s=hu[t.charAt(o++)];if(!s||(r=s(e,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function tu(e){return new RegExp("^(?:"+e.map(d3.requote).join("|")+")","i")}function nu(e){var t=new y,n=-1,r=e.length;while(++n68?1900:2e3)}function xu(e,t,n){Au.lastIndex=0;var r=Au.exec(t.substring(n,n+2));return r?(e.m=r[0]-1,n+=r[0].length):-1}function Tu(e,t,n){Au.lastIndex=0;var r=Au.exec(t.substring(n,n+2));return r?(e.d=+r[0],n+=r[0].length):-1}function Nu(e,t,n){Au.lastIndex=0;var r=Au.exec(t.substring(n,n+2));return r?(e.H=+r[0],n+=r[0].length):-1}function Cu(e,t,n){Au.lastIndex=0;var r=Au.exec(t.substring(n,n+2));return r?(e.M=+r[0],n+=r[0].length):-1}function ku(e,t,n){Au.lastIndex=0;var r=Au.exec(t.substring(n,n+2));return r?(e.S=+r[0],n+=r[0].length):-1}function Lu(e,t,n){Au.lastIndex=0;var r=Au.exec(t.substring(n,n+3));return r?(e.L=+r[0],n+=r[0].length):-1}function Ou(e,t,n){var r=Mu.get(t.substring(n,n+=2).toLowerCase());return r==null?-1:(e.p=r,n)}function _u(e){var t=e.getTimezoneOffset(),n=t>0?"-":"+",r=~~(Math.abs(t)/60),i=Math.abs(t)%60;return n+ru(r,"0",2)+ru(i,"0",2)}function Pu(e){return e.toISOString()}function Hu(e,t,n){function r(t){var n=e(t),r=s(n,1);return t-n1)while(ot?1:e>=t?0:NaN},d3.descending=function(e,t){return te?1:t>=e?0:NaN},d3.mean=function(e,t){var n=e.length,r,i=0,s=-1,o=0;if(arguments.length===1)while(++s1&&(e=e.map(t)),e=e.filter(N),e.length?d3.quantile(e.sort(d3.ascending),.5):undefined},d3.min=function(e,t){var n=-1,r=e.length,i,s;if(arguments.length===1){while(++ns&&(i=s)}else{while(++ns&&(i=s)}return i},d3.max=function(e,t){var n=-1,r=e.length,i,s;if(arguments.length===1){while(++ni&&(i=s)}else{while(++ni&&(i=s)}return i},d3.extent=function(e,t){var n=-1,r=e.length,i,s,o;if(arguments.length===1){while(++ns&&(i=s),os&&(i=s),o1);return e+t*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(e,t){var n=arguments.length;n<2&&(t=1),n<1&&(e=0);var r=d3.random.normal();return function(){return Math.exp(e+t*r())}},irwinHall:function(e){return function(){for(var t=0,n=0;n>>1;e.call(t,t[s],s)>>1;n=t.length)return i?i.call(e,n):r?n.sort(r):n;var u=-1,a=n.length,f=t[o++],l,c,h=new y,p,d={};while(++u=t.length)return e;var i=[],s=n[r++],u;for(u in e)i.push({key:u,values:o(e[u],r)});return s&&i.sort(function(e,t){return s(e.key,t.key)}),i}var e={},t=[],n=[],r,i;return e.map=function(e){return s(e,0)},e.entries=function(e){return o(s(e,0),0)},e.key=function(n){return t.push(n),e},e.sortKeys=function(r){return n[t.length-1]=r,e},e.sortValues=function(t){return r=t,e},e.rollup=function(t){return i=t,e},e},d3.keys=function(e){var t=[];for(var n in e)t.push(n);return t},d3.values=function(e){var t=[];for(var n in e)t.push(e[n]);return t},d3.entries=function(e){var t=[];for(var n in e)t.push({key:n,value:e[n]});return t},d3.permute=function(e,t){var n=[],r=-1,i=t.length;while(++rt)r.push(o/i);else while((o=e+n*++s)=200&&e<300||e===304?i.load.call(r,o.call(r,u)):i.error.call(r,u)}var r={},i=d3.dispatch("progress","load","error"),s={},o=E,u=new(window.XDomainRequest&&/^(http(s)?:)?\/\//.test(e)?XDomainRequest:XMLHttpRequest);return"onload"in u?u.onload=u.onerror=a:u.onreadystatechange=function(){u.readyState>3&&a()},u.onprogress=function(e){var t=d3.event;d3.event=e;try{i.progress.call(r,u)}finally{d3.event=t}},r.header=function(e,t){return e=(e+"").toLowerCase(),arguments.length<2?s[e]:(t==null?delete s[e]:s[e]=t+"",r)},r.mimeType=function(e){return arguments.length?(t=e==null?null:e+"",r):t},r.response=function(e){return o=e,r},["get","post"].forEach(function(e){r[e]=function(){return r.send.apply(r,[e].concat(p(arguments)))}}),r.send=function(n,i,o){arguments.length===2&&typeof i=="function"&&(o=i,i=null),u.open(n,e,!0),t!=null&&!("accept"in s)&&(s.accept=t+",*/*");if(u.setRequestHeader)for(var a in s)u.setRequestHeader(a,s[a]);return t!=null&&u.overrideMimeType&&u.overrideMimeType(t),o!=null&&r.on("error",o).on("load",function(e){o(null,e)}),u.send(i==null?null:i),r},r.abort=function(){return u.abort(),r},d3.rebind(r,i,"on"),arguments.length===2&&typeof t=="function"&&(n=t,t=null),n==null?r:r.get(M(n))},d3.text=function(){return d3.xhr.apply(d3,arguments).response(_)},d3.json=function(e,t){return d3.xhr(e,"application/json",t).response(D)},d3.html=function(e,t){return d3.xhr(e,"text/html",t).response(P)},d3.xml=function(){return d3.xhr.apply(d3,arguments).response(H)};var B={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:B,qualify:function(e){var t=e.indexOf(":"),n=e;return t>=0&&(n=e.substring(0,t),e=e.substring(t+1)),B.hasOwnProperty(n)?{space:B[n],local:e}:e}},d3.dispatch=function(){var e=new j,t=-1,n=arguments.length;while(++t0&&(r=e.substring(n+1),e=e.substring(0,n)),arguments.length<2?this[e].on(r):this[e].on(r,t)},d3.format=function(t){var n=I.exec(t),r=n[1]||" ",i=n[2]||">",s=n[3]||"",o=n[4]||"",u=n[5],a=+n[6],f=n[7],l=n[8],c=n[9],h=1,p="",d=!1;l&&(l=+l.substring(1));if(u||r==="0"&&i==="=")u=r="0",i="=",f&&(a-=Math.floor((a-1)/4));switch(c){case"n":f=!0,c="g";break;case"%":h=100,p="%",c="f";break;case"p":h=100,p="%",c="r";break;case"b":case"o":case"x":case"X":o&&(o="0"+c.toLowerCase());case"c":case"d":d=!0,l=0;break;case"s":h=-1,c="r"}o==="#"&&(o=""),c=="r"&&!l&&(c="g"),c=q.get(c)||U;var v=u&&f;return function(t){if(d&&t%1)return"";var n=t<0||t===0&&1/t<0?(t=-t,"-"):s;if(h<0){var m=d3.formatPrefix(t,l);t=m.scale(t),p=m.symbol}else t*=h;t=c(t,l),!u&&f&&(t=z(t));var g=o.length+t.length+(v?0:n.length),y=g"?y+n+t:i==="^"?y.substring(0,g>>=1)+n+t+y.substring(g):n+(v?t:y+t))+p}};var I=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,q=d3.map({b:function(e){return e.toString(2)},c:function(e){return String.fromCharCode(e)},o:function(e){return e.toString(8)},x:function(e){return e.toString(16)},X:function(e){return e.toString(16).toUpperCase()},g:function(e,t){return e.toPrecision(t)},e:function(e,t){return e.toExponential(t)},f:function(e,t){return e.toFixed(t)},r:function(e,t){return d3.round(e,t=R(e,t)).toFixed(Math.max(0,Math.min(20,t)))}}),z=E;if(n){var W=n.length;z=function(e){var r=e.lastIndexOf("."),i=r>=0?"."+e.substring(r+1):(r=e.length,""),s=[],o=0,u=n[0];while(r>0&&u>0)s.push(e.substring(r-=u,r+u)),u=n[o=(o+1)%W];return s.reverse().join(t||"")+i}}var X=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(V);d3.formatPrefix=function(e,t){var n=0;return e&&(e<0&&(e*=-1),t&&(e=d3.round(e,R(e,t))),n=1+Math.floor(1e-12+Math.log(e)/Math.LN10),n=Math.max(-24,Math.min(24,Math.floor((n<=0?n+1:n-1)/3)*3))),X[8+n/3]};var $=function(){return E},J=d3.map({linear:$,poly:nt,quad:function(){return Z},cubic:function(){return et},sin:function(){return rt},exp:function(){return it},circle:function(){return st},elastic:ot,back:ut,bounce:function(){return at}}),K=d3.map({"in":E,out:G,"in-out":Y,"out-in":function(e){return Y(G(e))}});d3.ease=function(e){var t=e.indexOf("-"),n=t>=0?e.substring(0,t):e,r=t>=0?e.substring(t+1):"in";return n=J.get(n)||$,r=K.get(r)||E,Q(r(n.apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.transform=function(e){var t=document.createElementNS(d3.ns.prefix.svg,"g");return(d3.transform=function(e){t.setAttribute("transform",e);var n=t.transform.baseVal.consolidate();return new ht(n?n.matrix:mt)})(e)},ht.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var mt={a:1,b:0,c:0,d:1,e:0,f:0};d3.interpolate=function(e,t){var n=d3.interpolators.length,r;while(--n>=0&&!(r=d3.interpolators[n](e,t)));return r},d3.interpolateNumber=function(e,t){return t-=e,function(n){return e+t*n}},d3.interpolateRound=function(e,t){return t-=e,function(n){return Math.round(e+t*n)}},d3.interpolateString=function(e,t){var n,r,i,s=0,o=0,u=[],a=[],f,l;gt.lastIndex=0;for(r=0;n=gt.exec(t);++r)n.index&&u.push(t.substring(s,o=n.index)),a.push({i:u.length,x:n[0]}),u.push(null),s=gt.lastIndex;s180?l+=360:l-f>180&&(f+=360),r.push({i:n.push(n.pop()+"rotate(",null,")")-2,x:d3.interpolateNumber(f,l)})):l&&n.push(n.pop()+"rotate("+l+")"),c!=h?r.push({i:n.push(n.pop()+"skewX(",null,")")-2,x:d3.interpolateNumber(c,h)}):h&&n.push(n.pop()+"skewX("+h+")"),p[0]!=d[0]||p[1]!=d[1]?(i=n.push(n.pop()+"scale(",null,",",null,")"),r.push({i:i-4,x:d3.interpolateNumber(p[0],d[0])},{i:i-2,x:d3.interpolateNumber(p[1],d[1])})):(d[0]!=1||d[1]!=1)&&n.push(n.pop()+"scale("+d+")"),i=r.length,function(e){var t=-1,s;while(++t180?s-=360:s<-180&&(s+=360),function(e){return Ht(n+s*e,r+o*e,i+u*e)+""}},d3.interpolateLab=function(e,t){e=d3.lab(e),t=d3.lab(t);var n=e.l,r=e.a,i=e.b,s=t.l-n,o=t.a-r,u=t.b-i;return function(e){return $t(n+s*e,r+o*e,i+u*e)+""}},d3.interpolateHcl=function(e,t){e=d3.hcl(e),t=d3.hcl(t);var n=e.h,r=e.c,i=e.l,s=t.h-n,o=t.c-r,u=t.l-i;return s>180?s-=360:s<-180&&(s+=360),function(e){return It(n+s*e,r+o*e,i+u*e)+""}},d3.interpolateArray=function(e,t){var n=[],r=[],i=e.length,s=t.length,o=Math.min(e.length,t.length),u;for(u=0;u=0;)if(s=n[r])i&&i!==s.nextSibling&&i.parentNode.insertBefore(s,i),i=s;return this},sn.sort=function(e){e=mn.apply(this,arguments);for(var t=-1,n=this.length;++t=vr?i?"M0,"+s+"A"+s+","+s+" 0 1,1 0,"+ -s+"A"+s+","+s+" 0 1,1 0,"+s+"M0,"+i+"A"+i+","+i+" 0 1,0 0,"+ -i+"A"+i+","+i+" 0 1,0 0,"+i+"Z":"M0,"+s+"A"+s+","+s+" 0 1,1 0,"+ -s+"A"+s+","+s+" 0 1,1 0,"+s+"Z":i?"M"+s*c+","+s*h+"A"+s+","+s+" 0 "+l+",1 "+s*p+","+s*d+"L"+i*p+","+i*d+"A"+i+","+i+" 0 "+l+",0 "+i*c+","+i*h+"Z":"M"+s*c+","+s*h+"A"+s+","+s+" 0 "+l+",1 "+s*p+","+s*d+"L0,0"+"Z"}var e=mr,t=gr,n=yr,r=br;return i.innerRadius=function(t){return arguments.length?(e=x(t),i):e},i.outerRadius=function(e){return arguments.length?(t=x(e),i):t},i.startAngle=function(e){return arguments.length?(n=x(e),i):n},i.endAngle=function(e){return arguments.length?(r=x(e),i):r},i.centroid=function(){var i=(e.apply(this,arguments)+t.apply(this,arguments))/2,s=(n.apply(this,arguments)+r.apply(this,arguments))/2+dr;return[Math.cos(s)*i,Math.sin(s)*i]},i};var dr=-o/2,vr=2*o-1e-6;d3.svg.line=function(){return wr(E)};var xr=d3.map({linear:Tr,"linear-closed":Nr,"step-before":Cr,"step-after":kr,basis:Dr,"basis-open":Pr,"basis-closed":Hr,bundle:Br,cardinal:Or,"cardinal-open":Lr,"cardinal-closed":Ar,monotone:Xr});xr.forEach(function(e,t){t.key=e,t.closed=/-closed$/.test(e)});var Fr=[0,2/3,1/3,0],Ir=[0,1/3,2/3,0],qr=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var e=wr(Vr);return e.radius=e.x,delete e.x,e.angle=e.y,delete e.y,e},Cr.reverse=kr,kr.reverse=Cr,d3.svg.area=function(){return $r(E)},d3.svg.area.radial=function(){var e=$r(Vr);return 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,e},d3.svg.chord=function(){function s(n,r){var i=u(this,e,n,r),s=u(this,t,n,r);return"M"+i.p0+f(i.r,i.p1,i.a1-i.a0)+(a(i,s)?h(i.r,i.p1,i.r,i.p0):h(i.r,i.p1,s.r,s.p0)+f(s.r,s.p1,s.a1-s.a0)+h(s.r,s.p1,i.r,i.p0))+"Z"}function u(e,t,s,o){var u=t.call(e,s,o),a=n.call(e,u,o),f=r.call(e,u,o)+dr,l=i.call(e,u,o)+dr;return{r:a,a0:f,a1:l,p0:[a*Math.cos(f),a*Math.sin(f)],p1:[a*Math.cos(l),a*Math.sin(l)]}}function a(e,t){return e.a0==t.a0&&e.a1==t.a1}function f(e,t,n){return"A"+e+","+e+" 0 "+ +(n>o)+",1 "+t}function h(e,t,n,r){return"Q 0,0 "+r}var e=c,t=l,n=Jr,r=yr,i=br;return s.radius=function(e){return arguments.length?(n=x(e),s):n},s.source=function(t){return arguments.length?(e=x(t),s):e},s.target=function(e){return arguments.length?(t=x(e),s):t},s.startAngle=function(e){return arguments.length?(r=x(e),s):r},s.endAngle=function(e){return arguments.length?(i=x(e),s):i},s},d3.svg.diagonal=function(){function r(r,i){var s=e.call(this,r,i),o=t.call(this,r,i),u=(s.y+o.y)/2,a=[s,{x:s.x,y:u},{x:o.x,y:u},o];return a=a.map(n),"M"+a[0]+"C"+a[1]+" "+a[2]+" "+a[3]}var e=c,t=l,n=Kr;return r.source=function(t){return arguments.length?(e=x(t),r):e},r.target=function(e){return arguments.length?(t=x(e),r):t},r.projection=function(e){return arguments.length?(n=e,r):n},r},d3.svg.diagonal.radial=function(){var e=d3.svg.diagonal(),t=Kr,n=e.projection;return e.projection=function(e){return arguments.length?n(Qr(t=e)):t},e},d3.svg.symbol=function(){function n(n,r){return(ei.get(e.call(this,n,r))||Zr)(t.call(this,n,r))}var e=Yr,t=Gr;return n.type=function(t){return arguments.length?(e=x(t),n):e},n.size=function(e){return arguments.length?(t=x(e),n):t},n};var ei=d3.map({circle:Zr,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+ -3*t+","+ -t+"H"+ -t+"V"+ -3*t+"H"+t+"V"+ -t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+ -t+"V"+t+"H"+ -3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*ni)),n=t*ni;return"M0,"+ -t+"L"+n+",0"+" 0,"+t+" "+ -n+",0"+"Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+ -t+","+ -t+"L"+t+","+ -t+" "+t+","+t+" "+ -t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/ti),n=t*ti/2;return"M0,"+n+"L"+t+","+ -n+" "+ -t+","+ -n+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/ti),n=t*ti/2;return"M0,"+ -n+"L"+t+","+n+" "+ -t+","+n+"Z"}});d3.svg.symbolTypes=ei.keys();var ti=Math.sqrt(3),ni=Math.tan(30*a);d3.svg.axis=function(){function l(l){l.each(function(){var l=d3.select(this),c=u==null?e.ticks?e.ticks.apply(e,o):e.domain():u,h=a==null?e.tickFormat?e.tickFormat.apply(e,o):String:a,p=si(e,c,f),d=l.selectAll(".minor").data(p,String),v=d.enter().insert("line","g").attr("class","tick minor").style("opacity",1e-6),m=d3.transition(d.exit()).style("opacity",1e-6).remove(),g=d3.transition(d).style("opacity",1),y=l.selectAll("g").data(c,String),b=y.enter().insert("g","path").style("opacity",1e-6),w=d3.transition(y.exit()).style("opacity",1e-6).remove(),E=d3.transition(y).style("opacity",1),S,x=Un(e),T=l.selectAll(".domain").data([0]),N=d3.transition(T),C=e.copy(),k=this.__chart__||C;this.__chart__=C,T.enter().append("path").attr("class","domain"),b.append("line").attr("class","tick"),b.append("text");var L=b.select("line"),A=E.select("line"),O=y.select("text").text(h),M=b.select("text"),_=E.select("text");switch(t){case"bottom":S=ri,v.attr("y2",r),g.attr("x2",0).attr("y2",r),L.attr("y2",n),M.attr("y",Math.max(n,0)+s),A.attr("x2",0).attr("y2",n),_.attr("x",0).attr("y",Math.max(n,0)+s),O.attr("dy",".71em").style("text-anchor","middle"),N.attr("d","M"+x[0]+","+i+"V0H"+x[1]+"V"+i);break;case"top":S=ri,v.attr("y2",-r),g.attr("x2",0).attr("y2",-r),L.attr("y2",-n),M.attr("y",-(Math.max(n,0)+s)),A.attr("x2",0).attr("y2",-n),_.attr("x",0).attr("y",-(Math.max(n,0)+s)),O.attr("dy","0em").style("text-anchor","middle"),N.attr("d","M"+x[0]+","+ -i+"V0H"+x[1]+"V"+ -i);break;case"left":S=ii,v.attr("x2",-r),g.attr("x2",-r).attr("y2",0),L.attr("x2",-n),M.attr("x",-(Math.max(n,0)+s)),A.attr("x2",-n).attr("y2",0),_.attr("x",-(Math.max(n,0)+s)).attr("y",0),O.attr("dy",".32em").style("text-anchor","end"),N.attr("d","M"+ -i+","+x[0]+"H0V"+x[1]+"H"+ -i);break;case"right":S=ii,v.attr("x2",r),g.attr("x2",r).attr("y2",0),L.attr("x2",n),M.attr("x",Math.max(n,0)+s),A.attr("x2",n).attr("y2",0),_.attr("x",Math.max(n,0)+s).attr("y",0),O.attr("dy",".32em").style("text-anchor","start"),N.attr("d","M"+i+","+x[0]+"H0V"+x[1]+"H"+i)}if(e.ticks)b.call(S,k),E.call(S,C),w.call(S,C),v.call(S,k),g.call(S,C),m.call(S,C);else{var D=C.rangeBand()/2,P=function(e){return C(e)+D};b.call(S,P),E.call(S,P)}})}var e=d3.scale.linear(),t="bottom",n=6,r=6,i=6,s=3,o=[10],u=null,a,f=0;return l.scale=function(t){return arguments.length?(e=t,l):e},l.orient=function(e){return arguments.length?(t=e,l):t},l.ticks=function(){return arguments.length?(o=arguments,l):o},l.tickValues=function(e){return arguments.length?(u=e,l):u},l.tickFormat=function(e){return arguments.length?(a=e,l):a},l.tickSize=function(e,t){if(!arguments.length)return n;var s=arguments.length-1;return n=+e,r=s>1?+t:n,i=s>0?+arguments[s]:n,l},l.tickPadding=function(e){return arguments.length?(s=+e,l):s},l.tickSubdivide=function(e){return arguments.length?(f=+e,l):f},l},d3.svg.brush=function(){function o(e){e.each(function(){var e=d3.select(this),i=e.selectAll(".background").data([0]),s=e.selectAll(".extent").data([0]),c=e.selectAll(".resize").data(r,String),h;e.style("pointer-events","all").on("mousedown.brush",l).on("touchstart.brush",l),i.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),s.enter().append("rect").attr("class","extent").style("cursor","move"),c.enter().append("g").attr("class",function(e){return"resize "+e}).style("cursor",function(e){return oi[e]}).append("rect").attr("x",function(e){return/[ew]$/.test(e)?-3:null}).attr("y",function(e){return/^[ns]/.test(e)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),c.style("display",o.empty()?"none":null),c.exit().remove(),t&&(h=Un(t),i.attr("x",h[0]).attr("width",h[1]-h[0]),a(e)),n&&(h=Un(n),i.attr("y",h[0]).attr("height",h[1]-h[0]),f(e)),u(e)})}function u(e){e.selectAll(".resize").attr("transform",function(e){return"translate("+i[+/e$/.test(e)][0]+","+i[+/^s/.test(e)][1]+")"})}function a(e){e.select(".extent").attr("x",i[0][0]),e.selectAll(".extent,.n>rect,.s>rect").attr("width",i[1][0]-i[0][0])}function f(e){e.select(".extent").attr("y",i[0][1]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",i[1][1]-i[0][1])}function l(){function x(){var e=d3.event.changedTouches;return e?d3.touches(r,e)[0]:d3.mouse(r)}function T(){d3.event.keyCode==32&&(m||(g=null,y[0]-=i[1][0],y[1]-=i[1][1],m=2),ft())}function N(){d3.event.keyCode==32&&m==2&&(y[0]+=i[1][0],y[1]+=i[1][1],m=0,ft())}function C(){var e=x(),r=!1;b&&(e[0]+=b[0],e[1]+=b[1]),m||(d3.event.altKey?(g||(g=[(i[0][0]+i[1][0])/2,(i[0][1]+i[1][1])/2]),y[0]=i[+(e[0]0?i=n:i=0:n>0&&(t.start({type:"start",alpha:i=n}),d3.timer(e.tick)),e):i},e.start=function(){function y(e,n){var r=b(t),i=-1,s=r.length,o;while(++ii&&(i=u),r.push(u)}for(o=0;o0){s=-1;while(++s=a[0]&&d<=a[1]&&(l=o[d3.bisect(f,d,1,h)-1],l.y+=p,l.push(i[s]))}return o}var e=!0,t=Number,n=Pi,r=_i;return i.value=function(e){return arguments.length?(t=e,i):t},i.range=function(e){return arguments.length?(n=x(e),i):n},i.bins=function(e){return arguments.length?(r=typeof e=="number"?function(t){return Di(t,e)}:x(e),i):r},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},d3.layout.hierarchy=function(){function r(i,o,u){var a=t.call(s,i,o);i.depth=o,u.push(i);if(a&&(l=a.length)){var f=-1,l,c=i.children=[],h=0,p=o+1,d;while(++f0){var l=t*f/2;os(o,function(e){e.r+=l}),os(o,Wi),os(o,function(e){e.r-=l}),f=Math.max(2*o.r/u,2*o.r/a)}return $i(o,u/2,a/2,1/f),s}var e=d3.layout.hierarchy().sort(qi),t=0,n=[1,1];return r.size=function(e){return arguments.length?(n=e,r):n},r.padding=function(e){return arguments.length?(t=+e,r):t},Hi(r,e)},d3.layout.cluster=function(){function r(r,i){var s=e.call(this,r,i),o=s[0],u,a=0;os(o,function(e){var n=e.children;n&&n.length?(e.x=Qi(n),e.y=Ki(n)):(e.x=u?a+=t(e,u):0,e.y=0,u=e)});var f=Gi(o),l=Yi(o),c=f.x-t(f,l)/2,h=l.x+t(l,f)/2;return os(o,function(e){e.x=(e.x-c)/(h-c)*n[0],e.y=(1-(o.y?e.y/o.y:1))*n[1]}),s}var e=d3.layout.hierarchy().sort(null).value(null),t=Zi,n=[1,1];return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(e){return arguments.length?(n=e,r):n},Hi(r,e)},d3.layout.tree=function(){function r(r,i){function u(e,n){var r=e.children,i=e._tree;if(r&&(s=r.length)){var s,o=r[0],a,l=o,c,h=-1;while(++h0&&(as(fs(o,e,r),e,h),a+=h,f+=h),l+=o._tree.mod,a+=i._tree.mod,c+=u._tree.mod,f+=s._tree.mod;o&&!ts(s)&&(s._tree.thread=o,s._tree.mod+=l-f),i&&!es(u)&&(u._tree.thread=i,u._tree.mod+=a-c,r=e)}return r}var s=e.call(this,r,i),o=s[0];os(o,function(e,t){e._tree={ancestor:e,prelim:0,mod:0,change:0,shift:0,number:t?t._tree.number+1:0}}),u(o),a(o,-o._tree.prelim);var l=ns(o,is),c=ns(o,rs),h=ns(o,ss),p=l.x-t(l,c)/2,d=c.x+t(c,l)/2,v=h.depth||1;return os(o,function(e){e.x=(e.x-p)/(d-p)*n[0],e.y=e.depth/v*n[1],delete e._tree}),s}var e=d3.layout.hierarchy().sort(null).value(null),t=Zi,n=[1,1];return r.separation=function(e){return arguments.length?(t=e,r):t},r.size=function(e){return arguments.length?(n=e,r):n},Hi(r,e)},d3.layout.treemap=function(){function f(e,t){var n=-1,r=e.length,i,s;while(++n0)r.push(o=s[v-1]),r.area+=o.area,u!=="squarify"||(c=h(r,d))<=a?(s.pop(),a=c):(r.area-=r.pop().area,p(r,d,n,!1),d=Math.min(n.dx,n.dy),r.length=r.area=0,a=Infinity);r.length&&(p(r,d,n,!0),r.length=r.area=0),t.forEach(l)}}function c(e){var t=e.children;if(t&&t.length){var n=i(e),r=t.slice(),s,o=[];f(r,n.dx*n.dy/e.value),o.area=0;while(s=r.pop())o.push(s),o.area+=s.area,s.z!=null&&(p(o,s.z?n.dx:n.dy,n,!r.length),o.length=o.area=0);t.forEach(c)}}function h(e,t){var n=e.area,r,i=0,s=Infinity,o=-1,u=e.length;while(++oi&&(i=r)}return n*=n,t*=t,n?Math.max(t*i*a/n,n/(t*s*a)):Infinity}function p(e,n,r,i){var s=-1,o=e.length,u=r.x,a=r.y,f=n?t(e.area/n):0,l;if(n==r.dx){if(i||f>r.dy)f=r.dy;while(++sr.dx)f=r.dx;while(++s50?t:s<-140?n:o<21?r:e}var e=d3.geo.albers(),t=d3.geo.albers().rotate([160,0]).center([0,60]).parallels([55,65]),n=d3.geo.albers().rotate([160,0]).center([0,20]).parallels([8,18]),r=d3.geo.albers().rotate([60,0]).center([0,10]).parallels([8,18]);return i.scale=function(s){return arguments.length?(e.scale(s),t.scale(s*.6),n.scale(s),r.scale(s*1.5),i.translate(e.translate())):e.scale()},i.translate=function(s){if(!arguments.length)return e.translate();var o=e.scale(),u=s[0],a=s[1];return e.translate(s),t.translate([u-.4*o,a+.17*o]),n.translate([u-.19*o,a+.2*o]),r.translate([u+.58*o,a+.43*o]),i},i.scale(e.scale())},(d3.geo.albers=function(){var e=29.5*a,t=45.5*a,n=Lo(ks),r=n(e,t);return r.parallels=function(r){return arguments.length?n(e=r[0]*a,t=r[1]*a):[e*f,t*f]},r.rotate([98,0]).center([0,38]).scale(1e3)}).raw=ks;var Ls=Ho(function(e){return Math.sqrt(2/(1+e))},function(e){return 2*Math.asin(e/2)});(d3.geo.azimuthalEqualArea=function(){return ko(Ls)}).raw=Ls;var As=Ho(function(e){var t=Math.acos(e);return t&&t/Math.sin(t)},E);(d3.geo.azimuthalEquidistant=function(){return ko(As)}).raw=As,d3.geo.bounds=Os(E),d3.geo.centroid=function(e){Ms=_s=Ds=Ps=Hs=0,d3.geo.stream(e,Bs);var t;if(_s&&Math.abs(t=Math.sqrt(Ds*Ds+Ps*Ps+Hs*Hs))>u)return[Math.atan2(Ps,Ds)*f,Math.asin(Math.max(-1,Math.min(1,Hs/t)))*f]};var Ms,_s,Ds,Ps,Hs,Bs={sphere:function(){Ms<2&&(Ms=2,_s=Ds=Ps=Hs=0)},point:js,lineStart:Is,lineEnd:qs,polygonStart:function(){Ms<2&&(Ms=2,_s=Ds=Ps=Hs=0),Bs.lineStart=Fs},polygonEnd:function(){Bs.lineStart=Is}};d3.geo.circle=function(){function i(){var t=typeof e=="function"?e.apply(this,arguments):e,n=Oo(-t[0]*a,-t[1]*a,0).invert,i=[];return r(null,null,1,{point:function(e,t){i.push(e=n(e,t)),e[0]*=f,e[1]*=f}}),{type:"Polygon",coordinates:[i]}}var e=[0,0],t,n=6,r;return i.origin=function(t){return arguments.length?(e=t,i):e},i.angle=function(e){return arguments.length?(r=Rs((t=+e)*a,n*a),i):t},i.precision=function(e){return arguments.length?(r=Rs(t*a,(n=+e)*a),i):n},i.angle(90)};var Qs=zs(S,Gs,Zs);(d3.geo.equirectangular=function(){return ko(no).scale(250/o)}).raw=no.invert=no;var ro=Ho(function(e){return 1/e},Math.atan);(d3.geo.gnomonic=function(){return ko(ro)}).raw=ro,d3.geo.graticule=function(){function l(){return{type:"MultiLineString",coordinates:c()}}function c(){return d3.range(Math.ceil(t/i)*i,e,i).map(o).concat(d3.range(Math.ceil(r/s)*s,n,s).map(a))}var e,t,n,r,i=22.5,s=i,o,a,f=2.5;return l.lines=function(){return c().map(function(e){return{type:"LineString",coordinates:e}})},l.outline=function(){return{type:"Polygon",coordinates:[o(t).concat(a(n).slice(1),o(e).reverse().slice(1),a(r).reverse().slice(1))]}},l.extent=function(i){return arguments.length?(t=+i[0][0],e=+i[1][0],r=+i[0][1],n=+i[1][1],t>e&&(i=t,t=e,e=i),r>n&&(i=r,r=n,n=i),l.precision(f)):[[t,r],[e,n]]},l.step=function(e){return arguments.length?(i=+e[0],s=+e[1],l):[i,s]},l.precision=function(i){return arguments.length?(f=+i,o=io(r,n,f),a=so(t,e,f),l):f},l.extent([[-180+u,-90+u],[180-u,90-u]])},d3.geo.interpolate=function(e,t){return oo(e[0]*a,e[1]*a,t[0]*a,t[1]*a)},d3.geo.greatArc=function(){function o(){var r=t||e.apply(this,arguments),o=a||n.apply(this,arguments),u=s||d3.geo.interpolate(r,o),a=0,f=i/u.distance,l=[r];while((a+=f)<1)l.push(u(a));return l.push(o),{type:"LineString",coordinates:l}}var e=c,t,n=l,r,i=6*a,s;return o.distance=function(){return(s||d3.geo.interpolate(t||e.apply(this,arguments),r||n.apply(this,arguments))).distance},o.source=function(n){return arguments.length?(e=n,t=typeof n=="function"?null:n,s=t&&r?d3.geo.interpolate(t,r):null,o):e},o.target=function(e){return arguments.length?(n=e,r=typeof e=="function"?null:e,s=t&&r?d3.geo.interpolate(t,r):null,o):n},o.precision=function(e){return arguments.length?(i=e*a,o):i/a},o},uo.invert=function(e,t){return[2*o*e,2*Math.atan(Math.exp(2*o*t))-o/2]},(d3.geo.mercator=function(){return ko(uo).scale(500)}).raw=uo;var ao=Ho(function(){return 1},Math.asin);(d3.geo.orthographic=function(){return ko(ao)}).raw=ao,d3.geo.path=function(){function s(t){return t&&d3.geo.stream(t,r(i.pointRadius(typeof e=="function"?+e.apply(this,arguments):e))),i.result()}var e=4.5,t,n,r,i;return s.area=function(e){return po=0,d3.geo.stream(e,r(mo)),po},s.centroid=function(e){return Ms=Ds=Ps=Hs=0,d3.geo.stream(e,r(yo)),Hs?[Ds/Hs,Ps/Hs]:undefined},s.bounds=function(e){return Os(r)(e)},s.projection=function(e){return arguments.length?(r=(t=e)?e.stream||lo(e):E,s):t},s.context=function(e){return arguments.length?(i=(n=e)==null?new co:new ho(e),s):n},s.pointRadius=function(t){return arguments.length?(e=typeof t=="function"?t:+t,s):e},s.projection(d3.geo.albersUsa()).context(null)};var po,vo,mo={point:qn,lineStart:qn,lineEnd:qn,polygonStart:function(){vo=0,mo.lineStart=go},polygonEnd:function(){mo.lineStart=mo.lineEnd=mo.point=qn,po+=Math.abs(vo/2)}},yo={point:bo,lineStart:wo,lineEnd:Eo,polygonStart:function(){yo.lineStart=So},polygonEnd:function(){yo.point=bo,yo.lineStart=wo,yo.lineEnd=Eo}};d3.geo.area=function(e){return xo=0,d3.geo.stream(e,No),xo};var xo,To,No={sphere:function(){xo+=4*o},point:qn,lineStart:qn,lineEnd:qn,polygonStart:function(){To=0,No.lineStart=Co},polygonEnd:function(){xo+=To<0?4*o+To:To,No.lineStart=No.lineEnd=No.point=qn}};d3.geo.projection=ko,d3.geo.projectionMutator=Lo;var Po=Ho(function(e){return 1/(1+e)},function(e){return 2*Math.atan(e)});(d3.geo.stereographic=function(){return ko(Po)}).raw=Po,d3.geom={},d3.geom.hull=function(e){if(e.length<3)return[];var t=e.length,n=t-1,r=[],i=[],s,o,u=0,a,f,l,c,h,p,d,v;for(s=1;s=l*l+c*c?r[s].index=-1:(r[h].index=-1,d=r[s].angle,h=s,p=o)):(d=r[s].angle,h=s,p=o);i.push(u);for(s=0,o=0;s<2;++o)r[o].index!==-1&&(i.push(r[o].index),s++);v=i.length;for(;o=0?(r=e.ep.r,i=e.ep.l):(r=e.ep.l,i=e.ep.r),e.a===1?(u=r?r.y:-n,s=e.c-e.b*u,a=i?i.y:n,o=e.c-e.b*a):(s=r?r.x:-n,u=e.c-e.a*s,o=i?i.x:n,a=e.c-e.a*o);var f=[s,u],l=[o,a];t[e.region.l.index].push(f,l),t[e.region.r.index].push(f,l)}),t=t.map(function(t,n){var r=e[n][0],i=e[n][1],s=t.map(function(e){return Math.atan2(e[0]-r,e[1]-i)});return d3.range(t.length).sort(function(e,t){return s[e]-s[t]}).filter(function(e,t,n){return!t||s[e]-s[n[t-1]]>u}).map(function(e){return t[e]})}),t.forEach(function(t,r){var i=t.length;if(!i)return t.push([-n,-n],[-n,n],[n,n],[n,-n]);if(i>2)return;var s=e[r],o=t[0],a=t[1],f=s[0],l=s[1],c=o[0],h=o[1],p=a[0],d=a[1],v=Math.abs(p-c),m=d-h;if(Math.abs(m)0&&(g*=-1),t.push([-n,g],[n,g]))}}),t};var Io={l:"r",r:"l"};d3.geom.delaunay=function(e){var t=e.map(function(){return[]}),n=[];return qo(e,function(n){t[n.region.l.index].push(e[n.region.r.index])}),t.forEach(function(t,r){var i=e[r],s=i[0],o=i[1];t.forEach(function(e){e.angle=Math.atan2(e[0]-s,e[1]-o)}),t.sort(function(e,t){return e.angle-t.angle});for(var u=0,a=t.length-1;u=o,f=t.y>=u,c=(f<<1)+a;e.leaf=!1,e=e.nodes[c]||(e.nodes[c]=Ro()),a?n=o:i=o,f?r=u:s=u,l(e,t,n,r,i,s)}var s,o=-1,u=e.length;if(arguments.length<5)if(arguments.length===3)i=n,r=t,n=t=0;else{t=n=Infinity,r=i=-Infinity;while(++or&&(r=s.x),s.y>i&&(i=s.y)}var a=r-t,f=i-n;a>f?i=n+a:r=t+f;var h=Ro();return h.add=function(e){l(h,e,t,n,r,i)},h.visit=function(e){Uo(e,h,t,n,r,i)},e.forEach(h.add),h},d3.time={};var zo=Date,Wo=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];Xo.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(){Vo.setUTCDate.apply(this._,arguments)},setDay:function(){Vo.setUTCDay.apply(this._,arguments)},setFullYear:function(){Vo.setUTCFullYear.apply(this._,arguments)},setHours:function(){Vo.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Vo.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Vo.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Vo.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Vo.setUTCSeconds.apply(this._,arguments)},setTime:function(){Vo.setTime.apply(this._,arguments)}};var Vo=Date.prototype,$o="%a %b %e %X %Y",Jo="%m/%d/%Y",Ko="%H:%M:%S",Qo=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Go=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Yo=["January","February","March","April","May","June","July","August","September","October","November","December"],Zo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];d3.time.format=function(e){function n(n){var r=[],i=-1,s=0,o,u,a;while(++i=12?"PM":"AM"},S:function(e,t){return ru(e.getSeconds(),t,2)},U:function(e,t){return ru(d3.time.sundayOfYear(e),t,2)},w:function(e){return e.getDay()},W:function(e,t){return ru(d3.time.mondayOfYear(e),t,2)},x:d3.time.format(Jo),X:d3.time.format(Ko),y:function(e,t){return ru(e.getFullYear()%100,t,2)},Y:function(e,t){return ru(e.getFullYear()%1e4,t,4)},Z:_u,"%":function(){return"%"}},hu={a:pu,A:du,b:vu,B:mu,c:gu,d:Tu,e:Tu,H:Nu,I:Nu,L:Lu,m:xu,M:Cu,p:Ou,S:ku,x:yu,X:bu,y:Eu,Y:wu},Au=/^\s*\d+/,Mu=d3.map({am:0,pm:1});d3.time.format.utc=function(e){function n(e){try{zo=Xo;var n=new zo;return n._=e,t(n)}finally{zo=Date}}var t=d3.time.format(e);return n.parse=function(e){try{zo=Xo;var n=t.parse(e);return n&&n._}finally{zo=Date}},n.toString=t.toString,n};var Du=d3.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ");d3.time.format.iso=Date.prototype.toISOString?Pu:Du,Pu.parse=function(e){var t=new Date(e);return isNaN(t)?null:t},Pu.toString=Du.toString,d3.time.second=Hu(function(e){return new zo(Math.floor(e/1e3)*1e3)},function(e,t){e.setTime(e.getTime()+Math.floor(t)*1e3)},function(e){return e.getSeconds()}),d3.time.seconds=d3.time.second.range,d3.time.seconds.utc=d3.time.second.utc.range,d3.time.minute=Hu(function(e){return new zo(Math.floor(e/6e4)*6e4)},function(e,t){e.setTime(e.getTime()+Math.floor(t)*6e4)},function(e){return e.getMinutes()}),d3.time.minutes=d3.time.minute.range,d3.time.minutes.utc=d3.time.minute.utc.range,d3.time.hour=Hu(function(e){var t=e.getTimezoneOffset()/60;return new zo((Math.floor(e/36e5-t)+t)*36e5)},function(e,t){e.setTime(e.getTime()+Math.floor(t)*36e5)},function(e){return e.getHours()}),d3.time.hours=d3.time.hour.range,d3.time.hours.utc=d3.time.hour.utc.range,d3.time.day=Hu(function(e){var t=new zo(1970,0);return t.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t},function(e,t){e.setDate(e.getDate()+t)},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 t=d3.time.year(e);return Math.floor((e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*6e4)/864e5)},Wo.forEach(function(e,t){e=e.toLowerCase(),t=7-t;var n=d3.time[e]=Hu(function(e){return(e=d3.time.day(e)).setDate(e.getDate()-(e.getDay()+t)%7),e},function(e,t){e.setDate(e.getDate()+Math.floor(t)*7)},function(e){var n=d3.time.year(e).getDay();return Math.floor((d3.time.dayOfYear(e)+(n+t)%7)/7)-(n!==t)});d3.time[e+"s"]=n.range,d3.time[e+"s"].utc=n.utc.range,d3.time[e+"OfYear"]=function(e){var n=d3.time.year(e).getDay();return Math.floor((d3.time.dayOfYear(e)+(n+t)%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=Hu(function(e){return e=d3.time.day(e),e.setDate(1),e},function(e,t){e.setMonth(e.getMonth()+t)},function(e){return e.getMonth()}),d3.time.months=d3.time.month.range,d3.time.months.utc=d3.time.month.utc.range,d3.time.year=Hu(function(e){return e=d3.time.day(e),e.setMonth(0,1),e},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e){return e.getFullYear()}),d3.time.years=d3.time.year.range,d3.time.years.utc=d3.time.year.utc.range;var zu=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Wu=[[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]],Xu=[[d3.time.format("%Y"),S],[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()}]],Vu=d3.scale.linear(),$u=qu(Xu);Wu.year=function(e,t){return Vu.domain(e.map(Uu)).ticks(t).map(Ru)},d3.time.scale=function(){return ju(d3.scale.linear(),Wu,$u)};var Ju=Wu.map(function(e){return[e[0].utc,e[1]]}),Ku=[[d3.time.format.utc("%Y"),S],[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()}]],Qu=qu(Ku);Ju.year=function(e,t){return Vu.domain(e.map(Yu)).ticks(t).map(Gu)},d3.time.scale.utc=function(){return ju(d3.scale.linear(),Ju,Qu)}}(),define("d3",function(e){return function(){var t,n;return t||e.d3}}(this)),define("app/views/injector",["jquery"],function(e){e("