UNPKG

@dd-decaf/escher

Version:

Escher: A Web Application for Building, Sharing, and Embedding Data-Rich Visualizations of Metabolic Pathways

1 lines 600 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.escher=e():t.escher=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=117)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(36);n.d(e,"creator",function(){return r.a});var i=n(133);n.d(e,"local",function(){return i.a});var o=n(60);n.d(e,"matcher",function(){return o.a});var a=n(134);n.d(e,"mouse",function(){return a.a});var s=n(37);n.d(e,"namespace",function(){return s.a});var A=n(38);n.d(e,"namespaces",function(){return A.a});var c=n(26);n.d(e,"clientPoint",function(){return c.a});var u=n(135);n.d(e,"select",function(){return u.a});var l=n(163);n.d(e,"selectAll",function(){return l.a});var h=n(6);n.d(e,"selection",function(){return h.b});var d=n(41);n.d(e,"selector",function(){return d.a});var f=n(61);n.d(e,"selectorAll",function(){return f.a});var p=n(64);n.d(e,"style",function(){return p.b});var g=n(164);n.d(e,"touch",function(){return g.a});var v=n(165);n.d(e,"touches",function(){return v.a});var b=n(42);n.d(e,"window",function(){return b.a});var m=n(40);n.d(e,"event",function(){return m.c}),n.d(e,"customEvent",function(){return m.a})},function(t,e,n){"use strict";function r(){try{new Blob}catch(t){alert("Blob not supported")}}function i(t,e,n){if(void 0===t||null===t)return e;var r={};for(var i in e){var o=i in t&&null!==t[i]&&void 0!==t[i],a=o?t[i]:e[i];n&&i in n&&(a=parseFloat(a),isNaN(a)&&(o?(console.warn("Bad float for option "+i),a=parseFloat(e[i]),isNaN(a)&&(console.warn("Bad float for default "+i),a=null)):(console.warn("Bad float for default "+i),a=null))),r[i]=a}return r}function o(t){for(var e=t.node();e.hasChildNodes();)e.removeChild(e.lastChild)}function a(t,e){var n="";return t&&ht(t,function(t,r){t&&console.warn(t),n=r,e(n)}),!1}function s(t,e){return-1!==t.indexOf(e,t.length-e.length)}function A(t,e,n,r){return r?(e&&console.warn("File "+e+" overridden by value."),void n.call(t,null,r)):e?void(s(e,"json")?lt(e,function(e,r){n.call(t,e,r)}):s(e,"css")?ht(e,function(e,r){n.call(t,e,r)}):n.call(t,"Unrecognized file type",null)):void n.call(t,"No filename",null)}function c(t,e,n){0===e.length&&n.call(t);for(var r=-1,i=e.length;++r<e.length;)A(t,e[r].file,function(e,r){this.call(t,e,r),--i||n.call(t)}.bind(e[r].callback),e[r].value)}function u(){var t,e=function e(n){if(!(this instanceof e)){t=!0;var r=new e(arguments);return t=!1,r}"function"==typeof this.init&&this.init.apply(this,t?n:arguments)};return e}function l(t){return new Proxy(t,{apply:function(t,e,n){return new(Function.prototype.bind.apply(t,[null].concat(n)))}})}function h(t,e){t.select("defs").remove();var n=t.append("defs"),r=n.node();return r.parentNode.insertBefore(r,r.parentNode.firstChild),n.append("style").attr("type","text/css").text(e),n}function d(t,e,n,r,i,o,a,s){var A={};for(var c in r)void 0===r[c]?console.warn("Undefined value for id "+c+" in object. Ignoring."):A[c]=r[c];var u=t.select(e).selectAll(n).data(g(A,i),function(t){return t[i]}),l=o?o(u.enter()).merge(u):u;a&&l.call(a),s&&u.exit().call(s)}function f(t,e,n,r,i,o,a){var s=t.selectAll(e).data(function(t){return g(t[n],r)},function(t){return t[r]}),A=i?i(s.enter()).merge(s):s;o&&A.call(o),a&&s.exit().call(a)}function p(t,e){var n=[];for(var r in t){var i=m(t[r]);i[e]=r,n.push(i)}return n}function g(t,e){var n=[];for(var r in t){var i=t[r];i[e]=r,n.push(i)}return n}function v(t,e){if(!t||!e)return!1;if(t.length!=e.length)return!1;for(var n=0,r=t.length;n<r;n++)if(t[n]!=e[n])return!1;return!0}function b(t){for(var e={},n=0,r=t.length;n<r;n++)for(var i=t[n],o=Object.keys(i),a=0,s=o.length;a<s;a++){var A=o[a];if(A in e)e[A][n]=i[A];else{for(var c=[],u=0;u<r;u++)c[u]=null;c[n]=i[A],e[A]=c}}return e}function m(t){return ct.isArray(t)?ct.map(t,function(t){return m(t)}):ct.isObject(t)?ct.mapObject(t,function(t,e){return m(t)}):t}function y(t,e,n){void 0===n&&(n=!1);for(var r in e){if(r in t&&!n)throw new Error("Attribute "+r+" already in object.");t[r]=e[r]}}function _(t){var e=[];return t.forEach(function(t){t.forEach(function(t){e.indexOf(t)<0&&e.push(t)})}),e}function B(t){for(var e=[],n=0,r=t.length;n<r;n++)-1===e.indexOf(t[n])&&e.push(t[n]);return e}function w(t,e,n){var r;return function(){var i=this,o=arguments,a=function(){r=null,n||t.apply(i,o)},s=n&&!r;clearTimeout(r),r=setTimeout(a,e),s&&t.apply(i,o)}}function C(t,e){for(var n={},r=-1;++r<e.length;)n[e[r]]=m(t[e[r]]);return e.length!==Object.keys(n).length&&console.warn("did not find correct reaction subset"),n}function x(t,e){for(var n={},r=-1;++r<e.length;)n[e[r]]=t[e[r]];return e.length!==Object.keys(n).length&&console.warn("did not find correct reaction subset"),n}function E(t,e){return null===t||null===e||void 0===t||void 0===e?null:{x:t.x+e.x,y:t.y+e.y}}function M(t,e){return null===t||null===e||void 0===t||void 0===e?null:{x:t.x-e.x,y:t.y-e.y}}function I(t,e){return{x:t.x*e,y:t.y*e}}function Q(t,e){r();var n=JSON.stringify(t),i=new Blob([n],{type:"application/json"});pt(i,e+".json")}function D(t,e,n,r){window.File&&window.FileReader&&window.FileList&&window.Blob||e("The File APIs are not fully supported in this browser.",null);var i=new window.FileReader;if(i.onload=function(t){var n,r=t.target.result;try{n=JSON.parse(r)}catch(t){return void e(t,null)}e(null,n)},void 0!==n&&null!==n)try{n()}catch(t){console.warn(t)}i.onabort=function(t){try{r()}catch(t){console.warn(t)}},i.onerror=function(t){try{r()}catch(t){console.warn(t)}},i.readAsText(t)}function k(t,e,n,r,i,o){var a=function(t){var r,i,o=t.target.result;try{r=JSON.parse(o)}catch(t){i="JSON error: "+t;try{r=e(dt(o))}catch(t){return void n(i+"\nCSV error: "+t,null)}}n(null,r)};if(void 0!==o&&null!==o)return console.warn("Debugging load_json_or_csv"),a(o);window.File&&window.FileReader&&window.FileList&&window.Blob||n("The File APIs are not fully supported in this browser.",null);var s=new window.FileReader;if(void 0!==r&&null!==r)try{r()}catch(t){console.warn(t)}s.onabort=function(t){try{i()}catch(t){console.warn(t)}},s.onerror=function(t){try{i()}catch(t){console.warn(t)}},s.onload=a,s.readAsText(t)}function S(t,e,n){r();var i=(new XMLSerializer).serializeToString(e.node());n&&(i=At.xml(i)),i='<?xml version="1.0" encoding="utf-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"\n "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+i;var o=new Blob([i],{type:"image/svg+xml"});pt(o,t+".svg")}function j(t,e){r();var n=(new XMLSerializer).serializeToString(e.node());n='<?xml version="1.0" encoding="utf-8"?>\n<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"\n "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">\n'+n;var i=document.createElement("canvas"),o=i.getContext("2d"),a=e.node().getBBox(),s=a.width+a.x,A=a.height+a.y;s<1e4&&A<1e4?(i.width=s,i.height=A):i.width>i.height?(i.width=1e4,i.height=A/s*1e4):(i.width=s/A*1e4,i.height=1e4);var c=new Image;c.src="data:image/svg+xml;base64,"+btoa(n),c.onload=function(){o.fillStyle="#FFF",o.fillRect(0,0,i.width,i.height),o.drawImage(c,0,0,i.width,i.height),i.toBlob(function(e){pt(e,t+".png")})}}function N(t,e,n){return t.map(function(t){return L(t,e,n)})}function L(t,e,n){return{x:Math.cos(-e)*(t.x-n.x)+Math.sin(-e)*(t.y-n.y)+n.x-t.x,y:-Math.sin(-e)*(t.x-n.x)+Math.cos(-e)*(t.y-n.y)+n.y-t.y}}function T(t){var e=t[1].x-t[0].x,n=t[1].y-t[0].y;return 0===e&&n>=0?Math.PI/2:0===e&&n<0?3*Math.PI/2:e>=0&&n>=0?Math.atan(n/e):e>=0?Math.atan(n/e)+2*Math.PI:Math.atan(n/e)+Math.PI}function O(t){return 180*t/Math.PI}function F(t){return t<-Math.PI?t+2*Math.floor((t-Math.PI)/(-2*Math.PI))*Math.PI:t>Math.PI?t-2*Math.floor((t+Math.PI)/(2*Math.PI))*Math.PI:t}function z(t){return Math.PI/180*t}function Y(t){return F(z(t))}function U(t,e,n){var r=Math.atan2(e.x-n.x,n.y-e.y);return Math.atan2(e.x-n.x+t.x,n.y-e.y-t.y)-r}function G(t,e){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function W(t,e){e.forEach(function(n,r){void 0===t[r]&&console.error("Argument is undefined: "+e[r])})}function R(t,e){return t+"_"+e}function Z(t){var e=/(.*)_([a-z0-9]{1,2})$/,n=e.exec(t);return null!==n?n.slice(1,3):[t,null]}function H(t){return t.reduce(function(t,e){return t+e})/t.length}function V(t){t.sort(function(t,e){return t-e});var e=Math.floor(t.length/2);return t.length%2==1?t[e]:(t[e-1]+t[e])/2}function P(t){t.sort(function(t,e){return t-e});var e=Math.floor(t.length/2);return 1===t.length?[t[0],t[0],t[0]]:t.length%2==1?[V(t.slice(0,e)),t[e],V(t.slice(e+1))]:[V(t.slice(0,e)),(t[e-1]+t[e])/2,V(t.slice(e))]}function K(t){for(var e="",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=0;r<t;r++)e+=n.charAt(Math.floor(Math.random()*n.length));return e}function J(){return K(12)}function X(t,e){for(t instanceof ft&&(t=t.node());null!==t.parentNode;)if(t=t.parentNode,void 0!==t.tagName&&t.tagName.toLowerCase()===e.toLowerCase())return!0;return!1}function q(t,e){return void 0!==e&&null!==e&&(e=e.replace(/^\/|\/$/g,""),t=[e,t].join("/")),t.replace(/^\/|\/$/g,"")+".json"}function $(t){return t.ownerDocument}function tt(t){return $(t).defaultView}function et(t){if(-1!==t.indexOf("skew")||-1!==t.indexOf("matrix"))throw new Error("d3_transform_catch does not work with skew or matrix");var e=/translate\s*\(\s*([0-9.-]+)\s*,\s*([0-9.-]+)\s*\)/.exec(t),n=ct.isNull(e),r=n?0:Number(e[1]),i=n?0:Number(e[2]),o=/rotate\s*\(\s*([0-9.-]+)\s*\)/.exec(t),a=ct.isNull(o),s=a?0:Number(o[1]),A=/scale\s*\(\s*([0-9.-]+)\s*\)/.exec(t);return{translate:[r,i],rotate:s,scale:ct.isNull(A)?0:Number(A[1])}}function nt(t,e,n){return Math.abs(e-n)<1e-6?1:e<0&&n>0?.2:e<=1e-6||n>=-1e-6?.5:e>1e-6||n<-1e-6?.8:void 0}function rt(t,e){return t.reduce(function(t,n){return t||e(n)},null)}function it(t){return!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:ut.cofactors).includes(Z(t)[0])}function ot(t){var e=document.createElement("template");return t=t.trim(),e.innerHTML=t,e.content.firstChild}function at(t,e){return ct.pick(t,function(t){return ct.contains(e,t.bigg_id)})}function st(t){return Object.assign.apply(Object,[{}].concat(Object.entries(t).map(function(t){var e,n=t[0],r=t[1].segments;r=Object.values(r),r.length>=5&&(r=r.filter(function(t){return null===t.b1&&null===t.b2}));var i=r.map(function(t){return[t.from_node_id,t.to_node_id]}),o=void 0;return o=1===i.length?i[0][1]:i[0].filter(function(t){return new Set(i[1]).has(t)}),e={},e[n]=[o],e})))}var At=n(56),ct=n(2),ut=n(57),lt=n(24).json,ht=n(24).text,dt=n(34).csvParseRows,ft=n(0).selection;try{var pt=n(166).saveAs}catch(t){console.warn("Not a browser, so FileSaver.js not available.")}t.exports={set_options:i,remove_child_nodes:o,load_css:a,load_files:c,load_the_file:A,make_class:u,class_with_optional_new:l,setup_defs:h,draw_an_object:d,draw_a_nested_object:f,make_array:p,make_array_ref:g,compare_arrays:v,arrayToObject:b,clone:m,extend:y,uniqueConcat:_,unique_strings_array:B,debounce:w,object_slice_for_ids:C,object_slice_for_ids_ref:x,c_plus_c:E,c_minus_c:M,c_times_scalar:I,download_json:Q,load_json:D,load_json_or_csv:k,downloadSvg:S,downloadPng:j,rotate_coords_recursive:N,rotate_coords:L,get_angle:T,to_degrees:O,angleNorm:F,to_radians:z,to_radians_norm:Y,angle_for_event:U,distance:G,check_undefined:W,compartmentalize:R,decompartmentalize:Z,mean:H,median:V,quartiles:P,random_characters:K,generate_map_id:J,check_for_parent_tag:X,name_to_url:q,get_document:$,get_window:tt,d3_transform_catch:et,calculate_fva_opacity:nt,findMap:rt,isMetabolite:it,htmlToElement:ot,object_slice_for_bigg:at,get_central_or_last_nodes:st}},function(t,e,n){var r,i;(function(){function n(t){function e(e,n,r,i,o,a){for(;o>=0&&o<a;o+=t){var s=i?i[o]:o;r=n(r,e[s],s,e)}return r}return function(n,r,i,o){r=w(r,o,4);var a=!D(n)&&B.keys(n),s=(a||n).length,A=t>0?0:s-1;return arguments.length<3&&(i=n[a?a[A]:A],A+=t),e(n,r,i,a,A,s)}}function o(t){return function(e,n,r){n=C(n,r);for(var i=Q(e),o=t>0?0:i-1;o>=0&&o<i;o+=t)if(n(e[o],o,e))return o;return-1}}function a(t,e,n){return function(r,i,o){var a=0,s=Q(r);if("number"==typeof o)t>0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(n&&o&&s)return o=n(r,i),r[o]===i?o:-1;if(i!==i)return o=e(f.call(r,a,s),B.isNaN),o>=0?o+a:-1;for(o=t>0?a:s-1;o>=0&&o<s;o+=t)if(r[o]===i)return o;return-1}}function s(t,e){var n=L.length,r=t.constructor,i=B.isFunction(r)&&r.prototype||l,o="constructor";for(B.has(t,o)&&!B.contains(e,o)&&e.push(o);n--;)(o=L[n])in t&&t[o]!==i[o]&&!B.contains(e,o)&&e.push(o)}var A=this,c=A._,u=Array.prototype,l=Object.prototype,h=Function.prototype,d=u.push,f=u.slice,p=l.toString,g=l.hasOwnProperty,v=Array.isArray,b=Object.keys,m=h.bind,y=Object.create,_=function(){},B=function(t){return t instanceof B?t:this instanceof B?void(this._wrapped=t):new B(t)};void 0!==t&&t.exports&&(e=t.exports=B),e._=B,B.VERSION="1.8.3";var w=function(t,e,n){if(void 0===e)return t;switch(null==n?3:n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)};case 4:return function(n,r,i,o){return t.call(e,n,r,i,o)}}return function(){return t.apply(e,arguments)}},C=function(t,e,n){return null==t?B.identity:B.isFunction(t)?w(t,e,n):B.isObject(t)?B.matcher(t):B.property(t)};B.iteratee=function(t,e){return C(t,e,1/0)};var x=function(t,e){return function(n){var r=arguments.length;if(r<2||null==n)return n;for(var i=1;i<r;i++)for(var o=arguments[i],a=t(o),s=a.length,A=0;A<s;A++){var c=a[A];e&&void 0!==n[c]||(n[c]=o[c])}return n}},E=function(t){if(!B.isObject(t))return{};if(y)return y(t);_.prototype=t;var e=new _;return _.prototype=null,e},M=function(t){return function(e){return null==e?void 0:e[t]}},I=Math.pow(2,53)-1,Q=M("length"),D=function(t){var e=Q(t);return"number"==typeof e&&e>=0&&e<=I};B.each=B.forEach=function(t,e,n){e=w(e,n);var r,i;if(D(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=B.keys(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t},B.map=B.collect=function(t,e,n){e=C(e,n);for(var r=!D(t)&&B.keys(t),i=(r||t).length,o=Array(i),a=0;a<i;a++){var s=r?r[a]:a;o[a]=e(t[s],s,t)}return o},B.reduce=B.foldl=B.inject=n(1),B.reduceRight=B.foldr=n(-1),B.find=B.detect=function(t,e,n){var r;if(void 0!==(r=D(t)?B.findIndex(t,e,n):B.findKey(t,e,n))&&-1!==r)return t[r]},B.filter=B.select=function(t,e,n){var r=[];return e=C(e,n),B.each(t,function(t,n,i){e(t,n,i)&&r.push(t)}),r},B.reject=function(t,e,n){return B.filter(t,B.negate(C(e)),n)},B.every=B.all=function(t,e,n){e=C(e,n);for(var r=!D(t)&&B.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(!e(t[a],a,t))return!1}return!0},B.some=B.any=function(t,e,n){e=C(e,n);for(var r=!D(t)&&B.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(e(t[a],a,t))return!0}return!1},B.contains=B.includes=B.include=function(t,e,n,r){return D(t)||(t=B.values(t)),("number"!=typeof n||r)&&(n=0),B.indexOf(t,e,n)>=0},B.invoke=function(t,e){var n=f.call(arguments,2),r=B.isFunction(e);return B.map(t,function(t){var i=r?e:t[e];return null==i?i:i.apply(t,n)})},B.pluck=function(t,e){return B.map(t,B.property(e))},B.where=function(t,e){return B.filter(t,B.matcher(e))},B.findWhere=function(t,e){return B.find(t,B.matcher(e))},B.max=function(t,e,n){var r,i,o=-1/0,a=-1/0;if(null==e&&null!=t){t=D(t)?t:B.values(t);for(var s=0,A=t.length;s<A;s++)(r=t[s])>o&&(o=r)}else e=C(e,n),B.each(t,function(t,n,r){((i=e(t,n,r))>a||i===-1/0&&o===-1/0)&&(o=t,a=i)});return o},B.min=function(t,e,n){var r,i,o=1/0,a=1/0;if(null==e&&null!=t){t=D(t)?t:B.values(t);for(var s=0,A=t.length;s<A;s++)(r=t[s])<o&&(o=r)}else e=C(e,n),B.each(t,function(t,n,r){((i=e(t,n,r))<a||i===1/0&&o===1/0)&&(o=t,a=i)});return o},B.shuffle=function(t){for(var e,n=D(t)?t:B.values(t),r=n.length,i=Array(r),o=0;o<r;o++)e=B.random(0,o),e!==o&&(i[o]=i[e]),i[e]=n[o];return i},B.sample=function(t,e,n){return null==e||n?(D(t)||(t=B.values(t)),t[B.random(t.length-1)]):B.shuffle(t).slice(0,Math.max(0,e))},B.sortBy=function(t,e,n){return e=C(e,n),B.pluck(B.map(t,function(t,n,r){return{value:t,index:n,criteria:e(t,n,r)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index}),"value")};var k=function(t){return function(e,n,r){var i={};return n=C(n,r),B.each(e,function(r,o){var a=n(r,o,e);t(i,r,a)}),i}};B.groupBy=k(function(t,e,n){B.has(t,n)?t[n].push(e):t[n]=[e]}),B.indexBy=k(function(t,e,n){t[n]=e}),B.countBy=k(function(t,e,n){B.has(t,n)?t[n]++:t[n]=1}),B.toArray=function(t){return t?B.isArray(t)?f.call(t):D(t)?B.map(t,B.identity):B.values(t):[]},B.size=function(t){return null==t?0:D(t)?t.length:B.keys(t).length},B.partition=function(t,e,n){e=C(e,n);var r=[],i=[];return B.each(t,function(t,n,o){(e(t,n,o)?r:i).push(t)}),[r,i]},B.first=B.head=B.take=function(t,e,n){if(null!=t)return null==e||n?t[0]:B.initial(t,t.length-e)},B.initial=function(t,e,n){return f.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},B.last=function(t,e,n){if(null!=t)return null==e||n?t[t.length-1]:B.rest(t,Math.max(0,t.length-e))},B.rest=B.tail=B.drop=function(t,e,n){return f.call(t,null==e||n?1:e)},B.compact=function(t){return B.filter(t,B.identity)};var S=function(t,e,n,r){for(var i=[],o=0,a=r||0,s=Q(t);a<s;a++){var A=t[a];if(D(A)&&(B.isArray(A)||B.isArguments(A))){e||(A=S(A,e,n));var c=0,u=A.length;for(i.length+=u;c<u;)i[o++]=A[c++]}else n||(i[o++]=A)}return i};B.flatten=function(t,e){return S(t,e,!1)},B.without=function(t){return B.difference(t,f.call(arguments,1))},B.uniq=B.unique=function(t,e,n,r){B.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=C(n,r));for(var i=[],o=[],a=0,s=Q(t);a<s;a++){var A=t[a],c=n?n(A,a,t):A;e?(a&&o===c||i.push(A),o=c):n?B.contains(o,c)||(o.push(c),i.push(A)):B.contains(i,A)||i.push(A)}return i},B.union=function(){return B.uniq(S(arguments,!0,!0))},B.intersection=function(t){for(var e=[],n=arguments.length,r=0,i=Q(t);r<i;r++){var o=t[r];if(!B.contains(e,o)){for(var a=1;a<n&&B.contains(arguments[a],o);a++);a===n&&e.push(o)}}return e},B.difference=function(t){var e=S(arguments,!0,!0,1);return B.filter(t,function(t){return!B.contains(e,t)})},B.zip=function(){return B.unzip(arguments)},B.unzip=function(t){for(var e=t&&B.max(t,Q).length||0,n=Array(e),r=0;r<e;r++)n[r]=B.pluck(t,r);return n},B.object=function(t,e){for(var n={},r=0,i=Q(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n},B.findIndex=o(1),B.findLastIndex=o(-1),B.sortedIndex=function(t,e,n,r){n=C(n,r,1);for(var i=n(e),o=0,a=Q(t);o<a;){var s=Math.floor((o+a)/2);n(t[s])<i?o=s+1:a=s}return o},B.indexOf=a(1,B.findIndex,B.sortedIndex),B.lastIndexOf=a(-1,B.findLastIndex),B.range=function(t,e,n){null==e&&(e=t||0,t=0),n=n||1;for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i};var j=function(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=E(t.prototype),a=t.apply(o,i);return B.isObject(a)?a:o};B.bind=function(t,e){if(m&&t.bind===m)return m.apply(t,f.call(arguments,1));if(!B.isFunction(t))throw new TypeError("Bind must be called on a function");var n=f.call(arguments,2),r=function(){return j(t,r,e,this,n.concat(f.call(arguments)))};return r},B.partial=function(t){var e=f.call(arguments,1),n=function(){for(var r=0,i=e.length,o=Array(i),a=0;a<i;a++)o[a]=e[a]===B?arguments[r++]:e[a];for(;r<arguments.length;)o.push(arguments[r++]);return j(t,n,this,this,o)};return n},B.bindAll=function(t){var e,n,r=arguments.length;if(r<=1)throw new Error("bindAll must be passed function names");for(e=1;e<r;e++)n=arguments[e],t[n]=B.bind(t[n],t);return t},B.memoize=function(t,e){var n=function(r){var i=n.cache,o=""+(e?e.apply(this,arguments):r);return B.has(i,o)||(i[o]=t.apply(this,arguments)),i[o]};return n.cache={},n},B.delay=function(t,e){var n=f.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},B.defer=B.partial(B.delay,B,1),B.throttle=function(t,e,n){var r,i,o,a=null,s=0;n||(n={});var A=function(){s=!1===n.leading?0:B.now(),a=null,o=t.apply(r,i),a||(r=i=null)};return function(){var c=B.now();s||!1!==n.leading||(s=c);var u=e-(c-s);return r=this,i=arguments,u<=0||u>e?(a&&(clearTimeout(a),a=null),s=c,o=t.apply(r,i),a||(r=i=null)):a||!1===n.trailing||(a=setTimeout(A,u)),o}},B.debounce=function(t,e,n){var r,i,o,a,s,A=function(){var c=B.now()-a;c<e&&c>=0?r=setTimeout(A,e-c):(r=null,n||(s=t.apply(o,i),r||(o=i=null)))};return function(){o=this,i=arguments,a=B.now();var c=n&&!r;return r||(r=setTimeout(A,e)),c&&(s=t.apply(o,i),o=i=null),s}},B.wrap=function(t,e){return B.partial(e,t)},B.negate=function(t){return function(){return!t.apply(this,arguments)}},B.compose=function(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}},B.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},B.before=function(t,e){var n;return function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},B.once=B.partial(B.before,2);var N=!{toString:null}.propertyIsEnumerable("toString"),L=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];B.keys=function(t){if(!B.isObject(t))return[];if(b)return b(t);var e=[];for(var n in t)B.has(t,n)&&e.push(n);return N&&s(t,e),e},B.allKeys=function(t){if(!B.isObject(t))return[];var e=[];for(var n in t)e.push(n);return N&&s(t,e),e},B.values=function(t){for(var e=B.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r},B.mapObject=function(t,e,n){e=C(e,n);for(var r,i=B.keys(t),o=i.length,a={},s=0;s<o;s++)r=i[s],a[r]=e(t[r],r,t);return a},B.pairs=function(t){for(var e=B.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r},B.invert=function(t){for(var e={},n=B.keys(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e},B.functions=B.methods=function(t){var e=[];for(var n in t)B.isFunction(t[n])&&e.push(n);return e.sort()},B.extend=x(B.allKeys),B.extendOwn=B.assign=x(B.keys),B.findKey=function(t,e,n){e=C(e,n);for(var r,i=B.keys(t),o=0,a=i.length;o<a;o++)if(r=i[o],e(t[r],r,t))return r},B.pick=function(t,e,n){var r,i,o={},a=t;if(null==a)return o;B.isFunction(e)?(i=B.allKeys(a),r=w(e,n)):(i=S(arguments,!1,!1,1),r=function(t,e,n){return e in n},a=Object(a));for(var s=0,A=i.length;s<A;s++){var c=i[s],u=a[c];r(u,c,a)&&(o[c]=u)}return o},B.omit=function(t,e,n){if(B.isFunction(e))e=B.negate(e);else{var r=B.map(S(arguments,!1,!1,1),String);e=function(t,e){return!B.contains(r,e)}}return B.pick(t,e,n)},B.defaults=x(B.allKeys,!0),B.create=function(t,e){var n=E(t);return e&&B.extendOwn(n,e),n},B.clone=function(t){return B.isObject(t)?B.isArray(t)?t.slice():B.extend({},t):t},B.tap=function(t,e){return e(t),t},B.isMatch=function(t,e){var n=B.keys(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var a=n[o];if(e[a]!==i[a]||!(a in i))return!1}return!0};var T=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof B&&(t=t._wrapped),e instanceof B&&(e=e._wrapped);var i=p.call(t);if(i!==p.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,s=e.constructor;if(a!==s&&!(B.isFunction(a)&&a instanceof a&&B.isFunction(s)&&s instanceof s)&&"constructor"in t&&"constructor"in e)return!1}n=n||[],r=r||[];for(var A=n.length;A--;)if(n[A]===t)return r[A]===e;if(n.push(t),r.push(e),o){if((A=t.length)!==e.length)return!1;for(;A--;)if(!T(t[A],e[A],n,r))return!1}else{var c,u=B.keys(t);if(A=u.length,B.keys(e).length!==A)return!1;for(;A--;)if(c=u[A],!B.has(e,c)||!T(t[c],e[c],n,r))return!1}return n.pop(),r.pop(),!0};B.isEqual=function(t,e){return T(t,e)},B.isEmpty=function(t){return null==t||(D(t)&&(B.isArray(t)||B.isString(t)||B.isArguments(t))?0===t.length:0===B.keys(t).length)},B.isElement=function(t){return!(!t||1!==t.nodeType)},B.isArray=v||function(t){return"[object Array]"===p.call(t)},B.isObject=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},B.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(t){B["is"+t]=function(e){return p.call(e)==="[object "+t+"]"}}),B.isArguments(arguments)||(B.isArguments=function(t){return B.has(t,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(B.isFunction=function(t){return"function"==typeof t||!1}),B.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},B.isNaN=function(t){return B.isNumber(t)&&t!==+t},B.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===p.call(t)},B.isNull=function(t){return null===t},B.isUndefined=function(t){return void 0===t},B.has=function(t,e){return null!=t&&g.call(t,e)},B.noConflict=function(){return A._=c,this},B.identity=function(t){return t},B.constant=function(t){return function(){return t}},B.noop=function(){},B.property=M,B.propertyOf=function(t){return null==t?function(){}:function(e){return t[e]}},B.matcher=B.matches=function(t){return t=B.extendOwn({},t),function(e){return B.isMatch(e,t)}},B.times=function(t,e,n){var r=Array(Math.max(0,t));e=w(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r},B.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},B.now=Date.now||function(){return(new Date).getTime()};var O={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},F=B.invert(O),z=function(t){var e=function(e){return t[e]},n="(?:"+B.keys(t).join("|")+")",r=RegExp(n),i=RegExp(n,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,e):t}};B.escape=z(O),B.unescape=z(F),B.result=function(t,e,n){var r=null==t?void 0:t[e];return void 0===r&&(r=n),B.isFunction(r)?r.call(t):r};var Y=0;B.uniqueId=function(t){var e=++Y+"";return t?t+e:e},B.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var U=/(.)^/,G={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},W=/\\|'|\r|\n|\u2028|\u2029/g,R=function(t){return"\\"+G[t]};B.template=function(t,e,n){!e&&n&&(e=n),e=B.defaults({},e,B.templateSettings);var r=RegExp([(e.escape||U).source,(e.interpolate||U).source,(e.evaluate||U).source].join("|")+"|$","g"),i=0,o="__p+='";t.replace(r,function(e,n,r,a,s){return o+=t.slice(i,s).replace(W,R),i=s+e.length,n?o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'":r?o+="'+\n((__t=("+r+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),e}),o+="';\n",e.variable||(o="with(obj||{}){\n"+o+"}\n"),o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{var a=new Function(e.variable||"obj","_",o)}catch(t){throw t.source=o,t}var s=function(t){return a.call(this,t,B)};return s.source="function("+(e.variable||"obj")+"){\n"+o+"}",s},B.chain=function(t){var e=B(t);return e._chain=!0,e};var Z=function(t,e){return t._chain?B(e).chain():e};B.mixin=function(t){B.each(B.functions(t),function(e){var n=B[e]=t[e];B.prototype[e]=function(){var t=[this._wrapped];return d.apply(t,arguments),Z(this,n.apply(B,t))}})},B.mixin(B),B.each(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=u[t];B.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0],Z(this,n)}}),B.each(["concat","join","slice"],function(t){var e=u[t];B.prototype[t]=function(){return Z(this,e.apply(this._wrapped,arguments))}}),B.prototype.value=function(){return this._wrapped},B.prototype.valueOf=B.prototype.toJSON=B.prototype.value,B.prototype.toString=function(){return""+this._wrapped},r=[],void 0!==(i=function(){return B}.apply(e,r))&&(t.exports=i)}).call(this)},function(t,e,n){"use strict";function r(t,e,n,a){function s(e){return t(e=new Date(+e)),e}return s.floor=s,s.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},s.round=function(t){var e=s(t),n=s.ceil(t);return t-e<n-t?e:n},s.offset=function(t,n){return e(t=new Date(+t),null==n?1:Math.floor(n)),t},s.range=function(n,r,i){var o,a=[];if(n=s.ceil(n),i=null==i?1:Math.floor(i),!(n<r&&i>0))return a;do{a.push(o=new Date(+n)),e(n,i),t(n)}while(o<n&&n<r);return a},s.filter=function(n){return r(function(e){if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)},function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););})},n&&(s.count=function(e,r){return i.setTime(+e),o.setTime(+r),t(i),t(o),Math.floor(n(i,o))},s.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?s.filter(a?function(e){return a(e)%t==0}:function(e){return s.count(0,e)%t==0}):s:null}),s}e.a=r;var i=new Date,o=new Date},function(t,e,n){"use strict";function r(){}function i(t,e){var n,i,o,a,s=L;for(a=arguments.length;a-- >2;)N.push(arguments[a]);for(e&&null!=e.children&&(N.length||N.push(e.children),delete e.children);N.length;)if((i=N.pop())&&void 0!==i.pop)for(a=i.length;a--;)N.push(i[a]);else"boolean"==typeof i&&(i=null),(o="function"!=typeof t)&&(null==i?i="":"number"==typeof i?i=String(i):"string"!=typeof i&&(o=!1)),o&&n?s[s.length-1]+=i:s===L?s=[i]:s.push(i),n=o;var A=new r;return A.nodeName=t,A.children=s,A.attributes=null==e?void 0:e,A.key=null==e?void 0:e.key,void 0!==j.vnode&&j.vnode(A),A}function o(t,e){for(var n in e)t[n]=e[n];return t}function a(t,e){return i(t.nodeName,o(o({},t.attributes),e),arguments.length>2?[].slice.call(arguments,2):t.children)}function s(t){!t._dirty&&(t._dirty=!0)&&1==F.push(t)&&(j.debounceRendering||T)(A)}function A(){var t,e=F;for(F=[];t=e.pop();)t._dirty&&I(t)}function c(t,e,n){return"string"==typeof e||"number"==typeof e?void 0!==t.splitText:"string"==typeof e.nodeName?!t._componentConstructor&&u(t,e.nodeName):n||t._componentConstructor===e.nodeName}function u(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function l(t){var e=o({},t.attributes);e.children=t.children;var n=t.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===e[r]&&(e[r]=n[r]);return e}function h(t,e){var n=e?document.createElementNS("http://www.w3.org/2000/svg",t):document.createElement(t);return n.normalizedNodeName=t,n}function d(t){var e=t.parentNode;e&&e.removeChild(t)}function f(t,e,n,r,i){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)n&&n(null),r&&r(t);else if("class"!==e||i)if("style"===e){if(r&&"string"!=typeof r&&"string"!=typeof n||(t.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var o in n)o in r||(t.style[o]="");for(var o in r)t.style[o]="number"==typeof r[o]&&!1===O.test(o)?r[o]+"px":r[o]}}else if("dangerouslySetInnerHTML"===e)r&&(t.innerHTML=r.__html||"");else if("o"==e[0]&&"n"==e[1]){var a=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),r?n||t.addEventListener(e,g,a):t.removeEventListener(e,g,a),(t._listeners||(t._listeners={}))[e]=r}else if("list"!==e&&"type"!==e&&!i&&e in t)p(t,e,null==r?"":r),null!=r&&!1!==r||t.removeAttribute(e);else{var s=i&&e!==(e=e.replace(/^xlink\:?/,""));null==r||!1===r?s?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof r&&(s?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),r):t.setAttribute(e,r))}else t.className=r||""}function p(t,e,n){try{t[e]=n}catch(t){}}function g(t){return this._listeners[t.type](j.event&&j.event(t)||t)}function v(){for(var t;t=z.pop();)j.afterMount&&j.afterMount(t),t.componentDidMount&&t.componentDidMount()}function b(t,e,n,r,i,o){Y++||(U=null!=i&&void 0!==i.ownerSVGElement,G=null!=t&&!("__preactattr_"in t));var a=m(t,e,n,r,o);return i&&a.parentNode!==i&&i.appendChild(a),--Y||(G=!1,o||v()),a}function m(t,e,n,r,i){var o=t,a=U;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||i)?t.nodeValue!=e&&(t.nodeValue=e):(o=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(o,t),_(t,!0))),o.__preactattr_=!0,o;var s=e.nodeName;if("function"==typeof s)return Q(t,e,n,r);if(U="svg"===s||"foreignObject"!==s&&U,s=String(s),(!t||!u(t,s))&&(o=h(s,U),t)){for(;t.firstChild;)o.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(o,t),_(t,!0)}var A=o.firstChild,c=o.__preactattr_,l=e.children;if(null==c){c=o.__preactattr_={};for(var d=o.attributes,f=d.length;f--;)c[d[f].name]=d[f].value}return!G&&l&&1===l.length&&"string"==typeof l[0]&&null!=A&&void 0!==A.splitText&&null==A.nextSibling?A.nodeValue!=l[0]&&(A.nodeValue=l[0]):(l&&l.length||null!=A)&&y(o,l,n,r,G||null!=c.dangerouslySetInnerHTML),w(o,e.attributes,c),U=a,o}function y(t,e,n,r,i){var o,a,s,A,u,l=t.childNodes,h=[],f={},p=0,g=0,v=l.length,b=0,y=e?e.length:0;if(0!==v)for(var B=0;B<v;B++){var w=l[B],C=w.__preactattr_,x=y&&C?w._component?w._component.__key:C.key:null;null!=x?(p++,f[x]=w):(C||(void 0!==w.splitText?!i||w.nodeValue.trim():i))&&(h[b++]=w)}if(0!==y)for(var B=0;B<y;B++){A=e[B],u=null;var x=A.key;if(null!=x)p&&void 0!==f[x]&&(u=f[x],f[x]=void 0,p--);else if(!u&&g<b)for(o=g;o<b;o++)if(void 0!==h[o]&&c(a=h[o],A,i)){u=a,h[o]=void 0,o===b-1&&b--,o===g&&g++;break}u=m(u,A,n,r),s=l[B],u&&u!==t&&u!==s&&(null==s?t.appendChild(u):u===s.nextSibling?d(s):t.insertBefore(u,s))}if(p)for(var B in f)void 0!==f[B]&&_(f[B],!1);for(;g<=b;)void 0!==(u=h[b--])&&_(u,!1)}function _(t,e){var n=t._component;n?D(n):(null!=t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),!1!==e&&null!=t.__preactattr_||d(t),B(t))}function B(t){for(t=t.lastChild;t;){var e=t.previousSibling;_(t,!0),t=e}}function w(t,e,n){var r;for(r in n)e&&null!=e[r]||null==n[r]||f(t,r,n[r],n[r]=void 0,U);for(r in e)"children"===r||"innerHTML"===r||r in n&&e[r]===("value"===r||"checked"===r?t[r]:n[r])||f(t,r,n[r],n[r]=e[r],U)}function C(t){var e=t.constructor.name;(W[e]||(W[e]=[])).push(t)}function x(t,e,n){var r,i=W[t.name];if(t.prototype&&t.prototype.render?(r=new t(e,n),k.call(r,e,n)):(r=new k(e,n),r.constructor=t,r.render=E),i)for(var o=i.length;o--;)if(i[o].constructor===t){r.nextBase=i[o].nextBase,i.splice(o,1);break}return r}function E(t,e,n){return this.constructor(t,n)}function M(t,e,n,r,i){t._disable||(t._disable=!0,(t.__ref=e.ref)&&delete e.ref,(t.__key=e.key)&&delete e.key,!t.base||i?t.componentWillMount&&t.componentWillMount():t.componentWillReceiveProps&&t.componentWillReceiveProps(e,r),r&&r!==t.context&&(t.prevContext||(t.prevContext=t.context),t.context=r),t.prevProps||(t.prevProps=t.props),t.props=e,t._disable=!1,0!==n&&(1!==n&&!1===j.syncComponentUpdates&&t.base?s(t):I(t,1,i)),t.__ref&&t.__ref(t))}function I(t,e,n,r){if(!t._disable){var i,a,s,A=t.props,c=t.state,u=t.context,h=t.prevProps||A,d=t.prevState||c,f=t.prevContext||u,p=t.base,g=t.nextBase,m=p||g,y=t._component,B=!1;if(p&&(t.props=h,t.state=d,t.context=f,2!==e&&t.shouldComponentUpdate&&!1===t.shouldComponentUpdate(A,c,u)?B=!0:t.componentWillUpdate&&t.componentWillUpdate(A,c,u),t.props=A,t.state=c,t.context=u),t.prevProps=t.prevState=t.prevContext=t.nextBase=null,t._dirty=!1,!B){i=t.render(A,c,u),t.getChildContext&&(u=o(o({},u),t.getChildContext()));var w,C,E=i&&i.nodeName;if("function"==typeof E){var Q=l(i);a=y,a&&a.constructor===E&&Q.key==a.__key?M(a,Q,1,u,!1):(w=a,t._component=a=x(E,Q,u),a.nextBase=a.nextBase||g,a._parentComponent=t,M(a,Q,0,u,!1),I(a,1,n,!0)),C=a.base}else s=m,w=y,w&&(s=t._component=null),(m||1===e)&&(s&&(s._component=null),C=b(s,i,u,n||!p,m&&m.parentNode,!0));if(m&&C!==m&&a!==y){var k=m.parentNode;k&&C!==k&&(k.replaceChild(C,m),w||(m._component=null,_(m,!1)))}if(w&&D(w),t.base=C,C&&!r){for(var S=t,N=t;N=N._parentComponent;)(S=N).base=C;C._component=S,C._componentConstructor=S.constructor}}if(!p||n?z.unshift(t):B||(t.componentDidUpdate&&t.componentDidUpdate(h,d,f),j.afterUpdate&&j.afterUpdate(t)),null!=t._renderCallbacks)for(;t._renderCallbacks.length;)t._renderCallbacks.pop().call(t);Y||r||v()}}function Q(t,e,n,r){for(var i=t&&t._component,o=i,a=t,s=i&&t._componentConstructor===e.nodeName,A=s,c=l(e);i&&!A&&(i=i._parentComponent);)A=i.constructor===e.nodeName;return i&&A&&(!r||i._component)?(M(i,c,3,n,r),t=i.base):(o&&!s&&(D(o),t=a=null),i=x(e.nodeName,c,n),t&&!i.nextBase&&(i.nextBase=t,a=null),M(i,c,1,n,r),t=i.base,a&&t!==a&&(a._component=null,_(a,!1))),t}function D(t){j.beforeUnmount&&j.beforeUnmount(t);var e=t.base;t._disable=!0,t.componentWillUnmount&&t.componentWillUnmount(),t.base=null;var n=t._component;n?D(n):e&&(e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),t.nextBase=e,d(e),C(t),B(e)),t.__ref&&t.__ref(null)}function k(t,e){this._dirty=!0,this.context=e,this.props=t,this.state=this.state||{}}function S(t,e,n){return b(n,t,{},!1,e,!1)}Object.defineProperty(e,"__esModule",{value:!0}),n.d(e,"h",function(){return i}),n.d(e,"createElement",function(){return i}),n.d(e,"cloneElement",function(){return a}),n.d(e,"Component",function(){return k}),n.d(e,"render",function(){return S}),n.d(e,"rerender",function(){return A}),n.d(e,"options",function(){return j});var j={},N=[],L=[],T="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,O=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,F=[],z=[],Y=0,U=!1,G=!1,W={};o(k.prototype,{setState:function(t,e){var n=this.state;this.prevState||(this.prevState=o({},n)),o(n,"function"==typeof t?t(n,this.props):t),e&&(this._renderCallbacks=this._renderCallbacks||[]).push(e),s(this)},forceUpdate:function(t){t&&(this._renderCallbacks=this._renderCallbacks||[]).push(t),I(this,2)},render:function(){}});var R={h:i,createElement:i,cloneElement:a,Component:k,render:S,rerender:A,options:j};e.default=R},function(t,e,n){"use strict";function r(t,e){var n=o(t,e);if(n.state>l)throw new Error("too late; already scheduled");return n}function i(t,e){var n=o(t,e);if(n.state>f)throw new Error("too late; already running");return n}function o(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function a(t,e,n){function r(t){n.state=h,n.timer.restart(i,n.delay,n.time),n.delay<=t&&i(t-n.delay)}function i(r){var u,l,g,b;if(n.state!==h)return a();for(u in c)if(b=c[u],b.name===n.name){if(b.state===f)return Object(A.b)(i);b.state===p?(b.state=v,b.timer.stop(),b.on.call("interrupt",t,t.__data__,b.index,b.group),delete c[u]):+u<e&&(b.state=v,b.timer.stop(),b.on.call("cancel",t,t.__data__,b.index,b.group),delete c[u])}if(Object(A.b)(function(){n.state===f&&(n.state=p,n.timer.restart(o,n.delay,n.time),o(r))}),n.state=d,n.on.call("start",t,t.__data__,n.index,n.group),n.state===d){for(n.state=f,s=new Array(g=n.tween.length),u=0,l=-1;u<g;++u)(b=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(s[++l]=b);s.length=l+1}}function o(e){for(var r=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(a),n.state=g,1),i=-1,o=s.length;++i<o;)s[i].call(t,r);n.state===g&&(n.on.call("end",t,t.__data__,n.index,n.group),a())}function a(){n.state=v,n.timer.stop(),delete c[e];for(var r in c)return;delete t.__transition}var s,c=t.__transition;c[e]=n,n.timer=Object(A.c)(r,0,n.time)}n.d(e,"c",function(){return h}),n.d(e,"d",function(){return d}),n.d(e,"b",function(){return g}),n.d(e,"a",function(){return v}),e.g=r,e.h=i,e.f=o;var s=n(20),A=n(83),c=Object(s.a)("start","end","cancel","interrupt"),u=[],l=0,h=1,d=2,f=3,p=4,g=5,v=6;e.e=function(t,e,n,r,i,o){var s=t.__transition;if(s){if(n in s)return}else t.__transition={};a(t,n,{name:e,index:r,group:i,on:c,tween:u,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:l})}},function(t,e,n){"use strict";function r(t,e){this._groups=t,this._parents=e}function i(){return new r([[document.documentElement]],N)}n.d(e,"c",function(){return N}),e.a=r;var o=n(136),a=n(137),s=n(138),A=n(139),c=n(62),u=n(141),l=n(142),h=n(143),d=n(144),f=n(145),p=n(146),g=n(147),v=n(148),b=n(149),m=n(150),y=n(151),_=n(64),B=n(152),w=n(153),C=n(154),x=n(155),E=n(156),M=n(157),I=n(158),Q=n(159),D=n(160),k=n(161),S=n(40),j=n(162),N=[null];r.prototype=i.prototype={constructor:r,select:o.a,selectAll:a.a,filter:s.a,data:A.a,enter:c.b,exit:u.a,merge:l.a,order:h.a,sort:d.a,call:f.a,nodes:p.a,node:g.a,size:v.a,empty:b.a,each:m.a,attr:y.a,style:_.a,property:B.a,classed:w.a,text:C.a,html:x.a,raise:E.a,lower:M.a,append:I.a,insert:Q.a,remove:D.a,datum:k.a,on:S.b,dispatch:j.a},e.b=i},function(t,e){function n(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"==typeof btoa){var o=r(i);return[n].concat(i.sources.map(function(t){return"/*# sourceURL="+i.sourceRoot+t+" */"})).concat([o]).join("\n")}return[n].join("\n")}function r(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var r=n(e,t);return e[2]?"@media "+e[2]+"{"+r+"}":r}).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<t.length;i++){var a=t[i];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),e.push(a))}},e}},function(t,e,n){function r(t,e){for(var n=0;n<t.length;n++){var r=t[n],i=f[r.id];if(i){i.refs++;for(var o=0;o<i.parts.length;o++)i.parts[o](r.parts[o]);for(;o<r.parts.length;o++)i.parts.push(u(r.parts[o],e))}else{for(var a=[],o=0;o<r.parts.length;o++)a.push(u(r.parts[o],e));f[r.id]={id:r.id,refs:1,parts:a}}}}function i(t,e){for(var n=[],r={},i=0;i<t.length;i++){var o=t[i],a=e.base?o[0]+e.base:o[0],s=o[1],A=o[2],c=o[3],u={css:s,media:A,sourceMap:c};r[a]?r[a].parts.push(u):n.push(r[a]={id:a,parts:[u]})}return n}function o(t,e){var n=g(t.insertInto);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var r=m[m.length-1];if("top"===t.insertAt)r?r.nextSibling?n.insertBefore(e,r.nextSibling):n.appendChild(e):n.insertBefore(e,n.firstChild),m.push(e);else{if("bottom"!==t.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");n.appendChild(e)}}function a(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t);var e=m.indexOf(t);e>=0&&m.splice(e,1)}function s(t){var e=document.createElement("style");return t.attrs.type="text/css",c(e,t.attrs),o(t,e),e}function A(t){var e=document.createElement("link");return t.attrs.type="text/css",t.attrs.rel="stylesheet",c(e,t.attrs),o(t,e),e}function c(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})}function u(t,e){var n,r,i,o;if(e.transform&&t.css){if(!(o=e.transform(t.css)))return function(){};t.css=o}if(e.singleton){var c=b++;n=v||(v=s(e)),r=l.bind(null,n,c,!1),i=l.bind(null,n,c,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=A(e),r=d.bind(null,n,e),i=function(){a(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(e),r=h.bind(null,n),i=function(){a(n)});return r(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;r(t=e)}else i()}}function l(t,e,n,r){var i=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=_(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function h(t,e){var n=e.css,r=e.media;if(r&&t.setAttribute("media",r),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}function d(t,e,n){var r=n.css,i=n.sourceMap,o=void 0===e.convertToAbsoluteUrls&&i;(e.convertToAbsoluteUrls||o)&&(r=y(r)),i&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */");var a=new Blob([r],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}var f={},p=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}}(function(){return window&&document&&document.all&&!window.atob}),g=function(t){var e={};return function(n){return void 0===e[n]&&(e[n]=t.call(this,n)),e[n]}}(function(t){return document.querySelector(t)}),v=null,b=0,m=[],y=n(305);t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");e=e||{},e.attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||(e.singleton=p()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=i(t,e);return r(n,e),function(t){for(var o=[],a=0;a<n.length;a++){var s=n[a],A=f[s.id];A.refs--,o.push(A)}if(t){r(i(t,e),e)}for(var a=0;a<o.length;a++){var A=o[a];if(0===A.refs){for(var c=0;c<A.parts.length;c++)A.parts[c]();delete f[A.id]}}}};var _=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}()},function(t,e,n){"use strict";var r=n(46);n.d(e,"a",function(){return r.a});var i=(n(77),n(49),n(75),n(78),n(187),n(188),n(29));n.d(e,"c",function(){return i.a});var o=(n(79),n(189));n.d(e,"e",function(){return o.a});var a=n(80);n.d(e,"f",function(){return a.a});var s=n(190);n.d(e,"g",function(){return s.a}),n.d(e,"h",function(){return s.b});var A=n(193);n.d(e,"i",function(){return A.a});var c=n(74);n.d(e,"d",function(){return c.a});var u=(n(194),n(195),n(196),n(197));n.d(e,"b",function(){return u.a});n(198),n(199)},function(t,e,n){"use strict";var r=n(47);n.d(e,"a",function(){return r.e}),n.d(e,"f",function(){return r.g}),n.d(e,"d",function(){return r.f});var i=n(185);n.d(e,"e",function(){return i.a}),n.d(e,"c",function(){return i.b});var o=n(186);n.d(e,"b",function(){return o.a})},function(t,e,n){"use strict";var r=n(89);n.d(e,"b",function(){return r.a});var i=n(19);n.d(e,"a",function(){return i.a});var o=n(90);n.d(e,"c",function(){return o.a});var a=(n(241),n(242),n(92),n(94),n(243),n(246),n(247),n(98),n(248),n(249),n(250),n(251),n(99),n(91),n(252),n(51));n.d(e,"d",function(){return a.a});var s=n(96);n.d(e,"e",function(){return s.a});var A=(n(253),n(254),n(255),n(97));n.d(e,"h",function(){return A.a}),n.d(e,"f",function(){return A.b}),n.d(e,"g",function(){return A.c});n(100),n(93),n(256)},function(t,e,n){"use strict";n.d(e,"d",function(){return r}),n.d(e,"c",function(){return i}),n.d(e,"b",function(){return o}),n.d(e,"a",function(){return a}),n.d(e,"e",function(){return s});var r=1e3,i=6e4,o=36e5,a=864e5,s=6048e5},function(t,e,n){"use strict";function r(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function i(t){return Object(a.selection)().transition(t)}function o(){return++x}e.a=r,e.b=o;var a=n(0),s=n(205),A=n(206),c=n(207),u=n(208),l=n(209),h=n(210),d=n(211),f=n(212),p=n(213),g=n(214),v=n(215),b=n(216),m=n(217),y=n(218),_=n(219),B=n(220),w=n(30),C=n(221),x=0,E=a.selection.prototype;r.prototype=i.prototype={constructor:r,select:g.a,selectAll:v.a,filter:h.a,merge:d.a,selection:b.a,transition:B.a,call:E.call,nodes:E.nodes,node:E.node,size:E.size,empty:E.empty,each:E.each,on:f.a,attr:s.a,attrTween:A.a,style:m.a,styleTween:y.a,text:_.a,remove:p.a,tween:w.a,delay:c.a,duration:u.a,ease:l.a,end:C.a}},function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"b",function(){return o});var r=Array.prototype,i=r.map,o=r.slice},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(170);n.d(e,"drag",function(){return r.a});var i=n(67);n.d(e,"dragDisable",function(){return i.a}),n.d(e,"dragEnable",function(){return i.b})},function(t,e,n){"use strict";function r(t){var e=Number(t);return isNaN(e)||parseFloat(t)!==e?null:e}function i(t,e){var n={},r=[null];for(var i in t){r=t[i].map(function(){return null});break}for(var o in e)!function(i){var o=e[i],a=o.bigg_id,s={};o.genes.forEach(function(e){["bigg_id","name"].forEach(function(n){var i=t[e[n]]||w.clone(r),o=s[e.bigg_id];if(void 0===o)s[e.bigg_id]=i;else for(var a=0;a<i.length;a++){var A=i[a];null!==A&&(o[a]=A)}})}),n[a]=s}(o);return n}function o(t){return isFinite(t)?t:null}function a(t,e){return e?Math.abs(t):t}function s(t,e,n){return n?Math.abs(e-t):e-t}function A(t,e,n){if(0===t||0===e)return null;var r=e>=t?e/t:-t/e;return n?Math.abs(r):r}function c(t,e,n){if(0===t)return null;if(e/t<0)return null;var r=Math.log(e/t)/Math.log(2);return n?Math.abs(r):r}function u(t,e,n){if(!t)return null;if(-1===["reaction_data","metabolite_data","gene_data"].indexOf(e))throw new Error("Invalid name argument: "+e);t instanceof Array||(t=[t]);if(function(){null===t||(1===t.length||(2===t.length||console.warn("Bad data style: "+e)))}(),t=w.arrayToObject(t),"gene_data"===e){if(void 0===n)throw new Error("Must pass all_reactions argument for gene_data");t=i(t,n)}return t}function l(t,e,n){if(null===t)return null;var i=-1!==e.indexOf("abs");if(1===t.length){var u=r(t[0]);return null===u?null:a(u,i)}if(2!==t.length)throw new Error("Data array must be of length 1 or 2");var l=t.map(r);if(null===l[0]||null===l[1])return null;if("diff"===n)return s(l[0],l[1],i);if("fold"===n)return o(A(l[0],l[1],i));if("log2_fold"===n)return o(c(l[0],l[1],i));throw new Error("Bad data compare_style: "+n)}function h(t){return null!==t&&null!==t[0]&&t[0]<0}function d(t,e,n,i,o,a){function s(t,e){return null===t?"nd":e(t)}var A=t,c=null===e,u={};return n.forEach(function(t){var n=t.bigg_id;if(!(n in u))if(u[n]=!0,c)A=b(A,n,n+"\n");else{if(!(n in e))return;var o=e[n],h=l(o,i,a),d=null===h?M:(0,E.format)(".3g");if(1===o.length)A=b(A,n,n+" ("+s(o[0],d)+")\n");else if(2===o.length){var f,p=x.default.any(o,function(t){return null!==r(t)});f=p?n+" ("+s(o[0],d)+", "+s(o[1],d)+": "+s(h,d)+")\n":n+" ("+s(o[0],d)+", "+s(o[1],d)+")\n",A=b(A,n,f)}}}),A=A.replace(Q,"\n").replace(D,"$1"),A.split("\n").map(function(t)