-
-
Notifications
You must be signed in to change notification settings - Fork 193
/
async-ideogram.js
3 lines (3 loc) · 240 KB
/
async-ideogram.js
1
2
3
/*! For license information please see async-ideogram.js.LICENSE.txt */
(self.webpackChunkdash_bio=self.webpackChunkdash_bio||[]).push([[557],{1830:function(t){function n(t,n,e,r,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void e(t)}s.done?n(c):Promise.resolve(c).then(r,o)}function e(t){return function(){var e=this,r=arguments;return new Promise((function(o,i){var a=t.apply(e,r);function s(t){n(a,o,i,s,c,"next",t)}function c(t){n(a,o,i,s,c,"throw",t)}s(void 0)}))}}function r(t){return function(t){if(Array.isArray(t))return g(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||p(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;c=!1}else for(;!(c=(r=i.call(e)).done)&&(s.push(r.value),s.length!==n);c=!0);}catch(t){l=!0,o=t}finally{try{if(!c&&null!=e.return&&(a=e.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,n)||p(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&a(t,n)}function a(t,n){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},a(t,n)}function s(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var e,r=l(t);if(n){var o=l(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return c(this,e)}}function c(t,n){if(n&&("object"==typeof n||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}function u(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function h(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(o=function(t,n){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key))?o:String(o)),r)}var o}function f(t,n,e){return n&&h(t.prototype,n),e&&h(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function d(){"use strict";d=function(){return t};var t={},n=Object.prototype,e=n.hasOwnProperty,r=Object.defineProperty||function(t,n,e){t[n]=e.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,n,e){return Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{c({},"")}catch(t){c=function(t,n,e){return t[n]=e}}function l(t,n,e,o){var i=n&&n.prototype instanceof f?n:f,a=Object.create(i.prototype),s=new T(o||[]);return r(a,"_invoke",{value:_(t,e,s)}),a}function u(t,n,e){try{return{type:"normal",arg:t.call(n,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var h={};function f(){}function m(){}function p(){}var g={};c(g,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(L([])));y&&y!==n&&e.call(y,i)&&(g=y);var b=p.prototype=f.prototype=Object.create(g);function w(t){["next","throw","return"].forEach((function(n){c(t,n,(function(t){return this._invoke(n,t)}))}))}function x(t,n){function o(r,i,a,s){var c=u(t[r],t,i);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==typeof h&&e.call(h,"__await")?n.resolve(h.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):n.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;r(this,"_invoke",{value:function(t,e){function r(){return new n((function(n,r){o(t,e,n,r)}))}return i=i?i.then(r,r):r()}})}function _(t,n,e){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(e.method=o,e.arg=i;;){var a=e.delegate;if(a){var s=A(a,e);if(s){if(s===h)continue;return s}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===r)throw r="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);r="executing";var c=u(t,n,e);if("normal"===c.type){if(r=e.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:e.done}}"throw"===c.type&&(r="completed",e.method="throw",e.arg=c.arg)}}}function A(t,n){var e=n.method,r=t.iterator[e];if(void 0===r)return n.delegate=null,"throw"===e&&t.iterator.return&&(n.method="return",n.arg=void 0,A(t,n),"throw"===n.method)||"return"!==e&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+e+"' method")),h;var o=u(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,h;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function k(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function C(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function L(t){if(t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function n(){for(;++r<t.length;)if(e.call(t,r))return n.value=t[r],n.done=!1,n;return n.value=void 0,n.done=!0,n};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return m.prototype=p,r(b,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:m,configurable:!0}),m.displayName=c(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===m||"GeneratorFunction"===(n.displayName||n.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,s,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},w(x.prototype),c(x.prototype,a,(function(){return this})),t.AsyncIterator=x,t.async=function(n,e,r,o,i){void 0===i&&(i=Promise);var a=new x(l(n,e,r,o),i);return t.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(b),c(b,s,"Generator"),c(b,i,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var n=Object(t),e=[];for(var r in n)e.push(r);return e.reverse(),function t(){for(;e.length;){var r=e.pop();if(r in n)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=L,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!t)for(var n in this)"t"===n.charAt(0)&&e.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(e,r){return a.type="throw",a.arg=t,n.next=e,r&&(n.method="next",n.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=e.call(i,"catchLoc"),c=e.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,n){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&e.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=n,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),h},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),C(e),h}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.tryLoc===t){var r=e.completion;if("throw"===r.type){var o=r.arg;C(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,e){return this.delegate={iterator:L(t),resultName:n,nextLoc:e},"next"===this.method&&(this.arg=void 0),h}},t}function m(t,n){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=p(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==e.return||e.return()}finally{if(s)throw i}}}}function p(t,n){if(t){if("string"==typeof t)return g(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?g(t,n):void 0}}function g(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}self,t.exports=function(){"use strict";var t={d:function(n,e){for(var r in e)t.o(e,r)&&!t.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:e[r]})},o:function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};t.r(n),t.d(n,{default:function(){return Cl}});var a={};t.r(a),t.d(a,{blob:function(){return Et},buffer:function(){return Bt},csv:function(){return Qt},dsv:function(){return Vt},html:function(){return en},image:function(){return Jt},json:function(){return Zt},svg:function(){return rn},text:function(){return Xt},tsv:function(){return $t},xml:function(){return nn}});var c={};t.r(c),t.d(c,{brush:function(){return Ur},brushSelection:function(){return qr},brushX:function(){return Yr},brushY:function(){return Xr}});var l={};t.r(l),t.d(l,{dispatch:function(){return hn}});var h={};t.r(h),t.d(h,{FormatSpecifier:function(){return to},format:function(){return io},formatDefaultLocale:function(){return uo},formatLocale:function(){return lo},formatPrefix:function(){return ao},formatSpecifier:function(){return Zr},precisionFixed:function(){return ho},precisionPrefix:function(){return fo},precisionRound:function(){return mo}});var p={};function g(){}function v(t){return null==t?g:function(){return this.querySelector(t)}}function y(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function b(){return[]}function w(t){return null==t?b:function(){return this.querySelectorAll(t)}}function x(t){return function(){return this.matches(t)}}function _(t){return function(n){return n.matches(t)}}t.r(p),t.d(p,{ZoomTransform:function(){return bo},zoom:function(){return Po},zoomIdentity:function(){return wo},zoomTransform:function(){return xo}});var A=Array.prototype.find;function k(){return this.firstElementChild}var C=Array.prototype.filter;function T(){return this.children}function L(t){return new Array(t.length)}function S(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function M(t){return function(){return t}}function P(t,n,e,r,o,i){for(var a,s=0,c=n.length,l=i.length;s<l;++s)(a=n[s])?(a.__data__=i[s],r[s]=a):e[s]=new S(t,i[s]);for(;s<c;++s)(a=n[s])&&(o[s]=a)}function N(t,n,e,r,o,i,a){var s,c,l,u=new Map,h=n.length,f=i.length,d=new Array(h);for(s=0;s<h;++s)(c=n[s])&&(d[s]=l=a.call(c,c.__data__,s,n)+"",u.has(l)?o[s]=c:u.set(l,c));for(s=0;s<f;++s)l=a.call(t,i[s],s,i)+"",(c=u.get(l))?(r[s]=c,c.__data__=i[s],u.delete(l)):e[s]=new S(t,i[s]);for(s=0;s<h;++s)(c=n[s])&&u.get(d[s])===c&&(o[s]=c)}function E(t){return t.__data__}function I(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}S.prototype={constructor:S,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var B="http://www.w3.org/1999/xhtml",D={svg:"http://www.w3.org/2000/svg",xhtml:B,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function F(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),D.hasOwnProperty(n)?{space:D[n],local:t}:t}function O(t){return function(){this.removeAttribute(t)}}function R(t){return function(){this.removeAttributeNS(t.space,t.local)}}function j(t,n){return function(){this.setAttribute(t,n)}}function z(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function H(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function G(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function W(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function q(t){return function(){this.style.removeProperty(t)}}function Y(t,n,e){return function(){this.style.setProperty(t,n,e)}}function X(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function U(t,n){return t.style.getPropertyValue(n)||W(t).getComputedStyle(t,null).getPropertyValue(n)}function V(t){return function(){delete this[t]}}function Q(t,n){return function(){this[t]=n}}function $(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function J(t){return t.trim().split(/^|\s+/)}function K(t){return t.classList||new Z(t)}function Z(t){this._node=t,this._names=J(t.getAttribute("class")||"")}function tt(t,n){for(var e=K(t),r=-1,o=n.length;++r<o;)e.add(n[r])}function nt(t,n){for(var e=K(t),r=-1,o=n.length;++r<o;)e.remove(n[r])}function et(t){return function(){tt(this,t)}}function rt(t){return function(){nt(this,t)}}function ot(t,n){return function(){(n.apply(this,arguments)?tt:nt)(this,t)}}function it(){this.textContent=""}function at(t){return function(){this.textContent=t}}function st(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function ct(){this.innerHTML=""}function lt(t){return function(){this.innerHTML=t}}function ut(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function ht(){this.nextSibling&&this.parentNode.appendChild(this)}function ft(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function dt(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===B&&n.documentElement.namespaceURI===B?n.createElement(t):n.createElementNS(e,t)}}function mt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function pt(t){var n=F(t);return(n.local?mt:dt)(n)}function gt(){return null}function vt(){var t=this.parentNode;t&&t.removeChild(this)}function yt(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function bt(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function wt(t){return t.trim().split(/^|\s+/).map((function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}function xt(t){return function(){var n=this.__on;if(n){for(var e,r=0,o=-1,i=n.length;r<i;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++o]=e:this.removeEventListener(e.type,e.listener,e.options);++o?n.length=o:delete this.__on}}}function _t(t,n,e){return function(){var r,o=this.__on,i=function(t){return function(n){t.call(this,n,this.__data__)}}(n);if(o)for(var a=0,s=o.length;a<s;++a)if((r=o[a]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=e),void(r.value=n);this.addEventListener(t.type,i,e),r={type:t.type,name:t.name,value:n,listener:i,options:e},o?o.push(r):this.__on=[r]}}function At(t,n,e){var r=W(t),o=r.CustomEvent;"function"==typeof o?o=new o(n,e):(o=r.document.createEvent("Event"),e?(o.initEvent(n,e.bubbles,e.cancelable),o.detail=e.detail):o.initEvent(n,!1,!1)),t.dispatchEvent(o)}function kt(t,n){return function(){return At(this,t,n)}}function Ct(t,n){return function(){return At(this,t,n.apply(this,arguments))}}Z.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Tt=[null];function Lt(t,n){this._groups=t,this._parents=n}function St(){return new Lt([[document.documentElement]],Tt)}Lt.prototype=St.prototype={constructor:Lt,select:function(t){"function"!=typeof t&&(t=v(t));for(var n=this._groups,e=n.length,r=new Array(e),o=0;o<e;++o)for(var i,a,s=n[o],c=s.length,l=r[o]=new Array(c),u=0;u<c;++u)(i=s[u])&&(a=t.call(i,i.__data__,u,s))&&("__data__"in i&&(a.__data__=i.__data__),l[u]=a);return new Lt(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);return null==n?[]:y(n)}}(t):w(t);for(var n=this._groups,e=n.length,r=[],o=[],i=0;i<e;++i)for(var a,s=n[i],c=s.length,l=0;l<c;++l)(a=s[l])&&(r.push(t.call(a,a.__data__,l,s)),o.push(a));return new Lt(r,o)},selectChild:function(t){return this.select(null==t?k:function(t){return function(){return A.call(this.children,t)}}("function"==typeof t?t:_(t)))},selectChildren:function(t){return this.selectAll(null==t?T:function(t){return function(){return C.call(this.children,t)}}("function"==typeof t?t:_(t)))},filter:function(t){"function"!=typeof t&&(t=x(t));for(var n=this._groups,e=n.length,r=new Array(e),o=0;o<e;++o)for(var i,a=n[o],s=a.length,c=r[o]=[],l=0;l<s;++l)(i=a[l])&&t.call(i,i.__data__,l,a)&&c.push(i);return new Lt(r,this._parents)},data:function(t,n){if(!arguments.length)return Array.from(this,E);var e=n?N:P,r=this._parents,o=this._groups;"function"!=typeof t&&(t=M(t));for(var i=o.length,a=new Array(i),s=new Array(i),c=new Array(i),l=0;l<i;++l){var u=r[l],h=o[l],f=h.length,d=y(t.call(u,u&&u.__data__,l,r)),m=d.length,p=s[l]=new Array(m),g=a[l]=new Array(m);e(u,h,p,g,c[l]=new Array(f),d,n);for(var v,b,w=0,x=0;w<m;++w)if(v=p[w]){for(w>=x&&(x=w+1);!(b=g[x])&&++x<m;);v._next=b||null}}return(a=new Lt(a,r))._enter=s,a._exit=c,a},enter:function(){return new Lt(this._enter||this._groups.map(L),this._parents)},exit:function(){return new Lt(this._exit||this._groups.map(L),this._parents)},join:function(t,n,e){var r=this.enter(),o=this,i=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(o=n(o)),null==e?i.remove():e(i),r&&o?r.merge(o).order():o},merge:function(t){if(!(t instanceof Lt))throw new Error("invalid merge");for(var n=this._groups,e=t._groups,r=n.length,o=e.length,i=Math.min(r,o),a=new Array(r),s=0;s<i;++s)for(var c,l=n[s],u=e[s],h=l.length,f=a[s]=new Array(h),d=0;d<h;++d)(c=l[d]||u[d])&&(f[d]=c);for(;s<r;++s)a[s]=n[s];return new Lt(a,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,o=t[n],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=I);for(var e=this._groups,r=e.length,o=new Array(r),i=0;i<r;++i){for(var a,s=e[i],c=s.length,l=o[i]=new Array(c),u=0;u<c;++u)(a=s[u])&&(l[u]=a);l.sort(n)}return new Lt(o,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){var t,n=0,e=m(this);try{for(e.s();!(t=e.n()).done;)t.value,++n}catch(t){e.e(t)}finally{e.f()}return n},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var o,i=n[e],a=0,s=i.length;a<s;++a)(o=i[a])&&t.call(o,o.__data__,a,i);return this},attr:function(t,n){var e=F(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?R:O:"function"==typeof n?e.local?G:H:e.local?z:j)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?q:"function"==typeof n?X:Y)(t,n,null==e?"":e)):U(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?V:"function"==typeof n?$:Q)(t,n)):this.node()[t]},classed:function(t,n){var e=J(t+"");if(arguments.length<2){for(var r=K(this.node()),o=-1,i=e.length;++o<i;)if(!r.contains(e[o]))return!1;return!0}return this.each(("function"==typeof n?ot:n?et:rt)(e,n))},text:function(t){return arguments.length?this.each(null==t?it:("function"==typeof t?st:at)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?ct:("function"==typeof t?ut:lt)(t)):this.node().innerHTML},raise:function(){return this.each(ht)},lower:function(){return this.each(ft)},append:function(t){var n="function"==typeof t?t:pt(t);return this.select((function(){return this.appendChild(n.apply(this,arguments))}))},insert:function(t,n){var e="function"==typeof t?t:pt(t),r=null==n?gt:"function"==typeof n?n:v(n);return this.select((function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(vt)},clone:function(t){return this.select(t?bt:yt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,o,i=wt(t+""),a=i.length;if(!(arguments.length<2)){for(s=n?_t:xt,r=0;r<a;++r)this.each(s(i[r],n,e));return this}var s=this.node().__on;if(s)for(var c,l=0,u=s.length;l<u;++l)for(r=0,c=s[l];r<a;++r)if((o=i[r]).type===c.type&&o.name===c.name)return c.value},dispatch:function(t,n){return this.each(("function"==typeof n?Ct:kt)(t,n))},[Symbol.iterator]:d().mark((function t(){var n,e,r,o,i,a,s;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=this._groups,e=0,r=n.length;case 1:if(!(e<r)){t.next=14;break}i=n[e],a=0,s=i.length;case 3:if(!(a<s)){t.next=11;break}if(t.t0=o=i[a],!t.t0){t.next=8;break}return t.next=8,o;case 8:++a,t.next=3;break;case 11:++e,t.next=1;break;case 14:case"end":return t.stop()}}),t,this)}))};var Mt=St;function Pt(t){return"string"==typeof t?new Lt([[document.querySelector(t)]],[document.documentElement]):new Lt([[t]],Tt)}function Nt(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.blob()}function Et(t,n){return fetch(t,n).then(Nt)}function It(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.arrayBuffer()}function Bt(t,n){return fetch(t,n).then(It)}var Dt={},Ft={};function Ot(t){return new Function("d","return {"+t.map((function(t,n){return JSON.stringify(t)+": d["+n+'] || ""'})).join(",")+"}")}function Rt(t){var n=Object.create(null),e=[];return t.forEach((function(t){for(var r in t)r in n||e.push(n[r]=r)})),e}function jt(t,n){var e=t+"",r=e.length;return r<n?new Array(n-r+1).join(0)+e:e}function zt(t){var n=new RegExp('["'+t+"\n\r]"),e=t.charCodeAt(0);function r(t,n){var r,o=[],i=t.length,a=0,s=0,c=i<=0,l=!1;function u(){if(c)return Ft;if(l)return l=!1,Dt;var n,r,o=a;if(34===t.charCodeAt(o)){for(;a++<i&&34!==t.charCodeAt(a)||34===t.charCodeAt(++a););return(n=a)>=i?c=!0:10===(r=t.charCodeAt(a++))?l=!0:13===r&&(l=!0,10===t.charCodeAt(a)&&++a),t.slice(o+1,n-1).replace(/""/g,'"')}for(;a<i;){if(10===(r=t.charCodeAt(n=a++)))l=!0;else if(13===r)l=!0,10===t.charCodeAt(a)&&++a;else if(r!==e)continue;return t.slice(o,n)}return c=!0,t.slice(o,i)}for(10===t.charCodeAt(i-1)&&--i,13===t.charCodeAt(i-1)&&--i;(r=u())!==Ft;){for(var h=[];r!==Dt&&r!==Ft;)h.push(r),r=u();n&&null==(h=n(h,s++))||o.push(h)}return o}function o(n,e){return n.map((function(n){return e.map((function(t){return a(n[t])})).join(t)}))}function i(n){return n.map(a).join(t)}function a(t){return null==t?"":t instanceof Date?function(t){var n,e=t.getUTCHours(),r=t.getUTCMinutes(),o=t.getUTCSeconds(),i=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":((n=t.getUTCFullYear())<0?"-"+jt(-n,6):n>9999?"+"+jt(n,6):jt(n,4))+"-"+jt(t.getUTCMonth()+1,2)+"-"+jt(t.getUTCDate(),2)+(i?"T"+jt(e,2)+":"+jt(r,2)+":"+jt(o,2)+"."+jt(i,3)+"Z":o?"T"+jt(e,2)+":"+jt(r,2)+":"+jt(o,2)+"Z":r||e?"T"+jt(e,2)+":"+jt(r,2)+"Z":"")}(t):n.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t}return{parse:function(t,n){var e,o,i=r(t,(function(t,r){if(e)return e(t,r-1);o=t,e=n?function(t,n){var e=Ot(t);return function(r,o){return n(e(r),o,t)}}(t,n):Ot(t)}));return i.columns=o||[],i},parseRows:r,format:function(n,e){return null==e&&(e=Rt(n)),[e.map(a).join(t)].concat(o(n,e)).join("\n")},formatBody:function(t,n){return null==n&&(n=Rt(t)),o(t,n).join("\n")},formatRows:function(t){return t.map(i).join("\n")},formatRow:i,formatValue:a}}var Ht=zt(","),Gt=Ht.parse,Wt=(Ht.parseRows,Ht.format,Ht.formatBody,Ht.formatRows,Ht.formatRow,Ht.formatValue,zt("\t")),qt=Wt.parse;function Yt(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);return t.text()}function Xt(t,n){return fetch(t,n).then(Yt)}function Ut(t){return function(n,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=void 0),Xt(n,e).then((function(n){return t(n,r)}))}}function Vt(t,n,e,r){3===arguments.length&&"function"==typeof e&&(r=e,e=void 0);var o=zt(t);return Xt(n,e).then((function(t){return o.parse(t,r)}))}Wt.parseRows,Wt.format,Wt.formatBody,Wt.formatRows,Wt.formatRow,Wt.formatValue;var Qt=Ut(Gt),$t=Ut(qt);function Jt(t,n){return new Promise((function(e,r){var o=new Image;for(var i in n)o[i]=n[i];o.onerror=r,o.onload=function(){e(o)},o.src=t}))}function Kt(t){if(!t.ok)throw new Error(t.status+" "+t.statusText);if(204!==t.status&&205!==t.status)return t.json()}function Zt(t,n){return fetch(t,n).then(Kt)}function tn(t){return function(n,e){return Xt(n,e).then((function(n){return(new DOMParser).parseFromString(n,t)}))}}var nn=tn("application/xml"),en=tn("text/html"),rn=tn("image/svg+xml"),on={value:function(){}};function an(){for(var t,n=0,e=arguments.length,r={};n<e;++n){if(!(t=arguments[n]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new sn(r)}function sn(t){this._=t}function cn(t,n){return t.trim().split(/^|\s+/).map((function(t){var e="",r=t.indexOf(".");if(r>=0&&(e=t.slice(r+1),t=t.slice(0,r)),t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}function ln(t,n){for(var e,r=0,o=t.length;r<o;++r)if((e=t[r]).name===n)return e.value}function un(t,n,e){for(var r=0,o=t.length;r<o;++r)if(t[r].name===n){t[r]=on,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=e&&t.push({name:n,value:e}),t}sn.prototype=an.prototype={constructor:sn,on:function(t,n){var e,r=this._,o=cn(t+"",r),i=-1,a=o.length;if(!(arguments.length<2)){if(null!=n&&"function"!=typeof n)throw new Error("invalid callback: "+n);for(;++i<a;)if(e=(t=o[i]).type)r[e]=un(r[e],t.name,n);else if(null==n)for(e in r)r[e]=un(r[e],t.name,null);return this}for(;++i<a;)if((e=(t=o[i]).type)&&(e=ln(r[e],t.name)))return e},copy:function(){var t={},n=this._;for(var e in n)t[e]=n[e].slice();return new sn(t)},call:function(t,n){if((e=arguments.length-2)>0)for(var e,r,o=new Array(e),i=0;i<e;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(i=0,e=(r=this._[t]).length;i<e;++i)r[i].value.apply(n,o)},apply:function(t,n,e){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],o=0,i=r.length;o<i;++o)r[o].value.apply(n,e)}};var hn=an;function fn(t){t.preventDefault(),t.stopImmediatePropagation()}function dn(t){var n=t.document.documentElement,e=Pt(t).on("dragstart.drag",fn,!0);"onselectstart"in n?e.on("selectstart.drag",fn,!0):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function mn(t,n){var e=t.document.documentElement,r=Pt(t).on("dragstart.drag",null);n&&(r.on("click.drag",fn,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in e?r.on("selectstart.drag",null):(e.style.MozUserSelect=e.__noselect,delete e.__noselect)}function pn(t,n,e){t.prototype=n.prototype=e,e.constructor=t}function gn(t,n){var e=Object.create(t.prototype);for(var r in n)e[r]=n[r];return e}function vn(){}var yn=.7,bn=1/yn,wn="\\s*([+-]?\\d+)\\s*",xn="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",_n="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",An=/^#([0-9a-f]{3,8})$/,kn=new RegExp("^rgb\\("+[wn,wn,wn]+"\\)$"),Cn=new RegExp("^rgb\\("+[_n,_n,_n]+"\\)$"),Tn=new RegExp("^rgba\\("+[wn,wn,wn,xn]+"\\)$"),Ln=new RegExp("^rgba\\("+[_n,_n,_n,xn]+"\\)$"),Sn=new RegExp("^hsl\\("+[xn,_n,_n]+"\\)$"),Mn=new RegExp("^hsla\\("+[xn,_n,_n,xn]+"\\)$"),Pn={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Nn(){return this.rgb().formatHex()}function En(){return this.rgb().formatRgb()}function In(t){var n,e;return t=(t+"").trim().toLowerCase(),(n=An.exec(t))?(e=n[1].length,n=parseInt(n[1],16),6===e?Bn(n):3===e?new Rn(n>>8&15|n>>4&240,n>>4&15|240&n,(15&n)<<4|15&n,1):8===e?Dn(n>>24&255,n>>16&255,n>>8&255,(255&n)/255):4===e?Dn(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|240&n,((15&n)<<4|15&n)/255):null):(n=kn.exec(t))?new Rn(n[1],n[2],n[3],1):(n=Cn.exec(t))?new Rn(255*n[1]/100,255*n[2]/100,255*n[3]/100,1):(n=Tn.exec(t))?Dn(n[1],n[2],n[3],n[4]):(n=Ln.exec(t))?Dn(255*n[1]/100,255*n[2]/100,255*n[3]/100,n[4]):(n=Sn.exec(t))?Gn(n[1],n[2]/100,n[3]/100,1):(n=Mn.exec(t))?Gn(n[1],n[2]/100,n[3]/100,n[4]):Pn.hasOwnProperty(t)?Bn(Pn[t]):"transparent"===t?new Rn(NaN,NaN,NaN,0):null}function Bn(t){return new Rn(t>>16&255,t>>8&255,255&t,1)}function Dn(t,n,e,r){return r<=0&&(t=n=e=NaN),new Rn(t,n,e,r)}function Fn(t){return t instanceof vn||(t=In(t)),t?new Rn((t=t.rgb()).r,t.g,t.b,t.opacity):new Rn}function On(t,n,e,r){return 1===arguments.length?Fn(t):new Rn(t,n,e,null==r?1:r)}function Rn(t,n,e,r){this.r=+t,this.g=+n,this.b=+e,this.opacity=+r}function jn(){return"#"+Hn(this.r)+Hn(this.g)+Hn(this.b)}function zn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Hn(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Gn(t,n,e,r){return r<=0?t=n=e=NaN:e<=0||e>=1?t=n=NaN:n<=0&&(t=NaN),new qn(t,n,e,r)}function Wn(t){if(t instanceof qn)return new qn(t.h,t.s,t.l,t.opacity);if(t instanceof vn||(t=In(t)),!t)return new qn;if(t instanceof qn)return t;var n=(t=t.rgb()).r/255,e=t.g/255,r=t.b/255,o=Math.min(n,e,r),i=Math.max(n,e,r),a=NaN,s=i-o,c=(i+o)/2;return s?(a=n===i?(e-r)/s+6*(e<r):e===i?(r-n)/s+2:(n-e)/s+4,s/=c<.5?i+o:2-i-o,a*=60):s=c>0&&c<1?0:a,new qn(a,s,c,t.opacity)}function qn(t,n,e,r){this.h=+t,this.s=+n,this.l=+e,this.opacity=+r}function Yn(t,n,e){return 255*(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)}function Xn(t,n,e,r,o){var i=t*t,a=i*t;return((1-3*t+3*i-a)*n+(4-6*i+3*a)*e+(1+3*t+3*i-3*a)*r+a*o)/6}pn(vn,In,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Nn,formatHex:Nn,formatHsl:function(){return Wn(this).formatHsl()},formatRgb:En,toString:En}),pn(Rn,On,gn(vn,{brighter:function(t){return t=null==t?bn:Math.pow(bn,t),new Rn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?yn:Math.pow(yn,t),new Rn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:jn,formatHex:jn,formatRgb:zn,toString:zn})),pn(qn,(function(t,n,e,r){return 1===arguments.length?Wn(t):new qn(t,n,e,null==r?1:r)}),gn(vn,{brighter:function(t){return t=null==t?bn:Math.pow(bn,t),new qn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?yn:Math.pow(yn,t),new qn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,r=e+(e<.5?e:1-e)*n,o=2*e-r;return new Rn(Yn(t>=240?t-240:t+120,o,r),Yn(t,o,r),Yn(t<120?t+240:t-120,o,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Un=function(t){return function(){return t}};function Vn(t,n){var e=n-t;return e?function(t,n){return function(e){return t+e*n}}(t,e):Un(isNaN(t)?n:t)}var Qn=function t(n){var e=function(t){return 1==(t=+t)?Vn:function(n,e){return e-n?function(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(r){return Math.pow(t+r*n,e)}}(n,e,t):Un(isNaN(n)?e:n)}}(n);function r(t,n){var r=e((t=On(t)).r,(n=On(n)).r),o=e(t.g,n.g),i=e(t.b,n.b),a=Vn(t.opacity,n.opacity);return function(n){return t.r=r(n),t.g=o(n),t.b=i(n),t.opacity=a(n),t+""}}return r.gamma=t,r}(1);function $n(t){return function(n){var e,r,o=n.length,i=new Array(o),a=new Array(o),s=new Array(o);for(e=0;e<o;++e)r=On(n[e]),i[e]=r.r||0,a[e]=r.g||0,s[e]=r.b||0;return i=t(i),a=t(a),s=t(s),r.opacity=1,function(t){return r.r=i(t),r.g=a(t),r.b=s(t),r+""}}}function Jn(t,n){var e,r=n?n.length:0,o=t?Math.min(r,t.length):0,i=new Array(o),a=new Array(r);for(e=0;e<o;++e)i[e]=ie(t[e],n[e]);for(;e<r;++e)a[e]=n[e];return function(t){for(e=0;e<o;++e)a[e]=i[e](t);return a}}function Kn(t,n){var e=new Date;return t=+t,n=+n,function(r){return e.setTime(t*(1-r)+n*r),e}}function Zn(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}function te(t,n){var e,r={},o={};for(e in null!==t&&"object"==typeof t||(t={}),null!==n&&"object"==typeof n||(n={}),n)e in t?r[e]=ie(t[e],n[e]):o[e]=n[e];return function(t){for(e in r)o[e]=r[e](t);return o}}$n((function(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),o=t[r],i=t[r+1],a=r>0?t[r-1]:2*o-i,s=r<n-1?t[r+2]:2*i-o;return Xn((e-r/n)*n,a,o,i,s)}})),$n((function(t){var n=t.length;return function(e){var r=Math.floor(((e%=1)<0?++e:e)*n),o=t[(r+n-1)%n],i=t[r%n],a=t[(r+1)%n],s=t[(r+2)%n];return Xn((e-r/n)*n,o,i,a,s)}}));var ne=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ee=new RegExp(ne.source,"g");function re(t,n){var e,r,o,i=ne.lastIndex=ee.lastIndex=0,a=-1,s=[],c=[];for(t+="",n+="";(e=ne.exec(t))&&(r=ee.exec(n));)(o=r.index)>i&&(o=n.slice(i,o),s[a]?s[a]+=o:s[++a]=o),(e=e[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,c.push({i:a,x:Zn(e,r)})),i=ee.lastIndex;return i<n.length&&(o=n.slice(i),s[a]?s[a]+=o:s[++a]=o),s.length<2?c[0]?function(t){return function(n){return t(n)+""}}(c[0].x):function(t){return function(){return t}}(n):(n=c.length,function(t){for(var e,r=0;r<n;++r)s[(e=c[r]).i]=e.x(t);return s.join("")})}function oe(t,n){n||(n=[]);var e,r=t?Math.min(n.length,t.length):0,o=n.slice();return function(i){for(e=0;e<r;++e)o[e]=t[e]*(1-i)+n[e]*i;return o}}function ie(t,n){var e,r,o=typeof n;return null==n||"boolean"===o?Un(n):("number"===o?Zn:"string"===o?(e=In(n))?(n=e,Qn):re:n instanceof In?Qn:n instanceof Date?Kn:(r=n,!ArrayBuffer.isView(r)||r instanceof DataView?Array.isArray(n)?Jn:"function"!=typeof n.valueOf&&"function"!=typeof n.toString||isNaN(n)?te:Zn:oe))(t,n)}function ae(t,n){if(t=function(t){for(var n;n=t.sourceEvent;)t=n;return t}(t),void 0===n&&(n=t.currentTarget),n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(n.getScreenCTM().inverse())).x,r.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[t.clientX-o.left-n.clientLeft,t.clientY-o.top-n.clientTop]}}return[t.pageX,t.pageY]}var se,ce,le=0,ue=0,he=0,fe=0,de=0,me=0,pe="object"==typeof performance&&performance.now?performance:Date,ge="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ve(){return de||(ge(ye),de=pe.now()+me)}function ye(){de=0}function be(){this._call=this._time=this._next=null}function we(t,n,e){var r=new be;return r.restart(t,n,e),r}function xe(){de=(fe=pe.now())+me,le=ue=0;try{!function(){ve(),++le;for(var t,n=se;n;)(t=de-n._time)>=0&&n._call.call(null,t),n=n._next;--le}()}finally{le=0,function(){for(var t,n,e=se,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:se=n);ce=t,Ae(r)}(),de=0}}function _e(){var t=pe.now(),n=t-fe;n>1e3&&(me-=n,fe=t)}function Ae(t){le||(ue&&(ue=clearTimeout(ue)),t-de>24?(t<1/0&&(ue=setTimeout(xe,t-pe.now()-me)),he&&(he=clearInterval(he))):(he||(fe=pe.now(),he=setInterval(_e,1e3)),le=1,ge(xe)))}function ke(t,n,e){var r=new be;return n=null==n?0:+n,r.restart((function(e){r.stop(),t(e+n)}),n,e),r}be.prototype=we.prototype={constructor:be,restart:function(t,n,e){if("function"!=typeof t)throw new TypeError("callback is not a function");e=(null==e?ve():+e)+(null==n?0:+n),this._next||ce===this||(ce?ce._next=this:se=this,ce=this),this._call=t,this._time=e,Ae()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ae())}};var Ce=hn("start","end","cancel","interrupt"),Te=[];function Le(t,n,e,r,o,i){var a=t.__transition;if(a){if(e in a)return}else t.__transition={};!function(t,n,e){var r,o=t.__transition;function i(c){var l,u,h,f;if(1!==e.state)return s();for(l in o)if((f=o[l]).name===e.name){if(3===f.state)return ke(i);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete o[l]):+l<n&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete o[l])}if(ke((function(){3===e.state&&(e.state=4,e.timer.restart(a,e.delay,e.time),a(c))})),e.state=2,e.on.call("start",t,t.__data__,e.index,e.group),2===e.state){for(e.state=3,r=new Array(h=e.tween.length),l=0,u=-1;l<h;++l)(f=e.tween[l].value.call(t,t.__data__,e.index,e.group))&&(r[++u]=f);r.length=u+1}}function a(n){for(var o=n<e.duration?e.ease.call(null,n/e.duration):(e.timer.restart(s),e.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(t,o);5===e.state&&(e.on.call("end",t,t.__data__,e.index,e.group),s())}function s(){for(var r in e.state=6,e.timer.stop(),delete o[n],o)return;delete t.__transition}o[n]=e,e.timer=we((function(t){e.state=1,e.timer.restart(i,e.delay,e.time),e.delay<=t&&i(t-e.delay)}),0,e.time)}(t,e,{name:n,index:r,group:o,on:Ce,tween:Te,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function Se(t,n){var e=Pe(t,n);if(e.state>0)throw new Error("too late; already scheduled");return e}function Me(t,n){var e=Pe(t,n);if(e.state>3)throw new Error("too late; already running");return e}function Pe(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function Ne(t,n){var e,r,o,i=t.__transition,a=!0;if(i){for(o in n=null==n?null:n+"",i)(e=i[o]).name===n?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete i[o]):a=!1;a&&delete t.__transition}}var Ee,Ie=180/Math.PI,Be={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function De(t,n,e,r,o,i){var a,s,c;return(a=Math.sqrt(t*t+n*n))&&(t/=a,n/=a),(c=t*e+n*r)&&(e-=t*c,r-=n*c),(s=Math.sqrt(e*e+r*r))&&(e/=s,r/=s,c/=s),t*r<n*e&&(t=-t,n=-n,c=-c,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(n,t)*Ie,skewX:Math.atan(c)*Ie,scaleX:a,scaleY:s}}function Fe(t,n,e,r){function o(t){return t.length?t.pop()+" ":""}return function(i,a){var s=[],c=[];return i=t(i),a=t(a),function(t,r,o,i,a,s){if(t!==o||r!==i){var c=a.push("translate(",null,n,null,e);s.push({i:c-4,x:Zn(t,o)},{i:c-2,x:Zn(r,i)})}else(o||i)&&a.push("translate("+o+n+i+e)}(i.translateX,i.translateY,a.translateX,a.translateY,s,c),function(t,n,e,i){t!==n?(t-n>180?n+=360:n-t>180&&(t+=360),i.push({i:e.push(o(e)+"rotate(",null,r)-2,x:Zn(t,n)})):n&&e.push(o(e)+"rotate("+n+r)}(i.rotate,a.rotate,s,c),function(t,n,e,i){t!==n?i.push({i:e.push(o(e)+"skewX(",null,r)-2,x:Zn(t,n)}):n&&e.push(o(e)+"skewX("+n+r)}(i.skewX,a.skewX,s,c),function(t,n,e,r,i,a){if(t!==e||n!==r){var s=i.push(o(i)+"scale(",null,",",null,")");a.push({i:s-4,x:Zn(t,e)},{i:s-2,x:Zn(n,r)})}else 1===e&&1===r||i.push(o(i)+"scale("+e+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,c),i=a=null,function(t){for(var n,e=-1,r=c.length;++e<r;)s[(n=c[e]).i]=n.x(t);return s.join("")}}}var Oe=Fe((function(t){var n=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(t+"");return n.isIdentity?Be:De(n.a,n.b,n.c,n.d,n.e,n.f)}),"px, ","px)","deg)"),Re=Fe((function(t){return null==t?Be:(Ee||(Ee=document.createElementNS("http://www.w3.org/2000/svg","g")),Ee.setAttribute("transform",t),(t=Ee.transform.baseVal.consolidate())?De((t=t.matrix).a,t.b,t.c,t.d,t.e,t.f):Be)}),", ",")",")");function je(t,n){var e,r;return function(){var o=Me(this,t),i=o.tween;if(i!==e)for(var a=0,s=(r=e=i).length;a<s;++a)if(r[a].name===n){(r=r.slice()).splice(a,1);break}o.tween=r}}function ze(t,n,e){var r,o;if("function"!=typeof e)throw new Error;return function(){var i=Me(this,t),a=i.tween;if(a!==r){o=(r=a).slice();for(var s={name:n,value:e},c=0,l=o.length;c<l;++c)if(o[c].name===n){o[c]=s;break}c===l&&o.push(s)}i.tween=o}}function He(t,n,e){var r=t._id;return t.each((function(){var t=Me(this,r);(t.value||(t.value={}))[n]=e.apply(this,arguments)})),function(t){return Pe(t,r).value[n]}}function Ge(t,n){var e;return("number"==typeof n?Zn:n instanceof In?Qn:(e=In(n))?(n=e,Qn):re)(t,n)}function We(t){return function(){this.removeAttribute(t)}}function qe(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ye(t,n,e){var r,o,i=e+"";return function(){var a=this.getAttribute(t);return a===i?null:a===r?o:o=n(r=a,e)}}function Xe(t,n,e){var r,o,i=e+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===i?null:a===r?o:o=n(r=a,e)}}function Ue(t,n,e){var r,o,i;return function(){var a,s,c=e(this);if(null!=c)return(a=this.getAttribute(t))===(s=c+"")?null:a===r&&s===o?i:(o=s,i=n(r=a,c));this.removeAttribute(t)}}function Ve(t,n,e){var r,o,i;return function(){var a,s,c=e(this);if(null!=c)return(a=this.getAttributeNS(t.space,t.local))===(s=c+"")?null:a===r&&s===o?i:(o=s,i=n(r=a,c));this.removeAttributeNS(t.space,t.local)}}function Qe(t,n){return function(e){this.setAttribute(t,n.call(this,e))}}function $e(t,n){return function(e){this.setAttributeNS(t.space,t.local,n.call(this,e))}}function Je(t,n){var e,r;function o(){var o=n.apply(this,arguments);return o!==r&&(e=(r=o)&&$e(t,o)),e}return o._value=n,o}function Ke(t,n){var e,r;function o(){var o=n.apply(this,arguments);return o!==r&&(e=(r=o)&&Qe(t,o)),e}return o._value=n,o}function Ze(t,n){return function(){Se(this,t).delay=+n.apply(this,arguments)}}function tr(t,n){return n=+n,function(){Se(this,t).delay=n}}function nr(t,n){return function(){Me(this,t).duration=+n.apply(this,arguments)}}function er(t,n){return n=+n,function(){Me(this,t).duration=n}}function rr(t,n){if("function"!=typeof n)throw new Error;return function(){Me(this,t).ease=n}}function or(t,n,e){var r,o,i=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?Se:Me;return function(){var a=i(this,t),s=a.on;s!==r&&(o=(r=s).copy()).on(n,e),a.on=o}}var ir=Mt.prototype.constructor;function ar(t){return function(){this.style.removeProperty(t)}}function sr(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}function cr(t,n,e){var r,o;function i(){var i=n.apply(this,arguments);return i!==o&&(r=(o=i)&&sr(t,i,e)),r}return i._value=n,i}function lr(t){return function(n){this.textContent=t.call(this,n)}}function ur(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&lr(r)),n}return r._value=t,r}var hr=0;function fr(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function dr(){return++hr}var mr=Mt.prototype;fr.prototype=function(t){return Mt().transition(t)}.prototype={constructor:fr,select:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=v(t));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var s,c,l=r[a],u=l.length,h=i[a]=new Array(u),f=0;f<u;++f)(s=l[f])&&(c=t.call(s,s.__data__,f,l))&&("__data__"in s&&(c.__data__=s.__data__),h[f]=c,Le(h[f],n,e,f,h,Pe(s,e)));return new fr(i,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;"function"!=typeof t&&(t=w(t));for(var r=this._groups,o=r.length,i=[],a=[],s=0;s<o;++s)for(var c,l=r[s],u=l.length,h=0;h<u;++h)if(c=l[h]){for(var f,d=t.call(c,c.__data__,h,l),m=Pe(c,e),p=0,g=d.length;p<g;++p)(f=d[p])&&Le(f,n,e,p,d,m);i.push(d),a.push(c)}return new fr(i,a,n,e)},filter:function(t){"function"!=typeof t&&(t=x(t));for(var n=this._groups,e=n.length,r=new Array(e),o=0;o<e;++o)for(var i,a=n[o],s=a.length,c=r[o]=[],l=0;l<s;++l)(i=a[l])&&t.call(i,i.__data__,l,a)&&c.push(i);return new fr(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,o=e.length,i=Math.min(r,o),a=new Array(r),s=0;s<i;++s)for(var c,l=n[s],u=e[s],h=l.length,f=a[s]=new Array(h),d=0;d<h;++d)(c=l[d]||u[d])&&(f[d]=c);for(;s<r;++s)a[s]=n[s];return new fr(a,this._parents,this._name,this._id)},selection:function(){return new ir(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=dr(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],c=s.length,l=0;l<c;++l)if(a=s[l]){var u=Pe(a,n);Le(a,t,e,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new fr(r,this._parents,t,e)},call:mr.call,nodes:mr.nodes,node:mr.node,size:mr.size,empty:mr.empty,each:mr.each,on:function(t,n){var e=this._id;return arguments.length<2?Pe(this.node(),e).on.on(t):this.each(or(e,t,n))},attr:function(t,n){var e=F(t),r="transform"===e?Re:Ge;return this.attrTween(t,"function"==typeof n?(e.local?Ve:Ue)(e,r,He(this,"attr."+t,n)):null==n?(e.local?qe:We)(e):(e.local?Xe:Ye)(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(null==n)return this.tween(e,null);if("function"!=typeof n)throw new Error;var r=F(t);return this.tween(e,(r.local?Je:Ke)(r,n))},style:function(t,n,e){var r="transform"==(t+="")?Oe:Ge;return null==n?this.styleTween(t,function(t,n){var e,r,o;return function(){var i=U(this,t),a=(this.style.removeProperty(t),U(this,t));return i===a?null:i===e&&a===r?o:o=n(e=i,r=a)}}(t,r)).on("end.style."+t,ar(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,o,i;return function(){var a=U(this,t),s=e(this),c=s+"";return null==s&&(this.style.removeProperty(t),c=s=U(this,t)),a===c?null:a===r&&c===o?i:(o=c,i=n(r=a,s))}}(t,r,He(this,"style."+t,n))).each(function(t,n){var e,r,o,i,a="style."+n,s="end."+a;return function(){var c=Me(this,t),l=c.on,u=null==c.value[a]?i||(i=ar(n)):void 0;l===e&&o===u||(r=(e=l).copy()).on(s,o=u),c.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,o,i=e+"";return function(){var a=U(this,t);return a===i?null:a===r?o:o=n(r=a,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,cr(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(He(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,ur(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,o=Pe(this.node(),e).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===t)return r.value;return null}return this.each((null==n?je:ze)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?Ze:tr)(n,t)):Pe(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each(("function"==typeof t?nr:er)(n,t)):Pe(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(rr(n,t)):Pe(this.node(),n).ease},easeVarying:function(t){if("function"!=typeof t)throw new Error;return this.each(function(t,n){return function(){var e=n.apply(this,arguments);if("function"!=typeof e)throw new Error;Me(this,t).ease=e}}(this._id,t))},end:function(){var t,n,e=this,r=e._id,o=e.size();return new Promise((function(i,a){var s={value:a},c={value:function(){0==--o&&i()}};e.each((function(){var e=Me(this,r),o=e.on;o!==t&&((n=(t=o).copy())._.cancel.push(s),n._.interrupt.push(s),n._.end.push(c)),e.on=n})),0===o&&i()}))},[Symbol.iterator]:mr[Symbol.iterator]};var pr={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function gr(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))throw new Error("transition ".concat(n," not found"));return e}Mt.prototype.interrupt=function(t){return this.each((function(){Ne(this,t)}))},Mt.prototype.transition=function(t){var n,e;t instanceof fr?(n=t._id,t=t._name):(n=dr(),(e=pr).time=ve(),t=null==t?null:t+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],c=s.length,l=0;l<c;++l)(a=s[l])&&Le(a,t,n,l,s,e||gr(a,n));return new fr(r,this._parents,t,n)};var vr=function(t){return function(){return t}};function yr(t,n){var e=n.sourceEvent,r=n.target,o=n.selection,i=n.mode,a=n.dispatch;Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},selection:{value:o,enumerable:!0,configurable:!0},mode:{value:i,enumerable:!0,configurable:!0},_:{value:a}})}function br(t){t.stopImmediatePropagation()}function wr(t){t.preventDefault(),t.stopImmediatePropagation()}var xr={name:"drag"},_r={name:"space"},Ar={name:"handle"},kr={name:"center"},Cr=Math.abs,Tr=Math.max,Lr=Math.min;function Sr(t){return[+t[0],+t[1]]}function Mr(t){return[Sr(t[0]),Sr(t[1])]}var Pr={name:"x",handles:["w","e"].map(Rr),input:function(t,n){return null==t?null:[[+t[0],n[0][1]],[+t[1],n[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},Nr={name:"y",handles:["n","s"].map(Rr),input:function(t,n){return null==t?null:[[n[0][0],+t[0]],[n[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},Er={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Rr),input:function(t){return null==t?null:Mr(t)},output:function(t){return t}},Ir={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Br={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Dr={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Fr={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Or={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Rr(t){return{type:t}}function jr(t){return!t.ctrlKey&&!t.button}function zr(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Hr(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gr(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Wr(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function qr(t){var n=t.__brush;return n?n.dim.output(n.selection):null}function Yr(){return Vr(Pr)}function Xr(){return Vr(Nr)}function Ur(){return Vr(Er)}function Vr(t){var n,e=zr,r=jr,o=Hr,i=!0,a=hn("start","brush","end"),s=6;function c(n){var e=n.property("__brush",g).selectAll(".overlay").data([Rr("overlay")]);e.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",Ir.overlay).merge(e).each((function(){var t=Gr(this).extent;Pt(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),n.selectAll(".selection").data([Rr("selection")]).enter().append("rect").attr("class","selection").attr("cursor",Ir.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=n.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return Ir[t.type]})),n.each(l).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",f).filter(o).on("touchstart.brush",f).on("touchmove.brush",d).on("touchend.brush touchcancel.brush",p).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function l(){var t=Pt(this),n=Gr(this).selection;n?(t.selectAll(".selection").style("display",null).attr("x",n[0][0]).attr("y",n[0][1]).attr("width",n[1][0]-n[0][0]).attr("height",n[1][1]-n[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?n[1][0]-s/2:n[0][0]-s/2})).attr("y",(function(t){return"s"===t.type[0]?n[1][1]-s/2:n[0][1]-s/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?n[1][0]-n[0][0]+s:s})).attr("height",(function(t){return"e"===t.type||"w"===t.type?n[1][1]-n[0][1]+s:s}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function u(t,n,e){var r=t.__brush.emitter;return!r||e&&r.clean?new h(t,n,e):r}function h(t,n,e){this.that=t,this.args=n,this.state=t.__brush,this.active=0,this.clean=e}function f(e){if((!n||e.touches)&&r.apply(this,arguments)){var o,a,s,c,h,f,d,p,g,v,y,b=this,w=e.target.__data__.type,x="selection"===(i&&e.metaKey?w="overlay":w)?xr:i&&e.altKey?kr:Ar,_=t===Nr?null:Fr[w],A=t===Pr?null:Or[w],k=Gr(b),C=k.extent,T=k.selection,L=C[0][0],S=C[0][1],M=C[1][0],P=C[1][1],N=0,E=0,I=_&&A&&i&&e.shiftKey,B=Array.from(e.touches||[e],(function(t){var n=t.identifier;return(t=ae(t,b)).point0=t.slice(),t.identifier=n,t}));if("overlay"===w){T&&(g=!0);var D=[B[0],B[1]||B[0]];k.selection=T=[[o=t===Nr?L:Lr(D[0][0],D[1][0]),s=t===Pr?S:Lr(D[0][1],D[1][1])],[h=t===Nr?M:Tr(D[0][0],D[1][0]),d=t===Pr?P:Tr(D[0][1],D[1][1])]],B.length>1&&H()}else o=T[0][0],s=T[0][1],h=T[1][0],d=T[1][1];a=o,c=s,f=h,p=d;var F=Pt(b).attr("pointer-events","none"),O=F.selectAll(".overlay").attr("cursor",Ir[w]);Ne(b);var R=u(b,arguments,!0).beforestart();if(e.touches)R.moved=z,R.ended=G;else{var j=Pt(e.view).on("mousemove.brush",z,!0).on("mouseup.brush",G,!0);i&&j.on("keydown.brush",W,!0).on("keyup.brush",q,!0),dn(e.view)}l.call(b),R.start(e,x.name)}function z(t){var n,e=m(t.changedTouches||[t]);try{for(e.s();!(n=e.n()).done;){var r,o=n.value,i=m(B);try{for(i.s();!(r=i.n()).done;){var a=r.value;a.identifier===o.identifier&&(a.cur=ae(o,b))}}catch(t){i.e(t)}finally{i.f()}}}catch(t){e.e(t)}finally{e.f()}if(I&&!v&&!y&&1===B.length){var s=B[0];Cr(s.cur[0]-s[0])>Cr(s.cur[1]-s[1])?y=!0:v=!0}var c,l=m(B);try{for(l.s();!(c=l.n()).done;){var u=c.value;u.cur&&(u[0]=u.cur[0],u[1]=u.cur[1])}}catch(t){l.e(t)}finally{l.f()}g=!0,wr(t),H(t)}function H(t){var n,e=B[0],r=e.point0;switch(N=e[0]-r[0],E=e[1]-r[1],x){case _r:case xr:_&&(N=Tr(L-o,Lr(M-h,N)),a=o+N,f=h+N),A&&(E=Tr(S-s,Lr(P-d,E)),c=s+E,p=d+E);break;case Ar:B[1]?(_&&(a=Tr(L,Lr(M,B[0][0])),f=Tr(L,Lr(M,B[1][0])),_=1),A&&(c=Tr(S,Lr(P,B[0][1])),p=Tr(S,Lr(P,B[1][1])),A=1)):(_<0?(N=Tr(L-o,Lr(M-o,N)),a=o+N,f=h):_>0&&(N=Tr(L-h,Lr(M-h,N)),a=o,f=h+N),A<0?(E=Tr(S-s,Lr(P-s,E)),c=s+E,p=d):A>0&&(E=Tr(S-d,Lr(P-d,E)),c=s,p=d+E));break;case kr:_&&(a=Tr(L,Lr(M,o-N*_)),f=Tr(L,Lr(M,h+N*_))),A&&(c=Tr(S,Lr(P,s-E*A)),p=Tr(S,Lr(P,d+E*A)))}f<a&&(_*=-1,n=o,o=h,h=n,n=a,a=f,f=n,w in Br&&O.attr("cursor",Ir[w=Br[w]])),p<c&&(A*=-1,n=s,s=d,d=n,n=c,c=p,p=n,w in Dr&&O.attr("cursor",Ir[w=Dr[w]])),k.selection&&(T=k.selection),v&&(a=T[0][0],f=T[1][0]),y&&(c=T[0][1],p=T[1][1]),T[0][0]===a&&T[0][1]===c&&T[1][0]===f&&T[1][1]===p||(k.selection=[[a,c],[f,p]],l.call(b),R.brush(t,x.name))}function G(t){if(br(t),t.touches){if(t.touches.length)return;n&&clearTimeout(n),n=setTimeout((function(){n=null}),500)}else mn(t.view,g),j.on("keydown.brush keyup.brush mousemove.brush mouseup.brush",null);F.attr("pointer-events","all"),O.attr("cursor",Ir.overlay),k.selection&&(T=k.selection),Wr(T)&&(k.selection=null,l.call(b)),R.end(t,x.name)}function W(t){switch(t.keyCode){case 16:I=_&&A;break;case 18:x===Ar&&(_&&(h=f-N*_,o=a+N*_),A&&(d=p-E*A,s=c+E*A),x=kr,H());break;case 32:x!==Ar&&x!==kr||(_<0?h=f-N:_>0&&(o=a-N),A<0?d=p-E:A>0&&(s=c-E),x=_r,O.attr("cursor",Ir.selection),H());break;default:return}wr(t)}function q(t){switch(t.keyCode){case 16:I&&(v=y=I=!1,H());break;case 18:x===kr&&(_<0?h=f:_>0&&(o=a),A<0?d=p:A>0&&(s=c),x=Ar,H());break;case 32:x===_r&&(t.altKey?(_&&(h=f-N*_,o=a+N*_),A&&(d=p-E*A,s=c+E*A),x=kr):(_<0?h=f:_>0&&(o=a),A<0?d=p:A>0&&(s=c),x=Ar),O.attr("cursor",Ir[w]),H());break;default:return}wr(t)}}function d(t){u(this,arguments).moved(t)}function p(t){u(this,arguments).ended(t)}function g(){var n=this.__brush||{selection:null};return n.extent=Mr(e.apply(this,arguments)),n.dim=t,n}return c.move=function(n,e){n.tween?n.on("start.brush",(function(t){u(this,arguments).beforestart().start(t)})).on("interrupt.brush end.brush",(function(t){u(this,arguments).end(t)})).tween("brush",(function(){var n=this,r=n.__brush,o=u(n,arguments),i=r.selection,a=t.input("function"==typeof e?e.apply(this,arguments):e,r.extent),s=ie(i,a);function c(t){r.selection=1===t&&null===a?null:s(t),l.call(n),o.brush()}return null!==i&&null!==a?c:c(1)})):n.each((function(){var n=this,r=arguments,o=n.__brush,i=t.input("function"==typeof e?e.apply(n,r):e,o.extent),a=u(n,r).beforestart();Ne(n),o.selection=null===i?null:i,l.call(n),a.start().brush().end()}))},c.clear=function(t){c.move(t,null)},h.prototype={beforestart:function(){return 1==++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(t,n){return this.starting?(this.starting=!1,this.emit("start",t,n)):this.emit("brush",t),this},brush:function(t,n){return this.emit("brush",t,n),this},end:function(t,n){return 0==--this.active&&(delete this.state.emitter,this.emit("end",t,n)),this},emit:function(n,e,r){var o=Pt(this.that).datum();a.call(n,this.that,new yr(n,{sourceEvent:e,target:c,selection:t.output(this.state.selection),mode:r,dispatch:a}),o)}},c.extent=function(t){return arguments.length?(e="function"==typeof t?t:vr(Mr(t)),c):e},c.filter=function(t){return arguments.length?(r="function"==typeof t?t:vr(!!t),c):r},c.touchable=function(t){return arguments.length?(o="function"==typeof t?t:vr(!!t),c):o},c.handleSize=function(t){return arguments.length?(s=+t,c):s},c.keyModifiers=function(t){return arguments.length?(i=!!t,c):i},c.on=function(){var t=a.on.apply(a,arguments);return t===a?c:t},c}function Qr(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,r=t.slice(0,e);return[r.length>1?r[0]+r.slice(2):r,+t.slice(e+1)]}function $r(t){return(t=Qr(Math.abs(t)))?t[1]:NaN}var Jr,Kr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Zr(t){if(!(n=Kr.exec(t)))throw new Error("invalid format: "+t);var n;return new to({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}function to(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function no(t,n){var e=Qr(t,n);if(!e)return t+"";var r=e[0],o=e[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}Zr.prototype=to.prototype,to.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var eo={"%":function(t,n){return(100*t).toFixed(n)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,n){return t.toExponential(n)},f:function(t,n){return t.toFixed(n)},g:function(t,n){return t.toPrecision(n)},o:function(t){return Math.round(t).toString(8)},p:function(t,n){return no(100*t,n)},r:no,s:function(t,n){var e=Qr(t,n);if(!e)return t+"";var r=e[0],o=e[1],i=o-(Jr=3*Math.max(-8,Math.min(8,Math.floor(o/3))))+1,a=r.length;return i===a?r:i>a?r+new Array(i-a+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+Qr(t,Math.max(0,n+i-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}};function ro(t){return t}var oo,io,ao,so=Array.prototype.map,co=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function lo(t){var n,e,r=void 0===t.grouping||void 0===t.thousands?ro:(n=so.call(t.grouping,Number),e=t.thousands+"",function(t,r){for(var o=t.length,i=[],a=0,s=n[0],c=0;o>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),i.push(t.substring(o-=s,o+s)),!((c+=s+1)>r));)s=n[a=(a+1)%n.length];return i.reverse().join(e)}),o=void 0===t.currency?"":t.currency[0]+"",i=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",s=void 0===t.numerals?ro:function(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}(so.call(t.numerals,String)),c=void 0===t.percent?"%":t.percent+"",l=void 0===t.minus?"−":t.minus+"",u=void 0===t.nan?"NaN":t.nan+"";function h(t){var n=(t=Zr(t)).fill,e=t.align,h=t.sign,f=t.symbol,d=t.zero,m=t.width,p=t.comma,g=t.precision,v=t.trim,y=t.type;"n"===y?(p=!0,y="g"):eo[y]||(void 0===g&&(g=12),v=!0,y="g"),(d||"0"===n&&"="===e)&&(d=!0,n="0",e="=");var b="$"===f?o:"#"===f&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",w="$"===f?i:/[%p]/.test(y)?c:"",x=eo[y],_=/[defgprs%]/.test(y);function A(t){var o,i,c,f=b,A=w;if("c"===y)A=x(t)+A,t="";else{var k=(t=+t)<0||1/t<0;if(t=isNaN(t)?u:x(Math.abs(t),g),v&&(t=function(t){t:for(var n,e=t.length,r=1,o=-1;r<e;++r)switch(t[r]){case".":o=n=r;break;case"0":0===o&&(o=r),n=r;break;default:if(!+t[r])break t;o>0&&(o=0)}return o>0?t.slice(0,o)+t.slice(n+1):t}(t)),k&&0==+t&&"+"!==h&&(k=!1),f=(k?"("===h?h:l:"-"===h||"("===h?"":h)+f,A=("s"===y?co[8+Jr/3]:"")+A+(k&&"("===h?")":""),_)for(o=-1,i=t.length;++o<i;)if(48>(c=t.charCodeAt(o))||c>57){A=(46===c?a+t.slice(o+1):t.slice(o))+A,t=t.slice(0,o);break}}p&&!d&&(t=r(t,1/0));var C=f.length+t.length+A.length,T=C<m?new Array(m-C+1).join(n):"";switch(p&&d&&(t=r(T+t,T.length?m-A.length:1/0),T=""),e){case"<":t=f+t+A+T;break;case"=":t=f+T+t+A;break;case"^":t=T.slice(0,C=T.length>>1)+f+t+A+T.slice(C);break;default:t=T+f+t+A}return s(t)}return g=void 0===g?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,g)):Math.max(0,Math.min(20,g)),A.toString=function(){return t+""},A}return{format:h,formatPrefix:function(t,n){var e=h(((t=Zr(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor($r(n)/3))),o=Math.pow(10,-r),i=co[8+r/3];return function(t){return e(o*t)+i}}}}function uo(t){return oo=lo(t),io=oo.format,ao=oo.formatPrefix,oo}function ho(t){return Math.max(0,-$r(Math.abs(t)))}function fo(t,n){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor($r(n)/3)))-$r(Math.abs(t)))}function mo(t,n){return t=Math.abs(t),n=Math.abs(n)-t,Math.max(0,$r(n)-$r(t))+1}function po(t){return((t=Math.exp(t))+1/t)/2}uo({thousands:",",grouping:[3],currency:["$",""]});var go=function t(n,e,r){function o(t,o){var i,a,s=t[0],c=t[1],l=t[2],u=o[0],h=o[1],f=o[2],d=u-s,m=h-c,p=d*d+m*m;if(p<1e-12)a=Math.log(f/l)/n,i=function(t){return[s+t*d,c+t*m,l*Math.exp(n*t*a)]};else{var g=Math.sqrt(p),v=(f*f-l*l+r*p)/(2*l*e*g),y=(f*f-l*l-r*p)/(2*f*e*g),b=Math.log(Math.sqrt(v*v+1)-v),w=Math.log(Math.sqrt(y*y+1)-y);a=(w-b)/n,i=function(t){var r,o=t*a,i=po(b),u=l/(e*g)*(i*(r=n*o+b,((r=Math.exp(2*r))-1)/(r+1))-function(t){return((t=Math.exp(t))-1/t)/2}(b));return[s+u*d,c+u*m,l*i/po(n*o+b)]}}return i.duration=1e3*a*n/Math.SQRT2,i}return o.rho=function(n){var e=Math.max(.001,+n),r=e*e;return t(e,r,r*r)},o}(Math.SQRT2,2,4),vo=function(t){return function(){return t}};function yo(t,n){var e=n.sourceEvent,r=n.target,o=n.transform,i=n.dispatch;Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:o,enumerable:!0,configurable:!0},_:{value:i}})}function bo(t,n,e){this.k=t,this.x=n,this.y=e}bo.prototype={constructor:bo,scale:function(t){return 1===t?this:new bo(this.k*t,this.x,this.y)},translate:function(t,n){return 0===t&0===n?this:new bo(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var wo=new bo(1,0,0);function xo(t){for(;!t.__zoom;)if(!(t=t.parentNode))return wo;return t.__zoom}function _o(t){t.stopImmediatePropagation()}function Ao(t){t.preventDefault(),t.stopImmediatePropagation()}function ko(t){return!(t.ctrlKey&&"wheel"!==t.type||t.button)}function Co(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t).hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]:[[0,0],[t.clientWidth,t.clientHeight]]}function To(){return this.__zoom||wo}function Lo(t){return-t.deltaY*(1===t.deltaMode?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function So(){return navigator.maxTouchPoints||"ontouchstart"in this}function Mo(t,n,e){var r=t.invertX(n[0][0])-e[0][0],o=t.invertX(n[1][0])-e[1][0],i=t.invertY(n[0][1])-e[0][1],a=t.invertY(n[1][1])-e[1][1];return t.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function Po(){var t,n,e,r=ko,o=Co,i=Mo,a=Lo,s=So,c=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],u=250,h=go,f=hn("start","zoom","end"),d=500,m=0,p=10;function g(t){t.property("__zoom",To).on("wheel.zoom",A,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",C).filter(s).on("touchstart.zoom",T).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",S).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function v(t,n){return(n=Math.max(c[0],Math.min(c[1],n)))===t.k?t:new bo(n,t.x,t.y)}function y(t,n,e){var r=n[0]-e[0]*t.k,o=n[1]-e[1]*t.k;return r===t.x&&o===t.y?t:new bo(t.k,r,o)}function b(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function w(t,n,e,r){t.on("start.zoom",(function(){x(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){x(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,i=arguments,a=x(t,i).event(r),s=o.apply(t,i),c=null==e?b(s):"function"==typeof e?e.apply(t,i):e,l=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=t.__zoom,f="function"==typeof n?n.apply(t,i):n,d=h(u.invert(c).concat(l/u.k),f.invert(c).concat(l/f.k));return function(t){if(1===t)t=f;else{var n=d(t),e=l/n[2];t=new bo(e,c[0]-n[0]*e,c[1]-n[1]*e)}a.zoom(null,t)}}))}function x(t,n,e){return!e&&t.__zooming||new _(t,n)}function _(t,n){this.that=t,this.args=n,this.active=0,this.sourceEvent=null,this.extent=o.apply(t,n),this.taps=0}function A(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),o=1;o<n;o++)e[o-1]=arguments[o];if(r.apply(this,arguments)){var s=x(this,e).event(t),u=this.__zoom,h=Math.max(c[0],Math.min(c[1],u.k*Math.pow(2,a.apply(this,arguments)))),f=ae(t);if(s.wheel)s.mouse[0][0]===f[0]&&s.mouse[0][1]===f[1]||(s.mouse[1]=u.invert(s.mouse[0]=f)),clearTimeout(s.wheel);else{if(u.k===h)return;s.mouse=[f,u.invert(f)],Ne(this),s.start()}Ao(t),s.wheel=setTimeout(d,150),s.zoom("mouse",i(y(v(u,h),s.mouse[0],s.mouse[1]),s.extent,l))}function d(){s.wheel=null,s.end()}}function k(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];if(!e&&r.apply(this,arguments)){var s=t.currentTarget,c=x(this,o,!0).event(t),u=Pt(t.view).on("mousemove.zoom",p,!0).on("mouseup.zoom",g,!0),h=ae(t,s),f=t.clientX,d=t.clientY;dn(t.view),_o(t),c.mouse=[h,this.__zoom.invert(h)],Ne(this),c.start()}function p(t){if(Ao(t),!c.moved){var n=t.clientX-f,e=t.clientY-d;c.moved=n*n+e*e>m}c.event(t).zoom("mouse",i(y(c.that.__zoom,c.mouse[0]=ae(t,s),c.mouse[1]),c.extent,l))}function g(t){u.on("mousemove.zoom mouseup.zoom",null),mn(t.view,c.moved),Ao(t),c.event(t).end()}}function C(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),a=1;a<n;a++)e[a-1]=arguments[a];if(r.apply(this,arguments)){var s=this.__zoom,c=ae(t.changedTouches?t.changedTouches[0]:t,this),h=s.invert(c),f=s.k*(t.shiftKey?.5:2),d=i(y(v(s,f),c,h),o.apply(this,e),l);Ao(t),u>0?Pt(this).transition().duration(u).call(w,d,c,t):Pt(this).call(g.transform,d,c,t)}}function T(e){for(var o=arguments.length,i=new Array(o>1?o-1:0),a=1;a<o;a++)i[a-1]=arguments[a];if(r.apply(this,arguments)){var s,c,l,u,h=e.touches,f=h.length,m=x(this,i,e.changedTouches.length===f).event(e);for(_o(e),c=0;c<f;++c)u=[u=ae(l=h[c],this),this.__zoom.invert(u),l.identifier],m.touch0?m.touch1||m.touch0[2]===u[2]||(m.touch1=u,m.taps=0):(m.touch0=u,s=!0,m.taps=1+!!t);t&&(t=clearTimeout(t)),s&&(m.taps<2&&(n=u[0],t=setTimeout((function(){t=null}),d)),Ne(this),m.start())}}function L(t){if(this.__zooming){for(var n=arguments.length,e=new Array(n>1?n-1:0),r=1;r<n;r++)e[r-1]=arguments[r];var o,a,s,c,u=x(this,e).event(t),h=t.changedTouches,f=h.length;for(Ao(t),o=0;o<f;++o)s=ae(a=h[o],this),u.touch0&&u.touch0[2]===a.identifier?u.touch0[0]=s:u.touch1&&u.touch1[2]===a.identifier&&(u.touch1[0]=s);if(a=u.that.__zoom,u.touch1){var d=u.touch0[0],m=u.touch0[1],p=u.touch1[0],g=u.touch1[1],b=(b=p[0]-d[0])*b+(b=p[1]-d[1])*b,w=(w=g[0]-m[0])*w+(w=g[1]-m[1])*w;a=v(a,Math.sqrt(b/w)),s=[(d[0]+p[0])/2,(d[1]+p[1])/2],c=[(m[0]+g[0])/2,(m[1]+g[1])/2]}else{if(!u.touch0)return;s=u.touch0[0],c=u.touch0[1]}u.zoom("touch",i(y(a,s,c),u.extent,l))}}function S(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];if(this.__zooming){var a,s,c=x(this,o).event(t),l=t.changedTouches,u=l.length;for(_o(t),e&&clearTimeout(e),e=setTimeout((function(){e=null}),d),a=0;a<u;++a)s=l[a],c.touch0&&c.touch0[2]===s.identifier?delete c.touch0:c.touch1&&c.touch1[2]===s.identifier&&delete c.touch1;if(c.touch1&&!c.touch0&&(c.touch0=c.touch1,delete c.touch1),c.touch0)c.touch0[1]=this.__zoom.invert(c.touch0[0]);else if(c.end(),2===c.taps&&(s=ae(s,this),Math.hypot(n[0]-s[0],n[1]-s[1])<p)){var h=Pt(this).on("dblclick.zoom");h&&h.apply(this,arguments)}}}return g.transform=function(t,n,e,r){var o=t.selection?t.selection():t;o.property("__zoom",To),t!==o?w(t,n,e,r):o.interrupt().each((function(){x(this,arguments).event(r).start().zoom(null,"function"==typeof n?n.apply(this,arguments):n).end()}))},g.scaleBy=function(t,n,e,r){g.scaleTo(t,(function(){return this.__zoom.k*("function"==typeof n?n.apply(this,arguments):n)}),e,r)},g.scaleTo=function(t,n,e,r){g.transform(t,(function(){var t=o.apply(this,arguments),r=this.__zoom,a=null==e?b(t):"function"==typeof e?e.apply(this,arguments):e,s=r.invert(a),c="function"==typeof n?n.apply(this,arguments):n;return i(y(v(r,c),a,s),t,l)}),e,r)},g.translateBy=function(t,n,e,r){g.transform(t,(function(){return i(this.__zoom.translate("function"==typeof n?n.apply(this,arguments):n,"function"==typeof e?e.apply(this,arguments):e),o.apply(this,arguments),l)}),null,r)},g.translateTo=function(t,n,e,r,a){g.transform(t,(function(){var t=o.apply(this,arguments),a=this.__zoom,s=null==r?b(t):"function"==typeof r?r.apply(this,arguments):r;return i(wo.translate(s[0],s[1]).scale(a.k).translate("function"==typeof n?-n.apply(this,arguments):-n,"function"==typeof e?-e.apply(this,arguments):-e),t,l)}),r,a)},_.prototype={event:function(t){return t&&(this.sourceEvent=t),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,n){return this.mouse&&"mouse"!==t&&(this.mouse[1]=n.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=n.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=n.invert(this.touch1[0])),this.that.__zoom=n,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){var n=Pt(this.that).datum();f.call(t,this.that,new yo(t,{sourceEvent:this.sourceEvent,target:g,type:t,transform:this.that.__zoom,dispatch:f}),n)}},g.wheelDelta=function(t){return arguments.length?(a="function"==typeof t?t:vo(+t),g):a},g.filter=function(t){return arguments.length?(r="function"==typeof t?t:vo(!!t),g):r},g.touchable=function(t){return arguments.length?(s="function"==typeof t?t:vo(!!t),g):s},g.extent=function(t){return arguments.length?(o="function"==typeof t?t:vo([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),g):o},g.scaleExtent=function(t){return arguments.length?(c[0]=+t[0],c[1]=+t[1],g):[c[0],c[1]]},g.translateExtent=function(t){return arguments.length?(l[0][0]=+t[0][0],l[1][0]=+t[1][0],l[0][1]=+t[0][1],l[1][1]=+t[1][1],g):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},g.constrain=function(t){return arguments.length?(i=t,g):i},g.duration=function(t){return arguments.length?(u=+t,g):u},g.interpolate=function(t){return arguments.length?(h=t,g):h},g.on=function(){var t=f.on.apply(f,arguments);return t===f?g:t},g.clickDistance=function(t){return arguments.length?(m=(t=+t)*t,g):Math.sqrt(m)},g.tapDistance=function(t){return arguments.length?(p=+t,g):p},g}xo.prototype=bo.prototype;var No=Math.sqrt(50),Eo=Math.sqrt(10),Io=Math.sqrt(2);function Bo(t,n,e){var r=(n-t)/Math.max(0,e),o=Math.floor(Math.log(r)/Math.LN10),i=r/Math.pow(10,o);return o>=0?(i>=No?10:i>=Eo?5:i>=Io?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(i>=No?10:i>=Eo?5:i>=Io?2:1)}function Do(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function Fo(t){var n=t,e=t;function r(t,n,r,o){for(null==r&&(r=0),null==o&&(o=t.length);r<o;){var i=r+o>>>1;e(t[i],n)<0?r=i+1:o=i}return r}return 1===t.length&&(n=function(n,e){return t(n)-e},e=function(t){return function(n,e){return Do(t(n),e)}}(t)),{left:r,center:function(t,e,o,i){null==o&&(o=0),null==i&&(i=t.length);var a=r(t,e,o,i-1);return a>o&&n(t[a-1],e)>-n(t[a],e)?a-1:a},right:function(t,n,r,o){for(null==r&&(r=0),null==o&&(o=t.length);r<o;){var i=r+o>>>1;e(t[i],n)>0?o=i:r=i+1}return r}}}var Oo=Fo(Do),Ro=Oo.right,jo=(Oo.left,Fo((function(t){return null===t?NaN:+t})).center,Ro);function zo(t,n){return t=+t,n=+n,function(e){return Math.round(t*(1-e)+n*e)}}function Ho(t){return+t}var Go=[0,1];function Wo(t){return t}function qo(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:(e=isNaN(n)?NaN:.5,function(){return e});var e}function Yo(t,n,e){var r=t[0],o=t[1],i=n[0],a=n[1];return o<r?(r=qo(o,r),i=e(a,i)):(r=qo(r,o),i=e(i,a)),function(t){return i(r(t))}}function Xo(t,n,e){var r=Math.min(t.length,n.length)-1,o=new Array(r),i=new Array(r),a=-1;for(t[r]<t[0]&&(t=t.slice().reverse(),n=n.slice().reverse());++a<r;)o[a]=qo(t[a],t[a+1]),i[a]=e(n[a],n[a+1]);return function(n){var e=jo(t,n,1,r)-1;return i[e](o[e](n))}}function Uo(t,n){return n.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function Vo(){return function(){var t,n,e,r,o,i,a=Go,s=Go,c=ie,l=Wo;function u(){var t,n,e,c=Math.min(a.length,s.length);return l!==Wo&&(t=a[0],n=a[c-1],t>n&&(e=t,t=n,n=e),l=function(e){return Math.max(t,Math.min(n,e))}),r=c>2?Xo:Yo,o=i=null,h}function h(n){return isNaN(n=+n)?e:(o||(o=r(a.map(t),s,c)))(t(l(n)))}return h.invert=function(e){return l(n((i||(i=r(s,a.map(t),Zn)))(e)))},h.domain=function(t){return arguments.length?(a=Array.from(t,Ho),u()):a.slice()},h.range=function(t){return arguments.length?(s=Array.from(t),u()):s.slice()},h.rangeRound=function(t){return s=Array.from(t),c=zo,u()},h.clamp=function(t){return arguments.length?(l=!!t||Wo,u()):l!==Wo},h.interpolate=function(t){return arguments.length?(c=t,u()):c},h.unknown=function(t){return arguments.length?(e=t,h):e},function(e,r){return t=e,n=r,u()}}()(Wo,Wo)}function Qo(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t)}return this}function $o(t){var n=t.domain;return t.ticks=function(t){var e=n();return function(t,n,e){var r,o,i,a,s=-1;if(e=+e,(t=+t)==(n=+n)&&e>0)return[t];if((r=n<t)&&(o=t,t=n,n=o),0===(a=Bo(t,n,e))||!isFinite(a))return[];if(a>0)for(t=Math.ceil(t/a),n=Math.floor(n/a),i=new Array(o=Math.ceil(n-t+1));++s<o;)i[s]=(t+s)*a;else for(a=-a,t=Math.ceil(t*a),n=Math.floor(n*a),i=new Array(o=Math.ceil(n-t+1));++s<o;)i[s]=(t+s)/a;return r&&i.reverse(),i}(e[0],e[e.length-1],null==t?10:t)},t.tickFormat=function(t,e){var r=n();return function(t,n,e,r){var o,i=function(t,n,e){var r=Math.abs(n-t)/Math.max(0,e),o=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),i=r/o;return i>=No?o*=10:i>=Eo?o*=5:i>=Io&&(o*=2),n<t?-o:o}(t,n,e);switch((r=Zr(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(n));return null!=r.precision||isNaN(o=fo(i,a))||(r.precision=o),ao(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(o=mo(i,Math.max(Math.abs(t),Math.abs(n))))||(r.precision=o-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(o=ho(i))||(r.precision=o-2*("%"===r.type))}return io(r)}(r[0],r[r.length-1],null==t?10:t,e)},t.nice=function(e){null==e&&(e=10);var r,o,i=n(),a=0,s=i.length-1,c=i[a],l=i[s],u=10;for(l<c&&(o=c,c=l,l=o,o=a,a=s,s=o);u-- >0;){if((o=Bo(c,l,e))===r)return i[a]=c,i[s]=l,n(i);if(o>0)c=Math.floor(c/o)*o,l=Math.ceil(l/o)*o;else{if(!(o<0))break;c=Math.ceil(c*o)/o,l=Math.floor(l*o)/o}r=o}return t},t}var Jo,Ko={9606:{commonName:"Human",scientificName:"Homo sapiens",assemblies:{default:"GCF_000001405.26",GRCh38:"GCF_000001405.26",GRCh37:"GCF_000001405.13",NCBI36:"GCF_000001405.12"},hasGeneCache:!0},10090:{commonName:"Mouse",scientificName:"Mus musculus",assemblies:{default:"GCF_000001635.20",GRCm38:"GCF_000001635.20",MGSCv37:"GCF_000001635.18"},hasGeneCache:!0},9598:{commonName:"Chimpanzee",scientificName:"Pan troglodytes",assemblies:{default:"GCF_000001515.7","Pan_tro 3.0":"GCF_000001515.7"},hasGeneCache:!0},10116:{commonName:"Rat",scientificName:"Rattus norvegicus",assemblies:{default:"GCF_000001895.5","Rnor_6.0":"GCF_000001895.5"},hasGeneCache:!0},3702:{commonName:"Thale cress",scientificName:"Arabidopsis thaliana",assemblies:{default:"GCF_000001735.3",TAIR10:"GCF_000001735.3"}},4530:{commonName:"Rice",scientificName:"Oryza sativa",assemblies:{default:"GCA_001433935.1","IRGSP-1.0":"GCA_001433935.1"}},4577:{commonName:"Maize",scientificName:"Zea mays",assemblies:{default:"GCA_000005005.5","IRGSP-1.0":"GCA_001433935.1"}},4641:{commonName:"Banana",scientificName:"Musa acuminata",assemblies:{default:"mock"}},7227:{commonName:"Fly",scientificName:"Drosophila melanogaster",assemblies:{default:"GCA_000001215.4","Release 6 plus ISO1 MT":"GCA_000001215.4"}},7165:{commonName:"Mosquito",scientificName:"Anopheles gambiae",assemblies:{default:"GCF_000005575.2"}},746128:{commonName:"Aspergillis fumigatus",scientificName:"Aspergillis fumigatus",assemblies:{default:"GCF_000002655.1"}},227321:{scientificName:"Aspergillus nidulans",assemblies:{default:"GCF_000149205.2"}},5061:{commonName:"black mold",scientificName:"Aspergillus niger",assemblies:{default:"GCF_003184595.1"}},5062:{commonName:"koji",scientificName:"Aspergillus oryzae",assemblies:{default:"GCF_000184455.2"}},15368:{commonName:"stiff brome",scientificName:"Brachypodium distachyon",assemblies:{default:"GCF_000005505.3"}},60711:{commonName:"green monkey",scientificName:"Chlorocebus sabaeus",assemblies:{default:"GCF_015252025.1"}},7719:{commonName:"Vase tunicate",scientificName:"Ciona intestinalis",assemblies:{default:"GCF_000224145.3"}},9685:{commonName:"Cat",scientificName:"Felis catus",assemblies:{default:"GCF_000181335.3"},hasGeneCache:!0},9031:{commonName:"Chicken",scientificName:"Gallus gallus",assemblies:{default:"GCF_000002315.6"},hasGeneCache:!0},9593:{commonName:"Gorilla",scientificName:"Gorilla gorilla",assemblies:{default:"GCF_008122165.1"}},4513:{commonName:"Barley",scientificName:"Hordeum vulgare",assemblies:{default:"GCA_901482405.1"}},9541:{commonName:"Crab-eating macaque",scientificName:"Macaca fascicularis",assemblies:{default:"GCF_000364345.1"},hasGeneCache:!0},9544:{commonName:"Rhesus macaque",scientificName:"Macaca mulatta",assemblies:{default:"GCF_003339765.1"},hasGeneCache:!0},9597:{commonName:"Bonobo",scientificName:"Pan paniscus",assemblies:{default:"GCF_013052645.1"}},9615:{commonName:"Dog",scientificName:"Canis lupus familiaris",assemblies:{default:"GCF_014441545.1"},hasGeneCache:!0},4932:{commonName:"Yeast",scientificName:"Saccharomyces cerevisiae",assemblies:{default:"GCA_000146045.2",R64:"GCA_000146045.2"}},5833:{commonName:"malaria parasite",scientificName:"Plasmodium falciparum",assemblies:{default:"GCA_000002765.3",GCA_000002765:"GCA_000002765.3"}},6239:{commonName:"worm",scientificName:"Caenorhabditis elegans",assemblies:{default:"GCF_000002985.6"},hasGeneCache:!0},4081:{commonName:"tomato",scientificName:"Solanum lycopersicum",assemblies:{default:"GCF_000188115.4"}},4072:{commonName:"pepper",scientificName:"Capsicum annuum",assemblies:{default:"GCF_000710875.1"}}},Zo=Object.assign({},a,c,l,h,p);function ti(){return"assembly"in this.config&&/(GCF_|GCA_)/.test(this.config.assembly)}function ni(t){var n,e,r,o=document.scripts,i=Ideogram.version;if(!1===location.pathname.includes("/examples/vanilla/"))return"https://cdn.jsdelivr.net/npm/ideogram@".concat(i,"/dist/data/").concat(t);for(var a=0;a<o.length;a++)if(n=o[a],r=/ideogram/.test(n.src.split("/").slice(-1)),"src"in n&&r)return(e=n.src.split("//"))[0]+"//"+(e="/"+e[1].split("/").slice(0,-2).join("/"))+"/data/"+t;return"../data/"+t}function ei(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return fetch(t).then((function(e){if(e.ok)return e;if(!1===n)return ei(t.replace(".json",""),!0);throw Error("Fetch failed for "+t)}))}function ri(){return ni("bands/native/")}function oi(t){return Math.round(100*t)/100}function ii(t){call(this.onDidRotateCallback,t)}function ai(){return Zo.select(this.selector).node()}function si(t,n){var e=this.config,r=new Headers;return e.accessToken&&(r=new Headers({Authorization:"Bearer "+e.accessToken})),"text"===n?Zo.text(t,{headers:r}):Zo.json(t,{headers:r})}function ci(t){var n,e,r,o,i=this.organisms;for(e in t=hi(t),i)if(r=hi((n=i[e]).commonName),o=hi(n.scientificName),r===t||o===t)return e;return null}function li(t){return t in this.organisms?this.organisms[t].commonName:null}function ui(t){return t in this.organisms?this.organisms[t].scientificName:null}function hi(t){return void 0===t?"":t.toLowerCase().replace(/ /g,"-")}function fi(t){return/^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/i.test(t)}function di(t){var n={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};return t.toUpperCase().split("").reduce((function(t,e,r,o){return n[e]<n[o[r+1]]?t-n[e]:t+n[e]}),0)}function mi(t){var n=t.config,e="sans-serif";return n.fontFamily&&(e=n.fontFamily),"600 "+(n.annotLabelSize?n.annotLabelSize:13)+"px "+e}function pi(t,n){var e=mi(n),r=(pi.canvas||(pi.canvas=document.createElement("canvas"))).getContext("2d");r.font=e;var o=r.measureText(t),i=o.actualBoundingBoxRight,a=o.actualBoundingBoxLeft;return{width:Math.abs(a)+Math.abs(i),height:Math.abs(o.actualBoundingBoxAscent)+Math.abs(o.actualBoundingBoxDescent)}}Zo.select=Pt,Zo.selectAll=function(t){return"string"==typeof t?new Lt([document.querySelectorAll(t)],[document.documentElement]):new Lt([null==t?[]:y(t)],Tt)},Zo.scaleLinear=function t(){var n=Vo();return n.copy=function(){return Uo(n,t())},Qo.apply(n,arguments),$o(n)},Zo.max=function(t,n){var e;if(void 0===n){var r,o=m(t);try{for(o.s();!(r=o.n()).done;){var i=r.value;null!=i&&(e<i||void 0===e&&i>=i)&&(e=i)}}catch(t){o.e(t)}finally{o.f()}}else{var a,s=-1,c=m(t);try{for(c.s();!(a=c.n()).done;){var l=a.value;null!=(l=n(l,++s,t))&&(e<l||void 0===e&&l>=l)&&(e=l)}}catch(t){c.e(t)}finally{c.f()}}return e},Zo.easeExpIn=function(t){return n=1-+t,1.0009775171065494*(Math.pow(2,-10*n)-.0009765625);var n},Jo=[["gneg","#FFF","#FFF","#DDD"],["gpos25","#C8C8C8","#DDD","#BBB"],["gpos33","#BBB","#BBB","#AAA"],["gpos50","#999","#AAA","#888"],["gpos66","#888","#888","#666"],["gpos75","#777","#777","#444"],["gpos100","#444","#666","#000"],["acen","#FEE","#FEE","#FDD"],["noBands","#BBB","#BBB","#AAA"]];var gi='#_ideogram {padding-left: 5px;} #_ideogram .labeled {padding-left: 15px;} #_ideogram.labeledLeft {padding-left: 15px; padding-top: 15px;} #_ideogram text {font: 9px Tahoma; fill: #000;} #_ideogram .italic {font-style: italic;} #_ideogram .chromosome {cursor: pointer; fill: #AAA;}#_ideogram.no-rotate .chromosome {cursor: default;} #_ideogram .chrLabel, #_ideogram .annot {cursor: pointer;}#_ideogram .chrSetLabel {font-weight: bolder;}#_ideogram .ghost {opacity: 0.2;}#_ideogram .hidden {display: none;}#_ideogram .bandLabelStalk line {stroke: #AAA; stroke-width: 1;}#_ideogram .syntenyBorder {stroke:#AAA;stroke-width:1;}#_ideogram rect.cursor { fill: #F00; stroke: #F00; fill-opacity: .3; shape-rendering: crispEdges;}#_ideogram .brush .selection { fill: #F00; stroke: #F00; fill-opacity: .3; shape-rendering: crispEdges;}#_ideogram .noBands {fill: #AAA;}#_ideogram .gneg {fill: #FFF}#_ideogram .gpos25 {fill: #BBB}#_ideogram .gpos33 {fill: #AAA}#_ideogram .gpos50 {fill: #888}#_ideogram .gpos66 {fill: #666}#_ideogram .gpos75 {fill: #444}#_ideogram .gpos100 {fill: #000}#_ideogram .gpos {fill: #000}#_ideogram .acen {fill: #FDD}#_ideogram .stalk {fill: #CCE;}#_ideogram .gvar {fill: #DDF}#_ideogram.faint .gneg {fill: #FFF}#_ideogram.faint .gpos25 {fill: #EEE}#_ideogram.faint .gpos33 {fill: #EEE}#_ideogram.faint .gpos50 {fill: #EEE}#_ideogram.faint .gpos66 {fill: #EEE}#_ideogram.faint .gpos75 {fill: #EEE}#_ideogram.faint .gpos100 {fill: #DDD}#_ideogram.faint .gpos {fill: #DDD}#_ideogram.faint .acen {fill: #FEE}#_ideogram.faint .stalk {fill: #EEF;}#_ideogram.faint .gvar {fill: #EEF}#_ideogram .gneg {fill: url("#gneg")} #_ideogram .gpos25 {fill: url("#gpos25")} #_ideogram .gpos33 {fill: url("#gpos33")} #_ideogram .gpos50 {fill: url("#gpos50")} #_ideogram .gpos66 {fill: url("#gpos66")} #_ideogram .gpos75 {fill: url("#gpos75")} #_ideogram .gpos100 {fill: url("#gpos100")} #_ideogram .gpos {fill: url("#gpos100")} #_ideogram .acen {fill: url("#acen")} #_ideogram .stalk {fill: url("#stalk")} #_ideogram .gvar {fill: url("#gvar")} #_ideogram .noBands {fill: url("#noBands")} #_ideogram .chromosome {fill: url("#noBands")} ';function vi(t){var n;this.config=JSON.parse(JSON.stringify(t)),(n=this).chromosomesArray=[],n.coordinateSystem="iscn",n.maxLength={bp:0,iscn:0},n.chromosomes={},n.numChromosomes=0,n.config.debug||(n.config.debug=!1),n.config.dataDir||(n.config.dataDir=n.getDataDir()),n.config.container||(n.config.container="body"),n.selector=n.config.container+" #_ideogram",n.config.resolution||(n.config.resolution=""),n.config.orientation||(n.config.orientation="vertical"),n.config.brush||(n.config.brush=null),n.config.rows||(n.config.rows=1),"showChromosomeLabels"in n.config==0&&(n.config.showChromosomeLabels=!0),n.config.showNonNuclearChromosomes||(n.config.showNonNuclearChromosomes=!1),n.config.chromosomeScale||(n.config.chromosomeScale="absolute"),n.config.showTools||(n.config.showTools=!1),function(t){t.config.ploidy||(t.config.ploidy=1),t.config.ploidy>1&&(t.sexChromosomes={},t.config.sex||(t.config.sex="male"),2!==t.config.ploidy||t.config.ancestors||(t.config.ancestors={M:"#ffb6c1",P:"#add8e6"},t.config.ploidyDesc="MP"))}(this),function(t){t.config.showBandLabels||(t.config.showBandLabels=!1),"showFullyBanded"in t.config==0&&(t.config.showFullyBanded=!0),t.bandsToShow=[],t.bandData={}}(this),function(t){var n,e,r;t.config.chrHeight||(n=t.config.container,e=document.querySelector(n).getBoundingClientRect(),r="vertical"===t.config.orientation?e.height:e.width,"body"!==n&&0!==r||(r=400),t.config.chrHeight=r)}(this),function(t){var n,e;t.config.chrWidth||(n=10,(e=t.config.chrHeight)<900&&e>500?n=Math.round(e/40):e>=900&&(n=Math.round(e/45)),t.config.chrWidth=n)}(this),function(t){t.config.geometry&&"collinear"===t.config.geometry?"chrMargin"in t.config==0&&(t.config.chrMargin=0):(t.config.chrMargin||(1===t.config.ploidy?t.config.chrMargin=10:t.config.chrMargin=Math.round(t.config.chrWidth/4)),t.config.showBandLabels&&(t.config.chrMargin+=20))}(this),function(t,n){t.onLoad&&(n.onLoadCallback=t.onLoad),t.onLoadAnnots&&(n.onLoadAnnotsCallback=t.onLoadAnnots),t.onDrawAnnots&&(n.onDrawAnnotsCallback=t.onDrawAnnots),t.onBrushMove&&(n.onBrushMoveCallback=t.onBrushMove),t.onBrushEnd&&(n.onBrushEndCallback=t.onBrushEnd),t.onCursorMove&&(n.onCursorMoveCallback=t.onCursorMove),t.onDidRotate&&(n.onDidRotateCallback=t.onDidRotate),t.onWillShowAnnotTooltip&&(n.onWillShowAnnotTooltipCallback=t.onWillShowAnnotTooltip),t.onClickAnnot&&(n.onClickAnnotCallback=t.onClickAnnot)}(t,this),function(t){t.organisms=Object.assign({},Ko),t.organismsWithBands=Object.assign({},t.organisms)}(this),function(t){t.bump=Math.round(t.config.chrHeight/125),t.adjustedBump=!1,t.config.chrHeight<200&&(t.adjustedBump=!0,t.bump=4)}(this),function(t,n){t.chromosome&&(n.config.chromosomes=[t.chromosome],"showBandLabels"in t==0&&(n.config.showBandLabels=!0),"rotatable"in t==0&&(n.config.rotatable=!1))}(t,this),function(t){var n=t.config;n.chrLabelSize||(t.config.chrLabelSize=9),n.chrLabelColor||(t.config.chrLabelColor="#000"),n.fontFamily||(t.config.fontFamily="");var e="font-size: ".concat(n.chrLabelSize,"px"),r="fill: ".concat(n.chrLabelColor),o="font-family: ".concat(n.fontFamily);gi+="#_ideogram text {".concat(o,"; ").concat(e,"; ").concat(r,";}"),gi+="#_ideogramLabel text {".concat(o,";}")}(this),this.initAnnotSettings(),this.config.geometry&&"parallel"!==this.config.geometry||(this.config.chrMargin+=this.config.chrWidth,"heatmap"===this.config.annotationsLayout?this.config.chrMargin+=this.config.annotTracksHeight:this.config.chrMargin+=2*this.config.annotTracksHeight),this.init()}var yi=function(t){var n,e,r,o,i,a=t.config,s=a.annotationHeight||0;if("vertical"!==a.orientation){t.config.annotLabelHeight=12;var c=t.config.annotLabelHeight;if("demarcateCollinearChromosomes"in t.config==0&&(t.config.demarcateCollinearChromosomes=!0),n=document.querySelectorAll(".chromosome-set"),r=a.numAnnotTracks*(s+c+4)-a.chrWidth+1,e=function(t,n){var e,r,o,i,a,s,c,l={};for(e=[],r=0;r<t.length;r++)c=n.chromosomesArray[r].id.split("-")[1],o=0===r?r:r-1,i=n.chromosomesArray[o],0===r||c in l==0?(a=20,l[c]=1):(s=i.width,a=e[o]+s+(n.config.showChromosomeLabels?0:2)+n.config.chrMargin),e.push(a);return e}(n,t),function(t,n,e,r){var o,i,a,s,c,l,u,h=r.config,f=h.chrWidth,d=h.chrLabelSize;for(o=0;o<t.length;o++)i=t[o],s=n[o],a=r.chromosomesArray[o].id.split("-")[1],c=e+200*(l=h.taxids.indexOf(a)),0===l&&r.config.multiorganism?(u=d-4,c+=2*f+d):u=2*f+d+2,r.config.showChromosomeLabels&&(i.querySelector(".chrLabel").setAttribute("y",u),i.querySelector(".chrLabel").setAttribute("text-anchor","middle")),i.setAttribute("transform","translate("+s+","+c+")"),i.querySelector(".chromosome").setAttribute("transform","translate(-13, 10)");h.multiorganism&&function(t){t.config.taxids.forEach((function(n,e){var r=t.organisms[n],o=t.config,i=r.scientificName;Zo.select(t.selector).append("text").attr("class","genomeLabel italic").attr("x",5).attr("y",o.chrLabelSize+(200+3*o.chrWidth)*e).text(i)}))}(r)}(n,e,r,t),o=r+2*a.chrWidth+20,a.multiorganism){o*=8;var l=0;e.forEach((function(t){t>l&&(l=t)})),i=l+20}else i=e.slice(-1)[0]+20;Zo.select(t.selector).attr("width",i).attr("height",o),Zo.select("#_ideogramTrackLabelContainer").remove(),Zo.select("#_ideogramInnerWrap").insert("div",":first-child").attr("id","_ideogramTrackLabelContainer").style("position","absolute")}else!function(t){var n,e,r,o,i=t.config;if(t.config.annotLabelHeight=12,"demarcateCollinearChromosomes"in t.config==0&&(t.config.demarcateCollinearChromosomes=!0),e=function(t,n){var e,r,o,i,a,s,c,l={};for(e=[],r=0;r<t.length;r++)c=n.chromosomesArray[r].id.split("-")[1],o=0===r?r:r-1,i=n.chromosomesArray[o],0===r||c in l==0?(a=20,l[c]=1):(s=i.width,a=e[o]+s+(n.config.showChromosomeLabels?0:2)+n.config.chrMargin),e.push(a);return e}(n=document.querySelectorAll(".chromosome-set"),t),function(t,n,e,r){var o,i,a,s,c,l,u,h=r.config,f=h.chrLabelSize;for(o=0;o<t.length;o++){if(i=t[o],a=n[o]+23-f,l=r.chromosomesArray[o].id.split("-")[1],c=-40-200*(u=r.config.taxids.indexOf(l))-30-5,0===u?(s=-34,c+=2*r.config.chrWidth-16):s=2*r.config.chrWidth-24,h.showChromosomeLabels){var d=i.querySelector(".chrLabel > tspan");d.setAttribute("x",s),d.setAttribute("dy",f-8),i.querySelector(".chrLabel").setAttribute("text-anchor","start")}i.setAttribute("transform","rotate(90) translate("+a+","+c+")"),i.querySelector(".chromosome").setAttribute("transform","translate(-13, 10)")}!function(t){t.config.taxids.forEach((function(n,e){var r=t.organisms[n].scientificName;Zo.select(t.selector).append("text").attr("class","genomeLabel italic").attr("x",55+200*e).attr("y",10).text(r).attr("text-anchor","middle")}))}(r)}(n,e,0,t),o=Math.round(e.slice(-1)[0]+70),i.multiorganism){r*=8;var a=0;e.forEach((function(t){t>a&&(a=t)})),r=a+30}else r=xOffsets.slice(-1)[0]+30;Zo.select(t.selector).attr("height",r).attr("width",o),Zo.select("#_ideogramTrackLabelContainer").remove(),Zo.select("#_ideogramInnerWrap").insert("div",":first-child").attr("id","_ideogramTrackLabelContainer").style("position","absolute")}(t)};function bi(t){void 0!==t.timeout&&window.clearTimeout(t.timeout),t.rawAnnots=t.setOriginalTrackIndexes(t.rawAnnots),t.config.annotationsDisplayedTracks?t.annots=t.updateDisplayedTracks(t.config.annotationsDisplayedTracks):(t.annots=t.processAnnotData(t.rawAnnots),t.config.filterable&&t.initCrossFilter(),t.drawProcessedAnnots(t.annots))}function wi(t){var n=(new Date).getTime(),e=this,r=e.config,o=r.annotations;e.initDrawChromosomes(),r.annotationsPath&&function(t){t.rawAnnots?bi(t):function n(){t.timeout=setTimeout((function(){!t.rawAnnots||t.rawAnnots&&void 0!==t.rawAnnots.then?n():bi(t)}),50)}()}(e),function(t,n){var e,r,o,i;if(!0===t.showBandLabels&&(o=(new Date).getTime(),n.hideUnshownBandLabels(),i=(new Date).getTime(),t.debug&&console.log("Time in showing bands: "+(i-o)+" ms"),"vertical"===t.orientation))for(e=0;e<n.chromosomesArray.length;e++)r="#"+n.chromosomesArray[e].id,n.rotateChromosomeLabels(Zo.select(r),e);!0===t.showChromosomeLabels&&n.drawChromosomeLabels(n.chromosomes)}(r,e),r.brush?e.createBrush(r.brush):r.cursorPosition&&e.createClickCursor(r.cursorPosition),o&&(Array.isArray(o)?e.drawAnnots(o):(e.rawAnnots=o,e.afterRawAnnots(),bi(e))),function(t,n,e){var r=(new Date).getTime();t.debug&&console.log("Time in drawChromosome: "+(r-e)+" ms");var o=(new Date).getTime();t.debug&&console.log("Time constructing ideogram: "+(o-n)+" ms")}(r,t,n),e.setOverflowScroll(),"collinear"===r.geometry&&yi(e),e.onLoadCallback&&e.onLoadCallback()}var xi=function(){function t(n){u(this,t),this._config=n,this._description=this._normalize(this._config.ploidyDesc)}return f(t,[{key:"getChromosomesNumber",value:function(t){if(this._config.ploidyDesc){var n=this._config.ploidyDesc[t];return n instanceof Object?Object.keys(n)[0].length:n.length}return this._config.ploidy||1}},{key:"_normalize",value:function(t){var n,e,r=[];if(!t)return t;for(n in t)"string"==typeof(e=t[n])?("vertical"===this._config.orientation&&(e=e.split("").reverse()),r.push({ancestors:e,existence:this._getexistenceArray(e.length)})):r.push({ancestors:Object.keys(e)[0],existence:e[Object.keys(e)[0]]});return r}},{key:"_getexistenceArray",value:function(t){for(var n=[],e=0;e<t;e++)n.push("11");return n}},{key:"getSetSize",value:function(t){return this._description?this._description[t].ancestors.length:1}},{key:"getAncestor",value:function(t,n){return this._description?this._description[t].ancestors[n]:""}},{key:"exists",value:function(t,n,e){if(this._description){var r=this._description[t].existence[n][e];return Number(r)>0}return!0}}]),t}(),_i=function(){function t(n){u(this,t),this._node=n}return f(t,[{key:"getLabel",value:function(){return Zo.select(this._node.parentNode).select("text.chrLabel").text()}},{key:"getSetLabel",value:function(){return Zo.select(this._node.parentNode).select("text.chrSetLabel").text()}}]),t}(),Ai=function(){function t(n,e){if(u(this,t),this._config=n,this._ideo=e,this._ploidy=this._ideo._ploidy,this._translate=void 0,"chrSetMargin"in n)this.chrSetMargin=n.chrSetMargin;else{var r=this._config.chrMargin;this.chrSetMargin=this._config.ploidy>1?r:0}this._tickSize=8,this._isRotated=!1}return f(t,[{key:"_getLeftMargin",value:function(){return this.margin.left}},{key:"_getYScale",value:function(){return 20/this._config.chrWidth}},{key:"getChromosomeLabels",value:function(t){var n=new _i(t),e=[];return this._ideo.config.ploidy>1&&e.push(n.getSetLabel()),e.push(n.getLabel()),e.filter((function(t){return t.length>0}))}},{key:"getChromosomeBandLabelTranslate",value:function(t){var n,e,r,o=this._ideo,i=this._tickSize,a=o.config.orientation;return"vertical"===a?r="rotate(-90)translate("+(n=i)+","+(e=o.round(2+t.px.start+t.px.width/2))+")":"horizontal"===a&&(r="translate("+(n=o.round(-i+t.px.start+t.px.width/2))+","+(e=-10)+")"),{x:n,y:e,translate:r}}},{key:"didRotate",value:function(t,n){var e,r,o,i,a,s,c,l,u;r=(e=this._ideo).config.taxid,o=n.id.split("-")[0].replace("chr",""),i=(a=e.chromosomes[r][o]).bands,l=(c=Zo.select(n.parentNode)).attr("transform"),u=/scale\(.*\)/.exec(l),l=l.replace(u,""),c.attr("transform",l),s=a.width,(a=e.getChromosomeModel(i,o,r,t)).oldWidth=s,e.chromosomes[r][o]=a,e.drawChromosome(a),e.handleRotateOnClick(),e.rawAnnots&&(e.displayedTrackIndexes?e.updateDisplayedTracks(e.displayedTrackIndexes):(e.annots=e.processAnnotData(e.rawAnnots),e.drawProcessedAnnots(e.annots),e.config.filterable&&e.initCrossFilter())),!0===e.config.showBandLabels&&(e.drawBandLabels(e.chromosomes),e.hideUnshownBandLabels()),e.onDidRotateCallback&&e.onDidRotateCallback(a)}},{key:"rotate",value:function(t,n,e){var r,o,i,a;r=this._ideo,a=r.selector+" .chrSetLabel, "+r.selector+" .chrLabel",i=document.querySelector(r.selector).getBoundingClientRect(),o=Zo.selectAll(r.selector+" g.chromosome").filter((function(){return this!==e})),this._isRotated?(this._isRotated=!1,r.config.chrHeight=r.config.chrHeightOriginal,r.config.chrWidth=r.config.chrWidthOriginal,r.config.annotationHeight=r.config.annotationHeightOriginal,this.rotateBack(t,n,e,(function(){o.style("display",null),Zo.selectAll(a).style("display",null),r._layout.didRotate(n,e)}))):(this._isRotated=!0,o.style("display","none"),Zo.selectAll(a).style("display","none"),this.rotateForward(t,n,e,(function(){var t,o,a;r.config.chrHeightOriginal=r.config.chrHeight,r.config.chrWidthOriginal=r.config.chrWidth,r.config.annotationHeightOriginal=r.config.annotationHeight,"VerticalLayout"===r._layout._class?(o=i.width-20,a=window.innerWidth-20):(o=i.height-10,a=window.innerHeight-10),t=a<o?a:o,t-=2*r.config.chrMargin,r.config.chrHeight=t,r.config.chrWidth*=2.3,r.config.annotationHeight*=1.7,r._layout.didRotate(n,e)})))}},{key:"getChromosomeLabelClass",value:function(){return 1===this._config.ploidy?"chrLabel":"chrSetLabel"}},{key:"_getAdditionalOffset",value:function(){var t=this._config,n=t.annotationsNumTracks||t.numAnnotTracks||1;return(t.annotationHeight||0)*n}},{key:"_getChromosomeSetSize",value:function(t){return this._ploidy.getSetSize(t)*this._config.chrWidth*2+this.chrSetMargin}},{key:"getChromosomeSetLabelAnchor",value:function(){return"middle"}},{key:"getChromosomeLabelYPosition",value:function(){return-5.5}},{key:"getChromosomeSetLabelYPosition",value:function(t){return 1===this._config.ploidy?this.getChromosomeLabelYPosition(t):-2*this._config.chrWidth}}]),t}(),ki=function(t){i(e,t);var n=s(e);function e(t,r){var o;return u(this,e),(o=n.call(this,t,r))._class="VerticalLayout",o.margin={top:30,left:15},o}return f(e,[{key:"rotateForward",value:function(t,n,e,r){var o="translate(20, 25) "+this.getChromosomeScale(e);Zo.select(e.parentNode).transition().attr("transform",o).on("end",r);var i=this.getChromosomeLabels(e),a=1.3*(20+this._config.chrWidth);Zo.select(this._ideo.getSvg()).append("g").attr("class","tmp").selectAll("text").data(i).enter().append("text").attr("class",(function(t,n){return 0===n&&2===i.length?"chrSetLabel":null})).attr("x",0).attr("y",a).style("opacity",0).text(String).transition().style("opacity",1),this._ideo.config.orientation="horizontal"}},{key:"rotateBack",value:function(t,n,e,r){var o=this.getChromosomeScaleBack(e),i=this.getChromosomeSetTranslate(t);Zo.select(e.parentNode).transition().attr("transform",i+" "+o).on("end",r),Zo.selectAll(this._ideo.selector+" g.tmp").style("opacity",0).remove(),this._ideo.config.orientation="vertical"}},{key:"getHeight",value:function(){return this._config.chrHeight+1.5*this.margin.top}},{key:"getWidth",value:function(){return"97%"}},{key:"getChromosomeBandTickY1",value:function(){return 2}},{key:"getChromosomeBandTickY2",value:function(){return 10}},{key:"getChromosomeSetLabelTranslate",value:function(){return"rotate(-90)"}},{key:"getChromosomeBandLabelAnchor",value:function(){return null}},{key:"getChromosomeScale",value:function(t){var n,e;return n=Zo.select(this._ideo.selector).node().getBoundingClientRect(),e=t.getBoundingClientRect(),"scale("+n.width/e.height*.97+", "+this._getYScale()+")"}},{key:"getChromosomeScaleBack",value:function(t){var n,e,r;return e=(r=this._ideo.config).taxid,n=t.id.split("-")[0].replace("chr",""),"scale("+this._ideo.chromosomes[e][n].oldWidth/(3*r.chrHeight)*.97+", "+1/this._getYScale()+")"}},{key:"getChromosomeSetTranslate",value:function(t){return"rotate(90) translate("+this.margin.top+", -"+this.getChromosomeSetYTranslate(t)+")"}},{key:"getChromosomeSetYTranslate",value:function(t){var n,e=this._getAdditionalOffset(),r=this._config,o=r.chrMargin,i=r.chrWidth;if(!r.ploidyDesc)return"histogram"===r.annotationsLayout?o+t*(o+i+3)+2*r.barWidth:(n=i+t*(o+i)+2*e+("legendPad"in r?r.legendPad:0),e>0?n:n+4+2*t);if(!this._translate){var a;this._translate=[this._ploidy.getSetSize(0)*i*2];for(var s=1;s<this._config.ploidyDesc.length;s++)a=this._translate[s-1],this._translate[s]=a+this._getChromosomeSetSize(s-1)}return this._translate[t]}},{key:"getChromosomeSetLabelXPosition",value:function(){return this._config.chrWidth*this._config.ploidy/-2}},{key:"getChromosomeLabelXPosition",value:function(){return this._config.chrWidth/-2}}]),e}(Ai),Ci=function(t){i(e,t);var n=s(e);function e(t,r){var o;return u(this,e),(o=n.call(this,t,r))._class="HorizontalLayout",o.margin={left:20,top:30},o}return f(e,[{key:"_getLeftMargin",value:function(){var t=Ai.prototype._getLeftMargin.call(this);return this._config.ploidy>1&&(t*=1.8),t}},{key:"rotateForward",value:function(t,n,e,r){var o;Zo.select(e.parentNode).transition().attr("transform","rotate(90) translate(30, -37.5) ").on("end",r),o=this.getChromosomeLabels(e),Zo.select(this._ideo.getSvg()).append("g").attr("class","tmp").selectAll("text").data(o).enter().append("text").attr("class",(function(t,n){return 0===n&&2===o.length?"chrSetLabel":null})).attr("x",26).attr("y",(function(t,n){return 12*(n+1+o.length%2)})).style("text-anchor","middle").style("opacity",0).text(String).transition().style("opacity",1),this._ideo.config.orientation="vertical"}},{key:"rotateBack",value:function(t,n,e,r){var o=this.getChromosomeSetTranslate(t);Zo.select(e.parentNode).transition().attr("transform",o).on("end",r),Zo.selectAll(this._ideo.selector+" g.tmp").style("opacity",0).remove(),this._ideo.config.orientation="horizontal"}},{key:"getHeight",value:function(t){void 0===t&&(t=this._config.taxids[0]);var n=this._config.chromosomes[t].length,e=this.getChromosomeSetYTranslate(n-1);return(e+=this._getChromosomeSetSize(n-1))+2*this._getAdditionalOffset()}},{key:"getWidth",value:function(){return this._config.chrHeight+1.5*this.margin.top}},{key:"getChromosomeSetLabelAnchor",value:function(){return"end"}},{key:"getChromosomeBandLabelAnchor",value:function(){return null}},{key:"getChromosomeBandTickY1",value:function(){return 2}},{key:"getChromosomeBandTickY2",value:function(){return 10}},{key:"getChromosomeSetLabelTranslate",value:function(){return null}},{key:"getChromosomeSetTranslate",value:function(t){return"translate("+this._getLeftMargin()+", "+this.getChromosomeSetYTranslate(t)+")"}},{key:"getChromosomeSetYTranslate",value:function(t){if(!this._config.ploidyDesc)return this._config.chrMargin*(t+1);if(!this._translate){this._translate=[1];for(var n=1;n<this._config.ploidyDesc.length;n++)this._translate[n]=this._translate[n-1]+this._getChromosomeSetSize(n-1)}return this._translate[t]}},{key:"getChromosomeSetLabelXPosition",value:function(t){return 1===this._config.ploidy?this.getChromosomeLabelXPosition(t):-20}},{key:"getChromosomeSetLabelYPosition",value:function(t){var n=this._ploidy.getSetSize(t),e=this._config,r=e.chrMargin,o=e.chrWidth;return 1===e.ploidy?o/2+3:n*r/2}},{key:"getChromosomeLabelXPosition",value:function(){return-8}},{key:"getChromosomeLabelYPosition",value:function(){return this._config.chrWidth}}]),e}(Ai),Ti=function(t){i(e,t);var n=s(e);function e(t,r){var o;return u(this,e),(o=n.call(this,t,r))._class="PairedLayout",o.margin={left:30},o}return f(e,[{key:"getHeight",value:function(){return this._config.chrHeight+1.5*this.margin.left}},{key:"getWidth",value:function(){return"97%"}},{key:"getChromosomeBandTickY1",value:function(t){return t%2?this._config.chrWidth:2*this._config.chrWidth}},{key:"getChromosomeBandTickY2",value:function(t){var n=this._config.chrWidth;return t%2?n-this._tickSize:2*n+this._tickSize}},{key:"getChromosomeBandLabelAnchor",value:function(t){return t%2?null:"end"}},{key:"getChromosomeBandLabelTranslate",value:function(t,n){var e=n%2?10:-this._config.chrWidth-10,r=this._ideo.round(t.px.start+t.px.width/2)+3;return{x:r,y:r,translate:"rotate(-90) translate("+e+", "+r+")"}}},{key:"getChromosomeLabelXPosition",value:function(){return-this._tickSize}},{key:"getChromosomeSetLabelXPosition",value:function(){return this._config.chrWidth/-2}},{key:"getChromosomeSetLabelTranslate",value:function(){return"rotate(-90)"}},{key:"getChromosomeSetTranslate",value:function(t){var n=this.getChromosomeSetYTranslate(t);return"rotate(90) translate("+this.margin.left+", -"+n+")"}},{key:"getChromosomeSetYTranslate",value:function(t){return 200*(t+1)}}]),e}(Ai),Li=function(t){i(e,t);var n=s(e);function e(t,r){var o;u(this,e),(o=n.call(this,t,r))._class="SmallLayout",o.margin={left:36.5,top:10};var i=o._ideo.getTaxid(o._ideo.config.organism);o.chrs=t.chromosomes[i];var a=o.chrs.length;return o.chrsPerRow=Math.ceil(a/t.rows),o}return f(e,[{key:"getHeight",value:function(){var t=1.25*this._config.chrHeight;return this._config.rows*(t+this.margin.top)}},{key:"getWidth",value:function(){return"97%"}},{key:"getChromosomeBandLabelTranslate",value:function(){}},{key:"getChromosomeSetLabelTranslate",value:function(){return"rotate(-90)"}},{key:"getChromosomeSetTranslate",value:function(t){var n,e;return t>this.chrsPerRow-1?(n=this.margin.left+1.3*this._config.chrHeight,e=this.getChromosomeSetYTranslate(t-this.chrsPerRow)):(n=this.margin.left,e=this.getChromosomeSetYTranslate(t)),"rotate(90) translate("+n+", -"+e+")"}},{key:"getChromosomeSetYTranslate",value:function(t){var n=.3*this._getAdditionalOffset();return this.margin.left*t+this._config.chrWidth+2*n+n*t}},{key:"getChromosomeSetLabelXPosition",value:function(t){return(this._ploidy.getSetSize(t)*this._config.chrWidth+20)/-2+(this._config.ploidy>1?0:this._config.chrWidth)}},{key:"getChromosomeLabelXPosition",value:function(){return this._config.chrWidth/-2}}]),e}(Ai);function Si(t){var n=this;n.config.annotationsPath&&n.fetchAnnots(n.config.annotationsPath),function(t){if("ploidyDesc"in t.config&&"string"==typeof t.config.ploidyDesc){for(var n=[],e=0;e<t.numChromosomes;e++)n.push(t.config.ploidyDesc);t.config.ploidyDesc=n}t._ploidy=new xi(t.config)}(n),n._layout=function(t){var n=t.config;return"perspective"in n&&"comparative"===n.perspective?new Ti(n,t):"rows"in n&&n.rows>1?new Li(n,t):"vertical"===n.orientation?new ki(n,t):"horizontal"===n.orientation?new Ci(n,t):new ki(n,t)}(n),function(t){Zo.selectAll(t.config.container+" #_ideogramOuterWrap").remove(),Zo.select(t.config.container).append("div").attr("id","_ideogramOuterWrap").append("div").attr("id","_ideogramTrackLabelContainer").style("position","absolute"),Zo.select(t.config.container+" #_ideogramOuterWrap").append("div").attr("id","_ideogramMiddleWrap").style("position","relative").style("overflow-x","auto").style("transform","translateZ(0)").append("div").attr("id","_ideogramInnerWrap").append("svg").attr("id","_ideogram").attr("class",function(t){var n="";return t.config.showChromosomeLabels&&("horizontal"===t.config.orientation?n+="labeledLeft ":n+="labeled "),!1===t.config.rotatable&&(n+="no-rotate "),t.config.annotationsLayout&&"overlay"===t.config.annotationsLayout&&(n+="faint"),n}(t)).attr("width",t._layout.getWidth()).attr("height",t._layout.getHeight()).html(t.getBandColorGradients())}(n),n.isOnlyIdeogram=1===document.querySelectorAll("#_ideogram").length,function(t){Zo.select(t.config.container+" #_ideogramOuterWrap").append("div").attr("class","_ideogramTooltip").attr("id","_ideogramTooltip").style("opacity",0).style("position","fixed").style("text-align","center").style("padding","4px").style("font","12px sans-serif").style("background","white").style("border","1px solid black").style("border-radius","5px").style("z-index","1000")}(n),n.finishInit(t)}var Mi="";function Pi(t,n,e){return e.config.dataDir+t[n]}function Ni(t,n,e){var r=e.config.ploidy;return"sex"in e.config&&(2===r&&e.sexChromosomes.index+1===n||"female"===e.config.sex&&"Y"===t.name)}function Ei(t,n,e,r){var o,i,a,s,c;for(o=0;o<n.length;o++)a=n[o],void 0!==t&&(i=t[o]),c=o+r.config.taxids.indexOf(e),s=r.getChromosomeModel(i,a,e,c),"string"!=typeof a&&(a=a.name.split(" ").slice(-1)[0].replace("chr","")),r.chromosomes[e][a]=s,r.chromosomesArray.push(s),Ni(s,o,r)||r.drawChromosome(s)}function Ii(t,n){"undefined"!=typeof chrBands&&t.length>=chrBands.length/2&&(n.coordinateSystem="bp")}function Bi(){var t,n,e,r,o=this,i=o.config.taxids;for(n=0;n<i.length;n++)t=i[n],e=o.config.chromosomes[t],r=o.bandsArray[t],o.config.showNonNuclearChromosomes||(e=e.filter((function(t){return"MT"!==t})),void 0!==r&&(r=r.filter((function(t){return"MT"!==t[0].chr})))),Ii(e,o),o.chromosomes[t]={},o.setSexChromosomes(e),Ei(r,e,t,o),o.config.showBandLabels&&o.drawBandLabels(o.chromosomes),o.handleRotateOnClick(),o._gotChrModels=!0}function Di(){var t=this;"rotatable"in t.config&&!1===t.config.rotatable?Zo.selectAll(t.selector).style("cursor","default"):Zo.selectAll(t.selector+" .chromosome-set").on("click",(function(){var n=this.children[1];t.rotateAndToggleDisplay(n)}))}function Fi(){call(this.onLoadCallback)}function Oi(t,n,e){var r,o,i,a=e.config;r=e.organisms[t],a.assembly||(e.config.assembly="default"),o=r.assemblies,i=function(t,n,e){var r=e.organisms[t],o=[hi(r.scientificName)],i=r.assemblies,a=e.config.resolution;return n!==i.default&&o.push(n),"9606"===t&&(n in i==="false"&&Object.values(i).includes(config.assembly)||""!==a&&850!==a)&&o.push(a),o=o.join("-"),["9606","10090","10116"].includes(t)&&!e.config.showFullyBanded&&(o+="-no-bands"),o+".json"}(t,e.assemblyIsAccession()?a.assembly:o[a.assembly],e);var s="-1"===t;return(t in e.organismsWithBands||s)&&(n[t]=i),n}function Ri(t,n,e,r){return function(t,n,e){var r=Pi(t,n,e);return(!(void 0!==window.chrBands&&""===Mi)||Mi!==r)&&function(t){return"assembly"in t.config&&!1===/(GCA_)/.test(t.config.assembly)}(e)&&n in t}(n,t,r)?function(t,n,e,r){var o=Pi(t,n,r);return r.numBandDataResponses||(r.numBandDataResponses=0),ei(o).then((function(n){return n.json().then((function(e){Mi=o,delete window.chrBands,window.chrBands=e.chrBands,function(t,n,e,r){var o,i,a;for(o in n)a=n[o],t.includes(a)&&""!==a&&(i=o);r.bandData[i]=e}(n.url,t,chrBands,r)}))}))}(n,t,0,r).then((function(){return r.processBandData(t)})):new Promise((function(n){r.processBandData(t),n([t,void 0])}))}var ji={},zi={},Hi={};function Gi(t){var n=(t=t||this).config.container;Hi[n]?(zi[n]=!0,ji[n]=t):(Hi[n]=!0,function(t){return new Promise((function(n){var e=t.config.organism;"number"==typeof e?t.getOrganismFromEutils(e,(function(){t.getTaxids(n)})):t.getTaxids(n)}))}(t).then((function(e){var r=e[0];t.config.taxid=r,t.config.taxids=e,t.organismScientificName=t.getScientificName(t.config.taxid),function(t,n,e){var r,o,i,a=[];for(i in r={},Ko)r[i]="";for(o=0;o<t.length;o++)r=Oi(i=String(t[o]),r,e),a.push(Ri(i,r,0,e));Promise.all(a).then((function(t){var r,i,a;for(o=0;o<t.length;o++)i=(r=t[o])[0],a=r[1],"bandsArray"in e==0&&(e.bandsArray={}),e.bandsArray[i]=a;e.writeContainer(n)}))}(e,(new Date).getTime(),t),Hi[n]=!1,zi[n]&&(zi[n]=!1,Gi(ji[n]))})))}var Wi=function(){function t(n,e){u(this,t),this.rawAnnots=this.parseBed(n,e)}return f(t,[{key:"parseGenomicCoordinates",value:function(t,n){var e,r,o,i;return e=t[0],r=parseInt(t[1],10),i=(o=parseInt(t[2],10))-r,n&&(e=e.slice(3)),[e,r,o,i]}},{key:"parseAnnotFromTsvLine",value:function(n,e,r){var i,a,s,c,l,u,h,f,d=n.split(/\s/g);return c=(i=o(this.parseGenomicCoordinates(d,r),4))[0],l=i[1],stop=i[2],length=i[3],-1===(s=e.indexOf(c))?[null,null]:(a=["",l,length,0],d.length>=4&&(f=d[3],a[0]=f),d.length>=8&&(u=d[8].split(","),h=t.rgbToHex(u[0],u[1],u[2]),a.push(h)),[s,a])}},{key:"parseRawAnnots",value:function(t,n,e,r){var i,a,s,c,l,u;for(u=!0,!1===isNaN(parseInt(e[n],10))&&(u=!1),i=n;i<e.length;i++){var h;a=e[i],s=(h=o(this.parseAnnotFromTsvLine(a,r,u),2))[0],c=h[1],null!==s&&t[s].annots.push(c)}return l=["name","start","length","trackIndex"],e[n].length>=8&&l.push("color"),{keys:l,annots:t}}},{key:"parseBed",value:function(t,n){var e,r,o,i,a=[],s=t.split(/\r\n|\n/);for(r=Object.keys(n.chromosomes[n.config.taxid]),e=0;e<r.length;e++)o=r[e],a.push({chr:o,annots:[]});return i=0,("chr"===s[0].slice(0,3)||isNaN(parseInt(s[0],10)))&&(i=1),this.parseRawAnnots(a,i,s,r)}}],[{key:"componentToHex",value:function(t){var n=parseInt(t,10).toString(16);return 1===n.length?"0"+n:n}},{key:"rgbToHex",value:function(n,e,r){return"#"+t.componentToHex(n)+t.componentToHex(e)+t.componentToHex(r)}}]),t}(),qi=function(){function t(n,e){u(this,t),this.rawAnnots=this.parseTsv(n,e)}return f(t,[{key:"parseGenomicCoordinates",value:function(t){var n,e;return[t[1],n=parseInt(t[2],10),n+(e=parseInt(t[3],10)),e]}},{key:"getValueColumnIndex",value:function(t,n){var e;return n.split(/\t/g).forEach((function(n,r){n.includes(t)&&(e=r)})),e}},{key:"parseAnnotFromTsvLine",value:function(t,n,e){var r,i,a,s,c,l,u,h,f,d=t.split(/\t/g);return s=(r=o(this.parseGenomicCoordinates(d),4))[0],c=r[1],stop=r[2],length=r[3],-1===(a=e.indexOf(s))?[null,null]:(i=[d[0],c,length,0],n.includes("color")&&(l=d[this.getValueColumnIndex("color",n)],i.push(l)),n.includes("full_name")&&(u=d[this.getValueColumnIndex("full_name",n)],i.push(u)),n.includes("citations")&&(f=d[this.getValueColumnIndex("citations",n)],i.push(f)),n.includes("significance")&&(h=d[this.getValueColumnIndex("significance",n)],i.push(h)),[a,i])}},{key:"parseRawAnnots",value:function(t,n,e,r){var i,a,s,c,l,u=e[0];for(i=n;i<e.length;i++){var h;0!==(a=e[i]).length&&(s=(h=o(this.parseAnnotFromTsvLine(a,u,r),2))[0],c=h[1],null!==s&&t[s].annots.push(c))}return l=["name","start","length","trackIndex"],u.includes("color")&&l.push("color"),u.includes("full_name")&&l.push("fullName"),u.includes("citations")&&l.push("citations"),u.includes("significance")&&l.push("significance"),{keys:l,annots:t}}},{key:"parseTsv",value:function(t,n){var e,r,o,i,a,s=[],c=t.split(/\r\n|\n/);for(r=Object.keys(n.chromosomes[n.config.taxid]),e=0;e<r.length;e++)o=r[e],s.push({chr:o,annots:[]});if(i=0,("chr"===c[0].slice(0,3)||isNaN(parseInt(c[0],10)))&&(i=1),a=this.parseRawAnnots(s,i,c,r),1===i&&c[0].includes("citations")){var l=c[0].split("\t"),u=l[6].split("citations_")[1];a.annots=a.annots.map((function(t){return t.annots=t.annots.map((function(t){return t[6]=t[6]+" citations "+u.replace(/_/g," "),t})),t}))}return a}}]),t}(),Yi=["name","start","length","trackIndex","trackIndexOriginal","color"],Xi={3:["00B","DDD","F00"],5:["00D","66D","DDD","F88","F00"],17:["00D","00D","00D","00D","00D","44D","44D","DDD","DDD","DDD","DDD","F88","F66","F22","F22","F00","F00","F00"]};function Ui(t){var n,e,r;if(t.rawAnnots.metadata&&t.rawAnnots.metadata.trackLabels)n=t.rawAnnots.metadata.trackLabels;else if(t.config.heatmaps)for(n=[],e=t.config.heatmaps,r=0;r<e.length;r++)n.push(e[r].key);else n=t.rawAnnots.keys.slice(0).filter((function(t){return!Yi.includes(t)}));return t.displayedTrackIndexes&&(n=n.filter((function(n,e){return t.displayedTrackIndexes.includes(e+1)}))),n}function Vi(t){var n,e,r=t.rawAnnots;if(!r.metadata||r.metadata.heatmapThresholds||t.config.heatmapThresholds)return n=t.config.heatmapThresholds?t.config.heatmapThresholds:t.rawAnnots.metadata.heatmapThresholds,e=Xi[n.length+1],(n=n.map((function(t,n){return[t,"#"+e[n]]}))).push(["+","#"+e.slice(-1)[0]]),n}function Qi(t,n,e,r,o){return t===n&&"+"===o&&e>r||e===o||0!==t&&t!==n&&e<=o&&e>r||0===t&&e<=o}function $i(t,n){var e,r,o,i,a,s,c,l;for(e=0;e<t.length;e++)r=t.length-1,i=(o=t[e])[0],a=parseFloat(i),!1===isNaN(a)&&(i=a),0!==e&&(c=parseFloat(t[e-1][0])),s=o[1],Qi(e,r,n,c,i)&&(l=s);return l}function Ji(t,n,e){var r,o,i,a,s,c=t.width,l=[],u=e.config.annotLabelHeight,h=e.config.numAnnotTracks;for(r=0;r<h;r++)i=e.config.annotationHeight+u+4,s=t.id+"-canvas-"+r,o=n,t.chrIndex>0&&(o+=e.config.chrMargin*t.chrIndex-1),a=Zo.select(e.config.container+" #_ideogramInnerWrap").append("canvas").attr("id",s).attr("width",c+1).attr("height",i).style("position","absolute").style("left",o+"px").style("top",i*r+1+"px").nodes()[0].getContext("2d"),l.push([a,t]);return l}function Ki(t,n,e){var r,o,i,a,s=e.config.annotLabelHeight,c=e.config.annotationHeight,l=e.config.demarcateCollinearChromosomes,u=c+s+4;for(r=0;r<t.length;r++)if(i=n[(o=t[r]).trackIndex][0],a=n[o.trackIndex][1],i.fillStyle=o.color,l){if(o.startPx<1||o.startPx>a.width-1)continue;i.fillRect(o.startPx,1,.5,u)}else i.fillRect(o.startPx,s+1,.5,c);if(l)for(r=0;r<n.length;r++)i=n[r][0],a=n[r][1],i.fillStyle="#555",0===a.chrIndex&&i.fillRect(0,0,1,u),i.fillRect(a.width-1,0,1.1,u),i.fillRect(0,0,a.width+1,1),e.config.chrMargin&&i.fillRect(0,0,1.1,u)}function Zi(t,n,e){var r,o,i,a=e.config.annotationHeight,s=e._layout.margin.top;for(i=t.values,r=0;r<i.length;r++)n.fillStyle=i[r],o=(r-1)*a,n.fillRect(o,t.startPx+s,a,2)}function ta(t,n,e,r,o,i,a){var s,c,l,u,h,f,d,m=a.config.heatmapThresholds;for(s=0;s<e.annots.length;s++){for(u=e.annots[s],(l={}).values=[],c=0;c<3;c++)l[i[c]]=u[c];for(c=3;c<i.length;c++)d=$i(m,u[c]),l.values.push(d);h=l.start+l.length,l.chr=e.chr,l.chrIndex=o,l.startPx=a.convertBpToPx(r,l.start),f=a.convertBpToPx(r,h),l.px=Math.round((l.startPx+f)/2),t.push(l)}return t.shift(),[t,n]}function na(t){!1!==t.config.showTrackLabel&&(t.hideTrackLabelTimeout=window.setTimeout((function(){Zo.select(t.config.container+" #_ideogramTrackLabel").transition().duration(500).style("opacity",0)}),250))}function ea(t,n,e,r){var o,i,a,s,c,l=[],u=r.config.numAnnotTracks;for(o=0;o<u;o++)a=r.config.annotationHeight,c=t.id+"-canvas-"+o,i=n-a*(u-o)-7,s=Zo.select(r.config.container+" #_ideogramInnerWrap").append("canvas").attr("id",c).attr("width",a).attr("height",e).style("position","absolute").style("left",i+"px").nodes()[0].getContext("2d"),l.push(s);return l}function ra(t,n,e,r){var o,i,a,s;for(o=0;o<t.length;o++)(a=n[(i=t[o]).trackIndex]).fillStyle=i.color,s=i.trackIndex-1,a.fillRect(s,i.startPx+r,e,.5)}function oa(t){var n,e,r,i,a=this,s=a.config,c=a._layout.margin.top,l=s.chrHeight+c;if("collinear"===s.geometry)return function(t,n){var e,r,o,i,a=0,s=n.config.showChromosomesLabels?2:-.1;for(Zo.select(n.selector).classed("labeledLeft",!1),Zo.selectAll(n.config.container+" canvas").remove(),o=0;o<t.length;o++)e=t[o].annots,i=n.chromosomesArray[o],0===o?r=12:(r=a+n.chromosomesArray[o-1].width+14,a+=n.chromosomesArray[o-1].width+s),Ki(e,Ji(i,r,n),n);(function(t){!function(t,n){var e,r,o,i,a=n.config.annotLabelHeight;for(i=n.config.demarcateCollinearChromosomes?2:0,(o=Zo.select(n.config.container+" #_ideogramTrackLabelContainer")).html(""),r=n.config.annotationHeight+a+4,e=0;e<t.length;e++)o.style("position","absolute").append("div").attr("class","_ideogramTrackLabel").style("opacity",1).style("position","absolute").style("text-align","center").style("padding","1px").style("font","11px sans-serif").style("background","white").style("line-height","10px").style("z-index","5").style("left",11+i+"px").style("top",r*e+i+"px").style("width","max-content").style("transform-origin","bottom left").style("text-align","left").html(t[e])}(Ui(t),t)})(n),n.onDrawAnnotsCallback&&n.onDrawAnnotsCallback()}(t,a);if("heatmap-2d"===s.annotationsLayout)return function(t,n){var e,r,o=n.config.container,i=n._layout.margin.top,a=n.config.chrHeight+i,s=n.config.annotationHeight*t[0].values.length;for(Zo.selectAll(o+" canvas").remove(),Zo.select(o+" #_ideogramInnerWrap").style("max-width",s+"px"),Zo.select(o+" #_ideogram").attr("width",s),e=function(t,n,e,r){var o,i;return i=t.id+"-canvas",o=2*r.config.chrWidth+r.config.annotationHeight-.5,Zo.select(r.config.container+" #_ideogramInnerWrap").append("canvas").attr("id",i).attr("width",e).attr("height",n).style("position","absolute").style("left",o+"px").style("top","0px").nodes()[0].getContext("2d")}(n.chromosomesArray[0],a,s,n),r=0;r<t.length;r++)Zi(t[r],e,n);n.onDrawAnnotsCallback&&n.onDrawAnnotsCallback()}(t,a);for(Zo.selectAll(a.config.container+" canvas").remove(),function(t){Zo.select(t.config.container+" #_ideogramTrackLabelContainer").append("div").attr("id","_ideogramTrackLabel").style("opacity",0).style("position","absolute").style("text-align","center").style("padding","1px").style("font","11px sans-serif").style("background","white").style("line-height","10px").style("z-index","9000")}(a),r=0;r<t.length;r++)n=t[r].annots,i=a.chromosomesArray[r],e=a.config.chrWidth,ra(n,ea(i,a._layout.getChromosomeSetYTranslate(r),l,a),e,c);Zo.selectAll(a.config.container+" canvas").on("mouseover",(function(){!function(t,n){var e,r,i,a;clearTimeout(n.hideTrackLabelTimeout),i=(i=Ui(n)).join("<br>"),Zo.select(n.config.container+" #_ideogramTrackLabel").interrupt().style("top","").style("left","").style("transform",null).style("transform","rotate(-90deg)").html(i),e=function(t,n,e){var r,o,i,a,s;return r=n.id.split("-").slice(0,-1).join("-")+"-0",o=Zo.select(e.config.container+" #"+r).nodes()[0].getBoundingClientRect(),i=Zo.select(e.config.container+" #_ideogramTrackLabel").nodes()[0].getBoundingClientRect(),a=Zo.select(e.config.container).nodes()[0].getBoundingClientRect(),s=Math.round(o.left+i.width)-o.width-1,[s-=a.left-7,-(t.split("<br>").length-2)*o.width+2]}(i,t,n),a=(r=o(e,2))[0],function(t,n,e){Zo.select(e.config.container+" #_ideogramTrackLabel").style("opacity",1).style("left",n+"px").style("top",t+"px").style("width","max-content").style("transform-origin","bottom left").style("text-align","left").on("mouseover",(function(){clearTimeout(e.hideTrackLabelTimeout)})).on("mouseout",(function(){na(e)}))}(r[1],a,n)}(this,a)})).on("mouseout",(function(){na(a)})),a.onDrawAnnotsCallback&&a.onDrawAnnotsCallback()}function ia(t,n,e){var r,o,i,a,s,c,l,u=[];for(r=0;r<n.length;r++)for(i=n[r],o=0;o<t.length;o++)a=i.slice(0,3),s=i[t[o]],c=$i(e.config.heatmaps[o].thresholds,s),l=o,a.push(l,c,s),u.push(a);return u}function aa(t){var n,e,r,o,i=(new Date).getTime(),a=t.keys,s=t.annots,c=this;for(r=[],o=0;o<c.config.heatmaps.length;o++)e=c.config.heatmaps[o].key,r.push(a.indexOf(e));n=function(t,n,e){var r,o,i,a,s=[];for(a=0;a<n.length;a++)o=(r=n[a]).chr,i=ia(t,r.annots,e),s.push({chr:o,annots:i});return s}(r,s,c),a.splice(3,0,"trackIndex"),a.splice(4,0,"color"),c.rawAnnots.keys=a,c.rawAnnots.annots=n,function(t,n){var e=(new Date).getTime();n.config.debug&&console.log("Time in deserializeAnnotsForHeatmap: "+(e-t)+" ms")}(i,c)}function sa(){call(this.onLoadAnnotsCallback)}function ca(){call(this.onDrawAnnotsCallback)}function la(){!1!==this.config.showAnnotTooltip&&(this.hideAnnotTooltipTimeout=window.setTimeout((function(){Zo.select("._ideogramTooltip").transition().duration(500).style("opacity",0).style("pointer-events","none")}),250))}function ua(t){call(this.onWillShowAnnotTooltipCallback,t)}function ha(t){this.onClickAnnotCallback(t)}function fa(t,n){var e,r,i,a,s=Number(n.getAttribute("cx")),c=Number(n.getAttribute("cy")),l=this;!1!==l.config.showAnnotTooltip&&(clearTimeout(l.hideAnnotTooltipTimeout),l.onWillShowAnnotTooltipCallback&&(t=l.onWillShowAnnotTooltipCallback(t)),(a=Zo.select("._ideogramTooltip")).interrupt(),i=n.getScreenCTM().translate(s,c),e=function(t){var n,e,r;return r="chr"+t.chr+":"+t.start.toLocaleString(),t.length>0&&(r+="-"+t.stop.toLocaleString()),n=r,e=24,t.name&&(n=(t.displayName?t.displayName:t.name)+"<br/>"+n,e+=8),[n,e]}(t),function(t,n,e,r,o){t.html(n).style("opacity",1).style("left",e.e+"px").style("top",e.f-r+"px").style("font-family",o.config.fontFamily).style("pointer-events",null).on("mouseover",(function(){clearTimeout(o.hideAnnotTooltipTimeout)})).on("mouseout",(function(){o.startHideAnnotTooltipTimeout()}))}(a,(r=o(e,2))[0],i,r[1],l))}function da(t){return"ideogramLabel_"+t.domId}function ma(t,n,e){Zo.selectAll("._ideoActive").classed("_ideoActive",!1),Zo.select("#"+n).attr("class","_ideogramLabel "+t),Zo.select("#"+e+" > path").attr("class",t)}function pa(t,n){var e,r,o=t.target,i=t.type;if(Array.from(o.classList).includes("_ideogramLabel"))e=o.id,r=o.id.split("ideogramLabel_")[1],Zo.select("#"+r+" path").dispatch(i);else{var a=o.parentElement;e="ideogramLabel_"+a.id,r=a.id}"mouseout"===i&&(n.time.prevTooltipOff=performance.now(),n.time.prevTooltipAnnotDomId=r),"mouseover"===i?(clearTimeout(window._ideoActiveTimeout),ma("_ideoActive",e,r)):window._ideoActiveTimeout=window.setTimeout((function(){ma("",e,r)}),250)}function ga(t,n){var e,r=!1;return n.annots.forEach((function(n){r||n.annots.forEach((function(n){r||n.name===t&&(e=n,r=!0)}))})),e}function va(t,n){var e,r,o,i,a,s,c,l=n.config;return null===(e=document.querySelector("#"+t.domId))?null:(r=e.getBoundingClientRect(),o=document.querySelector("#_ideogram").getBoundingClientRect(),i=pi(t.name,n).width,i+=l.fontFamily?9:7,a=l.annotLabelSize?l.annotLabelSize:13,{top:s=r.top-o.top+a-1,bottom:s+a,right:(c=r.left-o.left-i)+i,left:c,width:i,height:a})}function ya(t,n,e){var r,o=this,i=va(r=ga(t,o),o);null!==i&&function(t,n,e){e.didSetLabelStyle||(document.querySelector("#_ideogramInnerWrap").insertAdjacentHTML("afterbegin","\n <style>\n #_ideogram .annot path, ._ideogramLabel {\n cursor: pointer;\n }\n\n #_ideogram .annot path {\n stroke-width: 1px;\n stroke: white;\n stroke-linejoin: bevel;\n }\n\n #_ideogram ._ideogramLabel._ideoActive {\n fill: #77F !important;\n stroke: #F0F0FF !important;\n }\n\n #_ideogram .annot > ._ideoActive {\n stroke: #D0D0DD !important;\n stroke-width: 1.5px;\n }\n\n #_ideogram ._ideogramLabel {\n stroke: white;\n stroke-width: 5px;\n stroke-linejoin: round;\n paint-order: stroke fill;\n text-align: center;\n }\n </style>\n "),e.didSetLabelStyle=!0);var r=da(t),o=mi(e),i="pink"===t.color?"#CF406B":t.color;Zo.select("#_ideogram").append("text").attr("id",r).attr("class","_ideogramLabel").attr("x",n.left).attr("y",n.top).style("font",o).style("fill",i).style("pointer-events",null).html(t.name)}(r,Object.assign(i,{backgroundColor:n,borderColor:e}),o)}function ba(t,n,e){if("geneCache"in e==0)return t;var r=e.geneCache.interestingNames;return(t=t.map((function(t){return t.rank=r.indexOf(t.name)||1e10,t}))).sort((function(t,n){return"red"===t.color?-1:"red"===n.color?1:t.rank-n.rank})).slice(0,n)}function wa(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this;t=t.slice(),n.clearAnnotLabels();var e=[],r=[];0===t.length&&(t=n.flattenAnnots()),t.forEach((function(t,o){var i=va(t,n);null!==i&&(r.length>1&&r.some((function(t,n){var e=t.left-3<=i.right&&t.right>=i.left-3,r=t.top-3<i.bottom&&t.bottom>i.top-3||i.top-3<t.bottom&&i.bottom>t.bottom;return e&&r}))||(e.push(t),r.push(i)))})),(e=ba(e,10,n)).reverse(),e.forEach((function(t){n.addAnnotLabel(t.name)})),Zo.selectAll("._ideogramLabel, .annot").on("mouseover",(function(t){return pa(t)})).on("mouseout",(function(t){return pa(t,n)})).on("click",(function(t){return pa(t)}))}function xa(t){var n=da(ga(t,this));document.querySelector("#"+n).remove()}function _a(){document.querySelectorAll("._ideogramLabel").forEach((function(t){t.remove()}))}function Aa(t){var n,e,r=!1,o=(new Date).getTime(),i=this;return n=i.chromosomes[i.config.taxid],function(t){"histogramScaling"in t.config==0&&(t.config.histogramScaling="absolute")}(i),void 0===i.maxAnnotsPerBar&&(i.maxAnnotsPerBar={},r=!0),e=function(t,n){var e,r,o,i,a,s,c,l,u=n.config.barWidth,h=[];for(s=0;s<n.chromosomesArray.length;s++){for(o=(r=t[e=n.chromosomesArray[s].name]).bands[r.bands.length-1],i=Math.round(o.px.stop/u),a={chr:e,annots:[]},c=0;c<i;c++)l=c*u-n.bump,a.annots.push({bp:n.convertPxToBp(r,l+n.bump),px:l,count:0,chrIndex:r.chrIndex,chrName:e,color:n.config.annotationsColor,annots:[]});h.push(a)}return h}(n,i),e=function(t,n,e,r){var o,i,a,s,c,l,u,h,f,d,m=r.config.barWidth;for(s=0;s<t.length;s++)for(o=t[s].annots,a=n[(i=e[t[s].chr]).chrIndex].annots,c=0;c<o.length;c++)for(u=(l=o[c]).px-r.bump,h=0;h<a.length;h++)if(d=(f=a[h].px)+m,h===a.length-1&&(d+=m),u>=f&&u<d){n[i.chrIndex].annots[h].count+=1,n[i.chrIndex].annots[h].annots.push(l);break}return n}(t,e,n,i),function(t,n,e){var r,o,i,a,s,c,l;if(n||"relative"===e.config.histogramScaling){for(r=0,o=0;o<t.length;o++){for(i=0,a=t[o].annots,s=t[o].chr,c=0;c<a.length;c++)(l=a[c].count)>i&&(i=l),l>r&&(r=l);e.maxAnnotsPerBar[s]=i}e.maxAnnotsPerBarAllChrs=r}}(e,r,i),e=function(t,n){var e,r,o,i,a,s,c,l=n._layout._isRotated;for(e=0;e<t.length;e++)for(r=t[e].annots,o=t[e].chr,i=0;i<r.length;i++)a=r[i].count,s="relative"===n.config.histogramScaling?a/n.maxAnnotsPerBar[o]:a/n.maxAnnotsPerBarAllChrs,c=!1===l?s*n.config.chrMargin:s*n.config.chrHeightOriginal*3,isNaN(c)&&(c=0),t[e].annots[i].height=c;return t}(e,i),function(t,n){var e=(new Date).getTime();n.config.debug&&console.log("Time spent in getHistogramBars: "+(e-t)+" ms")}(o,i),i.bars=e,e}var ka="#_ideogramLegend {font: 12px Arial; overflow: auto;} #_ideogramLegend svg {float: left;} #_ideogramLegend ul {position: relative; left: -14px; list-style: none; float: left; padding-left: 10px; margin: 0 0 1em 0; width: auto; border: none;} #_ideogramLegend li {float: none; margin: 0;}#_ideogramLegend ul span {position: relative; left: -15px;} ";function Ca(t,n){var e,r='fill="'+t.color+'" style="stroke: #AAA;"',o=t.shape;if("shape"in t&&["circle","triangle"].includes(o)){if("circle"===o)e='<path d="m2,9a 4.5,4.5 0 1,0 9,0a 4.5,4.5 0 1,0 -9,0" '+r+"></path>";else if("triangle"===o){var i="";"vertical"===n.config.orientation&&(i=' transform="rotate(90, 7, 7)"'),e='<path d="m7,3 l -5 9 l 9 0 z"'+i+" "+r+"></path>"}}else e='<rect height="10" width="10" y="3" '+r+"/>";return e}function Ta(t,n,e,r,o){var i,a,s,c=La(o);for(i=0;i<e.rows.length;i++)t+="<li>"+(s=e.rows[i]).name+"</li>",a=c*(i-1)+r+1,"name"in e&&(a+=c),n+='<g transform="translate(0, '+a+')">'+Ca(s,o)+"</g>";return[t,n]}function La(t){return 2*oi(pi("A",t).height)+.5}function Sa(t){var n,e,r,i,a,s,c=t.config,l=La(t);for(Zo.select(c.container+" #_ideogramLegend").remove(),e=c.legend,s="",n=0;n<e.length;n++){var u,h=l;(a=e[n]).nameHeight&&(h=a.nameHeight);var f="";h&&(f='style="height: '.concat(h,"px; position: relative; left: -").concat(h-5,'px;"')),"name"in a&&(i="<div ".concat(f,">")+a.name+"</div>"),i=(u=o(Ta(i,r='<svg id="_ideogramLegendSvg" width="'+l+'">',a,h,t),2))[0],r=u[1],s+=(r+="</svg>")+"<ul>"+i+"</ul>"}var d="font-family: ".concat(c.fontFamily,";"),m="line-height: ".concat(La(t),"px;");ka+="#_ideogramLegend {".concat(d," ").concat(m,"}");var p=Zo.select(c.container+" #_ideogramOuterWrap");p.append("style").html(ka),p.append("div").attr("id","_ideogramLegend").html(s)}function Ma(t){var n,e,r=[],o=this,i=o.chromosomes[o.config.taxid];if("annots"in t[0]||"values"in t[0])return o.drawProcessedAnnots(t);for(e in i)r.push({chr:e,annots:[]});r=function(t,n){var e,r,o,i;for(e=0;e<t.length;e++)for(o=t[e],r=0;r<n.length;r++)if(o.chr===n[r].chr){i=[o.name,o.start,o.stop-o.start],"color"in o&&i.push(o.color),"shape"in o&&i.push(o.shape),n[r].annots.push(i);break}return n}(t,r),n=function(t){var n=["name","start","length"];return"color"in t[0]&&n.push("color"),"shape"in t[0]&&n.push("shape"),n}(t),o.rawAnnots={keys:n,annots:r},o.annots=o.processAnnotData(o.rawAnnots),o.drawProcessedAnnots(o.annots)}function Pa(t){var n,e=this;Zo.selectAll(e.selector+" .annot").remove(),n="tracks",e.config.annotationsLayout&&(n=e.config.annotationsLayout),"legend"in e.config&&Sa(e),/heatmap/.test(n)?e.drawHeatmaps(t):(function(t,n,e){var r;!function(t,n){var e,r;if(!/heatmap/.test(t)&&"histogram"!==t){for(r=0,e=0;e<n.length;e++)r+=n[e].annots.length;r>2e3&&console.warn('Rendering more than 2000 annotations in Ideogram?\nTry setting "annotationsLayout" to "heatmap" or "histogram" in your Ideogram configuration object for better layout and performance.')}}(t,n),"histogram"===t&&(n=e.getHistogramBars(n)),r=function(t,n){return Zo.selectAll(n.selector+" .chromosome").data(t).selectAll("path.annot").data((function(t){return t.annots})).enter()}(e.fillAnnots(n),e),"tracks"===t?function(t,n){var e,r=n.config.annotationHeight;e=function(t){var n;return{triangle:"m0,0 l -"+t+" "+2*t+" l "+2*t+" 0 z",circle:"m -"+(n=t)+", "+n+"a "+n+","+n+" 0 1,0 "+2*n+",0a "+n+","+n+" 0 1,0 -"+2*n+",0",rectangle:"m0,0 l 0 "+2*t+"l "+t+" 0l 0 -"+2*t+"z"}}(r),t.append("g").attr("id",(function(t){return t.domId})).attr("class","annot").attr("transform",(function(t){var e=n.config.chrWidth+t.trackIndex*r*2;return"translate("+t.px+","+e+")"})).append("path").attr("d",(function(t){return function(t,n){return t.shape&&"triangle"!==t.shape?"circle"===t.shape?n.circle:"rectangle"===t.shape?n.rectangle:t.shape:n.triangle}(t,e)})).attr("fill",(function(t){return t.color})).on("mouseover",(function(t,e){n.showAnnotTooltip(e,this)})).on("mouseout",(function(){n.startHideAnnotTooltipTimeout()})).on("click",(function(t,e){n.onClickAnnot(e)}))}(r,e):"overlay"===t?function(t,n){t.append("polygon").attr("id",(function(t){return t.id})).attr("class","annot").attr("points",(function(t){var e,r,o=n.config.chrWidth;return t.stopPx-t.startPx>1?(e=t.startPx,r=t.stopPx):(e=t.px-.5,r=t.px+.5),e+","+o+" "+r+","+o+" "+r+",0 "+e+",0"})).attr("fill",(function(t){return t.color})).on("mouseover",(function(t,e){n.showAnnotTooltip(e,this)})).on("mouseout",(function(){n.startHideAnnotTooltipTimeout()}))}(r,e):"histogram"===t&&function(t,n){var e,r,o={},i=n.config.chrWidth;for(r in e=n.chromosomes[n.config.taxid])o[r]=e[r];t.append("polygon").attr("class","annot").attr("points",(function(t){return function(t,n,e,r){var o,i,a,s;o=t.px+r.bump,i=t.px+r.config.barWidth+r.bump,a=n,s=n+t.height;var c=e[t.chr];return i>c&&(i=c),o+","+a+" "+i+","+a+" "+i+","+s+" "+o+","+s}(t,i,o,n)})).attr("fill",(function(t){return t.color}))}(r,e)}(n,t,e),e.onDrawAnnotsCallback&&e.onDrawAnnotsCallback())}function Na(t,n,e){return t.append("g").attr("class","syntenicRegion").attr("id",n).on("click",(function(){var t=this,n=Zo.selectAll(e.selector+" .syntenicRegion").filter((function(){return this!==t}));n.classed("hidden",!n.classed("hidden"))})).on("mouseover",(function(){var t=this;Zo.selectAll(e.selector+" .syntenicRegion").filter((function(){return this!==t})).classed("ghost",!0)})).on("mouseout",(function(){Zo.selectAll(e.selector+" .syntenicRegion").classed("ghost",!1)}))}function Ea(t,n,e,r,o,i){var a,s;a="color"in i?i.color:"#CFC",s="opacity"in i?i.opacity:1,t.append("polygon").attr("points",n+", "+r.startPx+" "+n+", "+r.stopPx+" "+e+", "+o.stopPx+" "+e+", "+o.startPx).style("fill",a).style("fill-opacity",s)}function Ia(t,n,e,r,o,i){var a,s;a="color"in i?i.color:"#CFC",s="opacity"in i?i.opacity:1,t.append("polygon").attr("points",r.startPx-15+", "+n+" "+(r.stopPx-15)+", "+n+" "+(o.stopPx-15)+", "+e+" "+(o.startPx-15)+", "+e).style("fill",a).style("fill-opacity",s)}function Ba(t,n){var e,r,o,i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(e=t.r1,r=t.r2,"string"==typeof e.chr){var s=n.config.taxids;n.config.multiorganism?(e.chr=n.chromosomes[s[0]][e.chr],r.chr=n.chromosomes[s[1]][r.chr]):(e.chr=n.chromosomes[s[0]][e.chr],r.chr=n.chromosomes[s[0]][r.chr])}var c=document.querySelector("#"+e.chr.id+"-chromosome-set"),l=c.getCTM().e,u=c.getCTM().f,h=document.querySelector("#"+r.chr.id+"-chromosome-set"),f=h.getCTM().e,d=h.getCTM().f;return null===a?"vertical"===n.config.orientation?(o=u-12,i=d-12):(o=l,i=f):(o=a,i=a),e.startPx=n.convertBpToPx(e.chr,e.start)+o,e.stopPx=n.convertBpToPx(e.chr,e.stop)+o,r.startPx=n.convertBpToPx(r.chr,r.start)+i,r.stopPx=n.convertBpToPx(r.chr,r.stop)+i,[e,r]}function Da(t,n,e,r,o){t.append("line").attr("class","syntenyBorder").attr("x1",n).attr("x2",e).attr("y1",r.startPx).attr("y2",o.startPx),t.append("line").attr("class","syntenyBorder").attr("x1",n).attr("x2",e).attr("y1",r.stopPx).attr("y2",o.stopPx)}function Fa(t,n,e,r,o){t.append("line").attr("class","syntenyBorder").attr("x1",r.startPx-15).attr("x2",o.startPx-15).attr("y1",n).attr("y2",e),t.append("line").attr("class","syntenyBorder").attr("x1",r.stopPx-15).attr("x2",o.stopPx-15).attr("y1",n).attr("y2",e)}function Oa(t,n,e,r,o,i){var a,s;Math.abs(r.startPx-r.startPx)<2&&Math.abs(r.stopPx-r.stopPx)<2?(a=i.color,s=i.width):(a="",s=""),t.append("line").attr("class","syntenyBorder").attr("x1",n).attr("x2",e).attr("y1",r.startPx).attr("y2",o.startPx).style("stroke",a).style("stroke-width",s),t.append("line").attr("class","syntenyBorder").attr("x1",n).attr("x2",e).attr("y1",r.stopPx).attr("y2",o.stopPx).style("stroke",a).style("stroke-width",a)}function Ra(t,n,e,r,o,i){var a=i.split("__").map((function(t){return"label_"+t}));if("name"in r){t.append("text").attr("id",a[0]).attr("y",r.startPx+3).text(r.name);var s=document.querySelector("#"+a[0]).getBoundingClientRect().width;Zo.select("#"+a[0]).attr("x",n-15-s)}"name"in o&&t.append("text").attr("id",a[1]).text(o.name).attr("x",e+15).attr("y",o.startPx+3).text(o.name)}function ja(t){var n=(new Date).getTime(),e=this,r=e.config;if(e.syntenicRegions=t,r.multiorganism&&"collinear"===r.geometry)return"vertical"===r.orientation?function(t,n){var e=(new Date).getTime();(function(t,n,e){var r,i,a,s,c,l,u,h;for(r=0;r<t.length;r++){var f;a=(f=o(Ba(i=t[r],e),2))[0],s=f[1],Ea(c=Na(n,a.chr.id+"_"+a.start+"_"+a.stop+"___"+s.chr.id+"_"+s.start+"_"+s.stop,e),u=(l=e.config.chrWidth)+51,h=l+245,a,s,i),Da(c,u,h,a,s)}})(t,Zo.select(n.selector).insert("g",":first-child").attr("class","synteny"),n),function(t,n){var e=(new Date).getTime();n.config.debug&&console.log("Time in drawSyntenicRegions: "+(e-t)+" ms")}(e,n)}(t,e):function(t,n){var e=(new Date).getTime();(function(t,n,e){var r,i,a,s,c,l,u,h;for(r=0;r<t.length;r++){var f;a=(f=o(Ba(i=t[r],e),2))[0],s=f[1],Ia(c=Na(n,a.chr.id+"_"+a.start+"_"+a.stop+"___"+s.chr.id+"_"+s.start+"_"+s.stop,e),u=(l=e.config.chrWidth)+31,h=l+191,a,s,i),Fa(c,u,h,a,s)}})(t,Zo.select(n.selector).insert("g",":first-child").attr("class","synteny"),n),function(t,n){var e=(new Date).getTime();n.config.debug&&console.log("Time in drawSyntenicRegions: "+(e-t)+" ms")}(e,n)}(t,e);(function(t,n,e,r){var i,a,s,c,l,u,h,f,d;for(i=0;i<t.length;i++){var m;s=(m=o(Ba(a=t[i],r,e),2))[0],c=m[1],u=Na(n,l=s.chr.id+"_"+s.start+"_"+s.stop+"___"+c.chr.id+"_"+c.start+"_"+c.stop,r),h=r.config.chrWidth,Ea(u,f=r._layout.getChromosomeSetYTranslate(0),d=r._layout.getChromosomeSetYTranslate(1)-h,s,c,a),Oa(u,f,d,s,c,a),Ra(u,f,d,s,c,l)}})(t,Zo.select(e.selector).insert("g",":first-child").attr("class","synteny"),e._layout.margin.left,e),function(t,n){var e=(new Date).getTime();n.config.debug&&console.log("Time in drawSyntenicRegions: "+(e-t)+" ms")}(n,e)}function za(){var t=this;t.config.numAnnotTracks=t.config.annotationsNumTracks,Zo.selectAll(t.selector+" .annot").remove(),t.drawAnnots(t.processAnnotData(t.rawAnnots))}function Ha(t){var n,e,r,o=this,i=o.rawAnnots.annots;return o.config.numAnnotTracks=t.length,n=function(t,n){var e,r,o,i,a,s,c;for(r=[],i=0;i<t.length;i++){for(o=t[i],a=[],s=0;s<o.annots.length;s++)c=(e=o.annots[s].slice())[3]+1,n.includes(c)&&(e[3]=n.indexOf(c),a.push(e));r.push({chr:o.chr,annots:a})}return r}(i,t),r={keys:o.rawAnnots.keys,annots:n},"collinear"===o.config.geometry&&yi(o),e=o.processAnnotData(r),Zo.selectAll(o.selector+" .annot").remove(),o.displayedTrackIndexes=t,o.drawAnnots(e),e}function Ga(t){var n,e,r=this;return(n=t.keys).length<4||"trackIndex"!==n[3]||"trackIndexOriginal"===n[4]||(e=function(t,n){var e,r,o,i,a,s,c,l=[];for(c=1,e=0;e<t.length;e++){for(o=t[e],a=[],r=0;r<o.annots.length;r++)(s=(i=o.annots[r].slice())[3])+1>c&&(c=s+1),i.splice(4,0,s),a.push(i);l.push({chr:o.chr,annots:a})}return n.numAvailTracks=c,l}(t.annots,r),n.splice(4,0,"trackIndexOriginal"),t={keys:n,annots:e},r.rawAnnots.metadata&&(t.metadata=r.rawAnnots.metadata)),t}var Wa=[["F00"],["F00","88F"],["F00","CCC","88F"],["F00","FA0","0AF","88F"],["F00","FA0","CCC","0AF","88F"],["F00","FA0","875","578","0AF","88F"],["F00","FA0","875","CCC","578","0AF","88F"],["F00","FA0","7A0","875","0A7","578","0AF","88F"],["F00","FA0","7A0","875","CCC","0A7","578","0AF","88F"],["F00","FA0","7A0","875","552","255","0A7","578","0AF","88F"]];function qa(t,n,e,r,i,a,s){var c,l;return s.config.annotationTracks?i=function(t,n,e,r,o){var i;return n.trackIndex=e[3],(i=o.config.annotationTracks[n.trackIndex]).color&&(n.color=i.color),i.shape&&(n.shape=i.shape),t[r].annots.push(n),t}(i,t,e,a,s):"trackIndex"===n[3]&&1!==s.numAvailTracks?(c=function(t,n,e,r,o,i){var a=Wa[i.numAvailTracks-1];return t.trackIndex=n[3],t.trackIndexOriginal=n[4],t.color="#"+a[t.trackIndexOriginal],t.trackIndex>i.config.numTracks-1?(t.trackIndex in e?e[t.trackIndex].push(t):e[t.trackIndex]=[t],[r,e]):(r[o].annots.push(t),[r,e])}(t,e,r,i,a,s),i=(l=o(c,2))[0],r=l[1]):i=function(t,n,e,r){return n.trackIndex=0,n.color||(n.color=r.config.annotationsColor),n.shape||(n.shape="triangle"),t[e].annots.push(n),t}(i,t,a,s),[i,r]}function Ya(t,n){return"_c"+t+"_a"+n}function Xa(t,n,e,r,i,a,s){var c,l,u,h,f=!s.config.annotationsLayout||"tracks"===s.config.annotationsLayout;for(f&&(s.annotSortFunction?e.annots.sort((function(t,n){return-s.annotSortFunction(t,n)})):e.annots.sort((function(t,n){return t[1]-n[1]}))),c=0;c<e.annots.length;c++){var d;for(h=e.annots[c],u={},l=0;l<a.length;l++)u[a[l]]=h[l];u.stop=u.start+u.length,u.chr=e.chr,u.chrIndex=i,u.startPx=s.convertBpToPx(r,u.start),u.stopPx=s.convertBpToPx(r,u.stop),u.px=Math.round((u.startPx+u.stopPx)/2),f&&(u.domId=Ya(i,c)),t=(d=o(qa(u,a,h,n,t,i,s),2))[0],n=d[1]}return[t,n]}function Ua(t){console.warn('Chromosome "'+t.chr+'" undefined in ideogram; '+t.annots.length+" annotations not shown")}function Va(t){var n,e,r,i,a,s=this;return r=t.keys,n=function(t,n,e){var r,i,a,s,c=[],l={};for(r=-1,i=0;i<t.length;i++){var u,h;a=t[i],void 0!==(s=e.chromosomes[e.config.taxid][a.chr])?(r++,c.push({chr:a.chr,annots:[]}),"heatmap-2d"!==e.config.annotationsLayout?(c=(u=o(Xa(c,l,a,s,r,n,e),2))[0],l=u[1]):(c=(h=o(ta(c,l,a,s,r,n,e),2))[0],l=h[1])):Ua(a)}return[c,l]}(t=t.annots,r,s),i=(e=o(n,2))[0],a=e[1],i=function(t,n){var e,r,o,i,a,s;for(e=t,t=[],s=n.chromosomesArray,r=0;r<s.length;r++)for(a=s[r].name,o=0;o<e.length;o++)(i=e[o]).chr===a&&t.push(i);return t}(i,s),function(t,n){var e,r=n.config.annotationsLayout,o=n.config.numAnnotTracks;!/heatmap/.test(r)&&o>10&&console.error("Ideogram only displays up to 10 tracks at a time. You specified "+o+" tracks. Perhaps consider a different way to visualize your data."),(e=Object.keys(t).length)&&console.warn("Ideogram configuration specified "+o+" tracks, but loaded annotations contain "+e+" extra tracks.")}(a,s),i}var Qa=function(){function t(n,e){u(this,t),this.matrix=n,this.ideo=e}return f(t,[{key:"setRawAnnots",value:function(){var t,n,e;return t=this,n=this.ideo,e=this.matrix,new Promise((function(r){t.rawAnnots=t.fetchCoordinates(n).then((function(o){t.coordinates=o,r(t.parseExpressionMatrix(e,n))}))}))}},{key:"fetchCoordinates",value:function(t){var n={};if("human"===t.config.organism){var e=t.config.dataDir+"../../annotations/Homo_sapiens,_Ensembl_80.tsv";return new Promise((function(r){t.fetch(e,"text").then((function(t){var e,i,a,s,c,l,u;for(e=t.split(/\r\n|\n/).slice(1),i=0;i<e.length;i++){var h;a=(h=o(e[i].split(/\s/g),5))[0],s=h[1],c=h[2],l=h[4],a=parseInt(a),u=(s=parseInt(s))-a,n[c]=[l,a,u]}r(n)}))}))}throw Error("Expression matrix parsing is only supported for human")}},{key:"parseAnnotFromTsvLine",value:function(t,n){var e,r,i,a,s,c,l=t.split(/\s/g);return(s=l[0])in this.coordinates==0?[null,null]:(c=l.slice(1).map((function(t){return parseFloat(t)})),i=(e=o(this.coordinates[s],3))[0],a=e[1],length=e[2],-1===(r=n.indexOf(i))?[null,null]:[r,[s,a,length].concat(c)])}},{key:"parseExpressionMatrix",value:function(t,n){var e,r,i,a,s,c,l=[],u=t.split(/\r\n|\n/);for(r=Object.keys(n.chromosomes[n.config.taxid]),e=0;e<r.length;e++)l.push({chr:r[e],annots:[]});for(e=1;e<u.length;e++){var h;a=u[e],s=(h=o(this.parseAnnotFromTsvLine(a,r),2))[0],c=h[1],null!==s&&l[s].annots.push(c)}return i=u[0].split(/\s/g),{keys:["name","start","length"].concat(i),annots:l}}}]),t}();function $a(){var t=this,n={};t.annots.forEach((function(e){e.annots.forEach((function(e){var r=t.annotDescriptions.annots[e.name];n[e.name]=[e.name,r.ensemblId,e.chr,e.start,e.stop,e.length,r.type]}))}));var e=[["# Gene name","Ensembl ID","Chromosome","Start","Stop","Length","Type"]].concat(Object.values(n)),r=t.annotDescriptions.headers+"\n#\n"+e.map((function(t){return t.join("\t")})).join("\n"),o="data:text/plain;charset=utf-8,"+encodeURIComponent(r),i=new MouseEvent("click",{view:window,bubbles:!1,cancelable:!0}),a=document.createElement("a");a.setAttribute("download","ideogram.tsv"),a.setAttribute("href",o),a.setAttribute("target","_blank"),a.setAttribute("id","_ideo-undisplayed-dl-annots-link"),a.setAttribute("style","display: none;"),document.body.appendChild(a),a.dispatchEvent(i)}function Ja(){var t=this,n=t.config;!function(t){var n,e=t.config;e.annotationHeight||("heatmap"===e.annotationsLayout?n=e.chrWidth-1:(n=Math.round(e.chrHeight/100))<3&&(n=3),t.config.annotationHeight=n)}(t),n.annotationsPath||n.localAnnotationsPath||t.annots||n.annotations?function(t,n){n.annotationTracks?t.config.numAnnotTracks=n.annotationTracks.length:n.annotationsNumTracks?t.config.numAnnotTracks=n.annotationsNumTracks:t.config.numAnnotTracks=1,t.config.annotTracksHeight=n.annotationHeight*n.numAnnotTracks,void 0===n.barWidth&&(t.config.barWidth=3)}(t,n):(t.config.annotTracksHeight=0,t.config.numAnnotTracks=0),void 0===n.annotationsColor&&(t.config.annotationsColor="#F00"),n.onClickAnnot&&(t.onClickAnnotCallback=n.onClickAnnot),function(t,n){!1!==n.showAnnotTooltip&&(t.config.showAnnotTooltip=!0),n.onWillShowAnnotTooltip&&(t.onWillShowAnnotTooltipCallback=n.onWillShowAnnotTooltip)}(t,n),function(t,n){!1!==n.addAnnotLabel&&(t.config.addAnnotLabel=!0),n.onWillAddAnnotLabel&&(t.onWillAddAnnotLabelCallback=n.onWillAddAnnotLabel)}(t,n)}function Ka(){var t=this,n=t.config;t.rawAnnots.annots=t.rawAnnots.annots.sort(Ideogram.sortChromosomes),t.onLoadAnnotsCallback&&t.onLoadAnnotsCallback(),("heatmapThresholds"in n||"metadata"in t.rawAnnots&&"heatmapThresholds"in t.rawAnnots.metadata)&&("heatmap"===n.annotationsLayout?function(t){var n,e,r,o,i,a,s=t.config.heatmapThresholds;for(r=[],e=(i=t.rawAnnots).keys.slice(3),o=[],a=[],!i.metadata&&isNaN(s[0])||(s=Vi(t)),n=0;n<e.length;n++)r.push({key:e[n],thresholds:s}),o.push({id:e[n]}),a.push(n+1);t.config.annotationsNumTracks=e.length,t.config.annotationsDisplayedTracks=a,t.config.heatmaps=r,t.config.annotationTracks=o}(t):"heatmap-2d"===n.annotationsLayout&&(t.config.heatmapThresholds=Vi(t))),n.heatmaps&&t.deserializeAnnotsForHeatmap(t.rawAnnots),function(t){var n={},e=[],r=t.rawAnnots.annots.map((function(t){return t.chr}));if(r.forEach((function(t){t in n&&e.push(t),n[t]=1})),e.length>0)throw Error("Duplicate chromosomes detected.\nChromosome list: ".concat(r,". Duplicates: ").concat(e,".\nTo fix this, edit your raw annotations JSON data to remove redundant chromosomes."))}(t)}function Za(){return this.annots.reduce((function(t,n){return[].concat(r(t),r(n.annots))}),[])}function ts(t){var n,e=this,r=e.config;n="heatmap-2d"===r.annotationsLayout;var o=function(t){var n,e;return e=(n=t.split("?")[0].split("."))[n.length-1],!1===["bed","json","tsv"].includes(e)?(e=e.toUpperCase(),void alert("Ideogram.js only supports BED and Ideogram JSON and TSV at the moment. Sorry, check back soon for "+e+" support!")):e}(t);"http"===t.slice(0,4)||n||"tsv"===o?(o=n?"":o,e.fetch(t,"text").then((function(t){e.rawAnnotsResponse=t,n?new Qa(t,e).setRawAnnots().then((function(t){e.rawAnnots=t,e.afterRawAnnots()})):(e.rawAnnots="tsv"===o?new qi(t,e).rawAnnots:"bed"===o?new Wi(t,e).rawAnnots:JSON.parse(t),e.afterRawAnnots())}))):e.fetch(t).then((function(t){e.rawAnnotsResponse=t,e.rawAnnots=t,e.afterRawAnnots()}))}function ns(t){var n,e,r,o,i,a,s;for(n=[],e=[],r=this.chromosomesArray,o=0;o<r.length;o++)i=r[o].name,e.push(i),n.push({chr:i,annots:[]});for(o=0;o<t.length;o++)a=t[o],-1!==(s=e.indexOf(a.chr))&&(n[s]=a);return n}function es(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"red",e=this,r=e.config.taxid,o=t.map((function(t){var o=e.chromosomes[r][t].id,i="".concat(e.selector," #").concat(o,"-chromosome-set"),a=document.querySelector(i),s=a.getBoundingClientRect();return'<rect class="ideo-highlight" id="ideo-highlight-'.concat(o,'" style="\n stroke-width: 1px;\n stroke: ').concat(n,";\n fill: ").concat(n,";\n fill-opacity: 0.05;\n position: absolute;\n rx: 4;\n ry: 4;\n height: ").concat(s.width+15,"px;\n width: ").concat(s.height+15,'px" transform="rotate(90) translate(10, ').concat(a.transform.baseVal[1].matrix.f-7.5,')"/>')})).join();document.querySelector(e.selector).insertAdjacentHTML("afterBegin",o)}function rs(t){var n=this,e="".concat(n.selector," .ideo-highlight");if(void 0!==t){var r=n.config.taxid;e=t.map((function(t){var e=n.chromosomes[r][t].id;return"".concat(n.selector," #ideo-highlight-").concat(e)}))}document.querySelectorAll(e).forEach((function(t){t.remove()}))}function os(t,n){var e,r;return e=n.esearch+"&db=taxonomy&term="+t,Zo.json(e).then((function(n){if(0===n.esearchresult.idlist.length)throw'Organism "'+t+"\" is generally unknown; it was not found in the NCBI Taxonomy database. If you did not intend to specify a novel or custom taxon, then try using the organism's scientific name, e.g. Homo sapiens or Arabidopsis thaliana.";return r=n.esearchresult.idlist[0],[t,r]}))}function is(t,n){var e,r,o=this;t=o.config.organism,r=o.esummary+"&db=taxonomy&id="+t,Zo.json(r).then((function(r){return e=r.result[String(t)].commonname,o.config.organism=e,n(e)}))}function as(t,n,e){var r,o,i,a,s,c=e.config;(function(t,n){var e,r,o;if(n.assemblyIsAccession())return new Promise((function(e){n.coordinateSystem="bp",n.getAssemblyAndChromosomesFromEutils(t,e)}));e=n.config.dataDir,r=hi(n.organisms[t].scientificName),o=[t],["9606","10090","10116"].includes(t)&&!n.config.showFullyBanded&&(r+="-no-bands");var i=e+r+".json",a=new Promise((function(t,n){return ei(i).then((function(n){return n.json().then((function(n){t(n.chrBands)}))})).catch((function(t){n(t)}))}));return a.then((function(e){var r,i,a,s,c=[""],l=[],u={};n.bandData[t]=e;for(var h=0;h<e.length;h++)r=(a=e[h].split(" "))[0],s=a.slice(-1)[0],r in u||(l.push({name:r,type:"nuclear",length:s}),u[r]=1);return l=l.sort(Ideogram.sortChromosomes),i={bp:0,iscn:0},l.forEach((function(t){t.length>i.bp&&(i.bp=t.length)})),n.maxLength[t]=i,c.push(l),c.push(o),c}),(function(){return new Promise((function(e){n.coordinateSystem="bp",n.getAssemblyAndChromosomesFromEutils(t,e)}))}))})(t,e).then((function(l){r=l[0],o=l[1],"chromosomes"in c==0||null===c.chromosomes?(e.config.chromosomes={},e.config.chromosomes[t]=o):(c.multiorganism?t in c.chromosomes?i=c.chromosomes[t]:(a=hi(e.getScientificName(t)),e.config.chromosomes[t]=c.chromosomes[a].slice(),i=e.config.chromosomes[t]):i=c.chromosomes,s=o.filter((function(t){return i.includes(t.name)})),e.config.chromosomes[t]=s),e.chromosomes[t]=e.config.chromosomes[t].slice(),e.organisms[t].assemblies={default:r},n()}))}function ss(t,n){var e,r;for(e in n.organisms)if(r=n.organisms[e],e===hi(t)||hi(r.commonName)===hi(t)||hi(r.scientificName)===hi(t))return!0;return!1}function cs(t){var n,e=this;if(n="taxid"in e.config,e.config.multiorganism=function(t,n){return"organism"in n.config&&n.config.organism instanceof Array||t&&n.config.taxid instanceof Array}(n,e),e.config.multiorganism&&(e.coordinateSystem="bp"),"organism"in e.config){var r=e.config.organism;"string"==typeof r&&(e.config.organism=hi(r.toLowerCase())),function(t,n){(function(t){var n,e,r,o,i,a=t.config;return n=[],e={},function(t,n){var e,r,o,i=[],a={};for(o=0;o<t.length;o++)r=!1===ss(e=t[o],n)?os(e,n).then((function(t){var e,r,o=t[1];r=(e=t[0].replace("-"," "))[0].toUpperCase()+e.slice(1),a[o]={scientificName:r,commonName:"",assemblies:{default:""}},Object.assign(n.organisms,a)}),(function(t){console.warn(t);var r={scientificName:e,commonName:e,assemblies:{default:""}};n.organisms[-1]=r,a[-1]=r})):new Promise((function(t){var r=n.getTaxid(e);a[r]=n.organisms[r],t()})),i.push(r);return Promise.all(i).then((function(){return a}))}(a.multiorganism?a.organism:[a.organism],t).then((function(t){var s=t[o];for(o in t)s=t[o],n.push(o),a.multiorganism&&(void 0!==a.chromosomes?(i=Object.keys(a.chromosomes).map((function(t){return hi(t)})),i.includes(hi(s.scientificName))?r=s.scientificName:i.includes(hi(s.commonName))&&(r=s.commonName),hi(r)in a.chromosomes?e[o]=a.chromosomes[hi(r)]:e[o]=a.chromosomes[r.toLowerCase()]):e=null);return[e,n]}))})(n).then((function(e){var r,i,a,s,c,l=o(e,2),u=l[0],h=l[1],f=n.config,d=[];for(r=0;r<h.length;r++)i=h[r],s=n.organisms[i].assemblies,c=Object.values(s),""===s.default||n.assemblyIsAccession()&&!c.includes(f.assembly)?a=new Promise((function(t){as(i,t,n)})):(n.config.taxids=h,n.config.multiorganism&&(n.config.chromosomes=u),a=new Promise((function(t){t()}))),d.push(a);Promise.all(d).then((function(){return h=function(t){var n,e,r;if(n=t.config.organism,e=[],Array.isArray(n))for(r=0;r<n.length;r++)e.push(t.getTaxid(n[r]));else e.push(t.getTaxid(n));return e}(n),n.config.taxids=h,t(h)}))}))}(t,e)}else!function(t,n,e){var r;e.config.multiorganism?t&&(r=e.config.taxid):(t&&(r=[e.config.taxid]),e.config.taxids=r),n(r)}(n,t,e)}function ls(t,n){var e,r,i,a;return e=function(t,n){var e=t.genome;return"mitochondrion"===e?function(t,n){var e,r;return n.config.showNonNuclearChromosomes?(e=t.genome,[-1===(r=t.subtype.split("|").indexOf("plasmid"))?"MT":t.subname.split("|")[r],e]):[null,null]}(t,n):"chloroplast"===e||"plastid"===e?function(t){return t.config.showNonNuclearChromosomes?["CP","chloroplast"]:[null,null]}(n):"apicoplast"===e?function(t){return t.config.showNonNuclearChromosomes?["AP","apicoplast"]:[null,null]}(n):function(t){var n,e;return n=t.subtype.split("|").indexOf("chromosome"),void 0!==(e=t.subname.split("|")[n])&&"chr"===e.substr(0,3)&&(e=e.substr(3)),[e,"nuclear"]}(t)}(t,n),i=(r=o(e,2))[0],a=r[1],{name:i,length:t.slen,type:a}}function us(t,n){var e,r=this,o=function(t,n){var e;return e=n.assemblyIsAccession()?n.config.assembly+"%22[Assembly%20Accession]":t+"%22[taxid]AND%20(%22latest%20refseq%22[filter])%20",n.esearch+"&db=assembly&term=%22"+e+"AND%20(%22chromosome%20level%22[filter]%20OR%20%22complete%20genome%22[filter])"}(t,r);Zo.json(o).then((function(t){return function(t,n){var e,r;return e=t.esearchresult.idlist[0],r=n.esummary+"&db=assembly&id="+e,Zo.json(r)}(t,r)})).then((function(t){var n=t.result.uids[0];return e=t.result[n],function(t,n){var e;return e="&db=nuccore&dbfrom=assembly&linkname=assembly_nuccore&cmd=neighbor_history&from_uid="+t,Zo.json(n.elink+e).then((function(t){var r=t.linksets[0].webenv;return e="&db=nuccore&term=%231+AND+%28sequence_from_chromosome[Properties]+OR+sequence_from_plastid[Properties]+OR+sequence_from_mitochondrion[Properties]%29&WebEnv="+r+"&usehistory=y&retmax=1000",n.esearch+e}))}(n,r)})).then((function(t){return Zo.json(t)})).then((function(t){return function(t,n){var e,r;return e=t.esearchresult.idlist.join(","),r=n.esummary+"&db=nucleotide&id="+e,Zo.json(r)}(t,r)})).then((function(o){var i=function(t,n,e){var r,o,i,a,s={},c=[];for(r in t)"uids"!==r&&(i=(o=ls(t[r],e)).name+"_"+o.length,null!==o.type&&i in s==0&&c.push(o),s[i]=1);return c=c.sort(Ideogram.sortChromosomes),a={bp:0,iscn:0},c.forEach((function(t){t.length>a.bp&&(a.bp=t.length)})),a.bp>e.maxLength.bp&&(e.maxLength.bp=a.bp),e.maxLength[n]=a,e.coordinateSystem="bp",c}(o.result,t,r);return n([e,i])}),(function(t){console.warn(t)}))}function hs(){var t=this,n=t.bandsToShow.join(",");0!==t.bandsToShow.length&&(Zo.selectAll(t.selector+" .bandLabel, .bandLabelStalk").style("display","none"),Zo.selectAll(n).style("display",""))}function fs(t,n,e,r,o){return n!==e&&(t=r[o.id][e]+36),t}function ds(t,n,e,r,o,i,a){var s,c;return e<r+(a?n:o)?(n=o,s=i,c=a):t.push(i),[t,n,s,c]}function ms(t,n){var e,r,i,a,s=[],c=t[n.id].length,l=0;for(e=0;e<c;e++){var u,h;s=(u=o(ds(s,l,i=t[n.id][e],5,a,e,!0),4))[0],l=u[1],r=u[2],u[3]||(s=(h=o(ds(s,l,i,5,a=fs(a,r,e,t,n),e,!1),4))[0],l=h[1],r=h[2],h[3])}return s}function ps(t,n){var e,r,o,i,a,s,c,l=this;for(l.bandsToShow=[],r=0;r<t.length;r++){for(s=[],c=(i=ms(n,a=t[r])).length,o=0;o<c;o++)e=i[o],s.push("#"+a.id+" .bsbsl-"+e);l.bandsToShow=l.bandsToShow.concat(s)}}function gs(t,n,e,r){var o=this,i=o._layout,a=e.chrIndex;return t.selectAll("text").data(n).enter().append("g").attr("class",(function(t,n){return"bandLabel bsbsl-"+n})).attr("transform",(function(t){var n=i.getChromosomeBandLabelTranslate(t,a);return"horizontal"===o.config.orientation?r[e.id].push(n.x+13):r[e.id].push(n.y+6),n.translate})).append("text").attr("text-anchor",i.getChromosomeBandLabelAnchor(a)).text((function(t){return t.name})),r}function vs(t,n,e,r){var o=this;t.selectAll("line.bandLabelStalk").data(n).enter().append("g").attr("class",(function(t,n){return"bandLabelStalk bsbsl-"+n})).attr("transform",(function(t){var n;return n=o.round(t.px.start+t.px.width/2),r[e.id].push(n+13),"translate("+n+",-10)"})).append("line").attr("x1",0).attr("y1",o._layout.getChromosomeBandTickY1(e.chrIndex)).attr("x2",0).attr("y2",o._layout.getChromosomeBandTickY2(e.chrIndex))}function ys(t){var n,e,r,o,i,a=this,s={};for(o=function(t){var n,e,r=[];for(n in t)for(e in t[n])r.push(t[n][e]);return r}(t),n=0;n<o.length;n++)r=o[n],e=Zo.select(a.selector+" #"+r.id),s[r.id]=[],i=r.bands.filter((function(t){return"pter"!==t.name})),s=a.drawBandLabelText(e,i,r,s),a.drawBandLabelStalk(e,i,r,s);a.setBandsToShow(o,s)}function bs(t,n){return[n[t][0],n[t][1],n[t][2],n[t][3]]}function ws(){var t="";return t=function(t){var n,e,r,i,a,s="";for(n=0;n<t.length;n++){var c;e=(c=o(bs(n,t),4))[0],r=c[1],i=c[2],a=c[3],s+='<linearGradient id="'+e+'" x1="0%" y1="0%" x2="0%" y2="100%">',s+="gneg"===e?'<stop offset="70%" stop-color="'+i+'" /><stop offset="95%" stop-color="'+a+'" /><stop offset="100%" stop-color="'+r+'" />':'<stop offset="5%" stop-color="'+r+'" /><stop offset="15%" stop-color="'+i+'" /><stop offset="60%" stop-color="'+a+'" />',s+="</linearGradient>"}return s}(Jo),"<style>".concat(gi,"</style><defs>")+(t+='<pattern id="stalk" width="2" height="1" patternUnits="userSpaceOnUse" patternTransform="rotate(30 0 0)"><rect x="0" y="0" width="10" height="2" fill="#CCE" /> <line x1="0" y1="0" x2="0" y2="100%" style="stroke:#88B; stroke-width:0.7;" /></pattern><pattern id="gvar" width="2" height="1" patternUnits="userSpaceOnUse" patternTransform="rotate(-30 0 0)"><rect x="0" y="0" width="10" height="2" fill="#DDF" /> <line x1="0" y1="0" x2="0" y2="100%" style="stroke:#99C; stroke-width:0.7;" /></pattern>')+"</defs>"}function xs(t,n,e){var r,o,i;return(r=n[0])in t==0&&(t[r]=[]),o=function(t){var n=t[7];return t[8]&&(n+=t[8]),n}(n),i=function(t,n,e,r){return{chr:t,bp:{start:parseInt(n[5],10),stop:parseInt(n[6],10)},iscn:{start:parseInt(n[3],10),stop:parseInt(n[4],10)},px:{start:-1,stop:-1,width:-1},name:n[1]+n[2],stain:e,taxid:r}}(r,n,o,e),t[r].push(i),t}function _s(t,n,e,r){var o,i,a=r.config.multiorganism;return null!=t&&(i=(o=Array.isArray(t))&&-1===t.indexOf(n),!(!o||"object"==typeof t||!i)||(e in t!=0||!a)&&(a?"string"==typeof t[e][0]?!1===t[e].includes(n):0===t[e].filter((function(t){return t.name===n})).length:0===t.filter((function(t){return t===n})).length))}function As(t,n,e,r){var o,i,a=[];return o=n[t],a.push(o),i={iscn:o[o.length-1].iscn.stop,bp:o[o.length-1].bp.stop},e in r.maxLength==0&&(r.maxLength[e]={bp:0,iscn:0}),i.iscn>r.maxLength[e].iscn&&(r.maxLength[e].iscn=i.iscn,i.iscn>r.maxLength.iscn&&(r.maxLength.iscn=i.iscn)),i.bp>r.maxLength[e].bp&&(r.maxLength[e].bp=i.bp,i.bp>r.maxLength.bp&&(r.maxLength.bp=i.bp)),a}function ks(t){var n,e,r=this,o=r.config,i=(new Date).getTime();return n=[],"chromosomes"in o&&(e=o.multiorganism?o.chromosomes:t in o.chromosomes?o.chromosomes[t].slice():o.chromosomes.slice()),n=function(t,n,e,r){var o,i;if(t in r.bandData||t in Ko&&!1===r.assemblyIsAccession())e=function(t,n,e,r){var o,i,a;o=function(t,n,e){var r,o,i,a,s,c,l={};c=e.bandData[t],Array.isArray(c)&&(s="native"),n=function(t){var n,e;if(t instanceof Array&&"object"==typeof t[0]){for(n=[],e=0;e<t.length;e++)n.push(t[e].name);t=n}return t}(n);var u=function(t,n){var e,r,o;return"undefined"==typeof chrBands&&"native"!==t?(e=/\t/,r=n.split(/\r\n|\n/),o=1):(e=/ /,r=n,o=0),[e,r,o]}(s,c);for(r=u[0],o=u[1],a=u[2];a<o.length;a++)_s(n,(i=o[a].split(r))[0],t,e)||(l=xs(l,i,t));return l}(t,n,r),n=Object.keys(o).sort(Ideogram.sortChromosomes),"chromosomes"in r.config!=0&&null!==r.config.chromosomes||(r.config.chromosomes={}),n.length>0&&(r.config.chromosomes[t]=n.slice()),r.numChromosomes+=r.config.chromosomes[t].length;for(i=0;i<n.length;i++)a=As(n[i],o,t,r),e=e.concat(a);return e}(t,n,e,r);else for(r.numChromosomes+=n.length,i=0;i<n.length;i++)(o=n[i]).length>r.maxLength.bp&&(r.maxLength.bp=o.length);return e}(t,e,n,r),function(t,n){var e=(new Date).getTime();n.config.debug&&console.log("Time in processBandData: "+(e-t)+" ms")}(i,r),[t,n]}function Cs(){call(this.onBrushMoveCallback)}function Ts(){call(this.onBrushEndCallback)}function Ls(t,n,e){var r,i,a,s,c,l,u,h,f=this,d=f.config.chrWidth+6.5,m=f._layout.margin.left;r=function(t,n,e){var r,o;return r=t.split(":"),o=t.split("-"),r.length>1&&o.length>1&&(t=r[0].replace("chr",""),o=r[1].split("-"),n=parseInt(o[0]),e=parseInt(o[1]-1)),[t,n,e]}(t,n,e),t=(i=o(r,3))[0],n=i[1],e=i[2],c=function(t,n){var e,r;for(e=0;e<n.chromosomesArray.length;e++)if((r=n.chromosomesArray[e]).name===t)return r}(t,f),a=function(t,n){var e,r,o=[1],i=[1],a=t.bands.slice(-1)[0];for(r=0;r<t.bands.length;r++)e=t.bands[r],o.push(e.bp.start),i.push(e.px.start+n);return o.push(a.bp.stop-1),i.push(a.px.stop+n),[o,i]}(c,m),u=(s=o(a,2))[0],h=s[1],l=c.bands.slice(-1)[0].bp.stop,void 0===n&&(n=Math.floor(l/10)),void 0===e&&(e=Math.ceil(2*n)),function(t,n,e,r,o){var i,a=o.config.chrHeight;i=Zo.scaleLinear().domain(t).range(n),o.brush=Zo.brushX().extent([[e,0],[a+e,r]]).on("brush",(function(t){var n=t.selection.map(i.invert),e=Math.floor(n[0]),r=Math.ceil(n[1]);o.selectedRegion={from:e,to:r,extent:r-e},o.onBrushMoveCallback&&o.onBrushMoveCallback()})).on("end",(function(t){t.selection,o.onBrushEndCallback&&o.onBrushEndCallback()}))}(u,h,m,d,f),function(t,n,e){var r=n-t+1;e.selectedRegion={from:t,to:n,extent:r}}(n,e,f),function(t,n,e,r,o,i){var a,s,c;a=i.convertBpToPx(t,n)+r,s=i.convertBpToPx(t,e)+r,c=i._layout.getChromosomeSetYTranslate(0)+(i.config.chrWidth-o)/2,Zo.select(i.selector).append("g").attr("class","brush").attr("transform","translate(0, "+c+")").call(i.brush).call(i.brush.move,[a,s])}(c,n,e,m,d,f)}function Ss(){call(this.onCursorMoveCallback)}function Ms(t){var n,e,r,i=this,a=i.config.chrWidth+6.5,s=i._layout.margin.left;if(void 0===t)return!1;r=function(t,n){var e,r;for(e=0;e<n.chromosomesArray.length;e++)if((r=n.chromosomesArray[e]).name===t)return r}(i.config.chromosome,i),n=function(t,n){var e,r,o=[1],i=[1],a=t.bands.slice(-1)[0];for(r=0;r<t.bands.length;r++)e=t.bands[r],o.push(e.bp.start),i.push(e.px.start+n);return o.push(a.bp.stop-1),i.push(a.px.stop+n),[o,i]}(r,s),function(t,n,e,r,o,i){var a;a=Zo.scaleLinear().domain(n).range(e),"rotatable"in i.config&&!1===i.config.rotatable||console.warn("Using the cursor with rotate is not supported.");var s=i._layout.getChromosomeSetYTranslate(0)+(i.config.chrWidth-o)/2,c=Zo.select(i.selector).append("g").attr("class","brush").attr("transform","translate(0, "+s+")").append("rect").attr("class","cursor").attr("x",a(t)).attr("y",0).attr("width",1).attr("height",30);i.onCursorMove&&i.onCursorMoveCallback(t),i.setCursorPosition||(i.setCursorPosition=function(t){c.attr("x",a(t)),i.onCursorMove&&i.onCursorMoveCallback(t)}),Zo.selectAll(i.selector+" .chromosome").on("click",(function(t){var n=t.offsetX;n-=6,c.attr("x",n);var e=Math.floor(a.invert(n));i.onCursorMove&&i.onCursorMoveCallback(e)}))}(t,(e=o(n,2))[0],e[1],0,a,i)}function Ps(t,n){var e,r,o,i,a,s,c,l,u,h;for(e=this.bandsArray,r=this.config.taxid,o=this.config.chromosomes[r],a=(i="male"===this.config.sex?[1,0]:[0,0]).length,h=0;h<a;h++)s=o[u=i[h]+n],c=e[r][u],l=this.getChromosomeModel(c,s,r,u),this.appendHomolog(l,n,h,t)}function Ns(t){var n,e,r=this,o={X:1,Y:1};if(2===this.config.ploidy&&this.config.sex)for(r.sexChromosomes.list=[],e=0;e<t.length;e++)n=t[e],"male"===r.config.sex&&n in o?(r.sexChromosomes.list.push(n),r.sexChromosomes.index||(r.sexChromosomes.index=e)):"X"===n&&(r.sexChromosomes.list.push(n,n),r.sexChromosomes.index=e)}function Es(t,n){var e,r,i,a;if(t.bands.length>1||"MT"===t.name){if(i=function(t,n){var e,r,o,i,a,s,c,l,u;for(e=0;e<t.bands.length;e++)if(a=(r=t.bands[e]).bp.start,c=(s=r.bp.stop)-a,o=r.iscn.start,i=r.iscn.stop-o,l=r.px.start,u=r.px.width,n>=a&&n<=s)return[l+u*(o+i/c*(n-a)-o)/i,r];return[null,r]}(t,n),r=(a=o(i,2))[0],e=a[1],null!==r)return r}else if(n>=1&&n<=t.length)return t.scale.bp*n;!function(t,n,e){throw new Error("Base pair out of range. bp: "+t+"; length of chr"+n.name+": "+e.bp.stop)}(n,t,e)}function Is(t,n,e,r,o,i,a){var s,c,l,u;return a=t-n,s=r-o,c=i.bp.stop-i.bp.start,l=n+a/s*(e-o),u=i.bp.start+c*(l-n)/a,Math.round(u)}function Bs(t,n){var e,r,o,i,a,s;for(0===n&&(n=t.bands[0].px.start),e=0;e<t.bands.length;e++)if(o=(r=t.bands[e]).px.start,i=r.px.stop,a=r.iscn.start,s=r.iscn.stop,n>=o&&n<=i)return Is(s,a,n,i,o,r,void 0);!function(t,n,e){throw new Error("Pixel out of range. px: "+t+"; length of chr"+n.name+": "+e)}(n,t,i)}var Ds=zs,Fs=zs,Os=zs,Rs=Hs,js=Gs;function zs(t){for(var n=new Array(t),e=-1;++e<t;)n[e]=0;return n}function Hs(t,n){for(var e=t.length;e<n;)t[e++]=0;return t}function Gs(t,n){if(n>32)throw new Error("invalid array width!");return t}function Ws(t){this.length=t,this.subarrays=1,this.width=8,this.masks={0:0},this[0]=Ds(t)}"undefined"!=typeof Uint8Array&&(Ds=function(t){return new Uint8Array(t)},Fs=function(t){return new Uint16Array(t)},Os=function(t){return new Uint32Array(t)},Rs=function(t,n){if(t.length>=n)return t;var e=new t.constructor(n);return e.set(t),e},js=function(t,n){var e;switch(n){case 16:e=Fs(t.length);break;case 32:e=Os(t.length);break;default:throw new Error("invalid array width!")}return e.set(t),e}),Ws.prototype.lengthen=function(t){var n,e;for(n=0,e=this.subarrays;n<e;++n)this[n]=Rs(this[n],t);this.length=t},Ws.prototype.add=function(){var t,n,e,r,o;for(r=0,o=this.subarrays;r<o;++r)if(e=(~(t=this.masks[r])&t+1)>>>0,!((n=this.width-32*r)>=32)||e)return n<32&&e&1<<n&&(this[r]=js(this[r],n<<=1),this.width=32*r+n),this.masks[r]|=e,{offset:r,one:e};return this[this.subarrays]=Ds(this.length),this.masks[this.subarrays]=1,this.width+=8,{offset:this.subarrays++,one:1}},Ws.prototype.copy=function(t,n){var e,r;for(e=0,r=this.subarrays;e<r;++e)this[e][t]=this[e][n]},Ws.prototype.truncate=function(t){var n,e;for(n=0,e=this.subarrays;n<e;++n)for(var r=this.length-1;r>=t;r--)this[n][r]=0;this.length=t},Ws.prototype.zero=function(t){var n,e;for(n=0,e=this.subarrays;n<e;++n)if(this[n][t])return!1;return!0},Ws.prototype.zeroExcept=function(t,n,e){var r,o;for(r=0,o=this.subarrays;r<o;++r)if(r===n?this[r][t]&e:this[r][t])return!1;return!0},Ws.prototype.zeroExceptMask=function(t,n){var e,r;for(e=0,r=this.subarrays;e<r;++e)if(this[e][t]&n[e])return!1;return!0},Ws.prototype.only=function(t,n,e){var r,o;for(r=0,o=this.subarrays;r<o;++r)if(this[r][t]!=(r===n?e:0))return!1;return!0},Ws.prototype.onlyExcept=function(t,n,e,r,o){var i,a,s;for(a=0,s=this.subarrays;a<s;++a)if(i=this[a][t],a===n&&(i&=e),i!=(a===r?o:0))return!1;return!0};var qs={array8:zs,array16:zs,array32:zs,arrayLengthen:Hs,arrayWiden:Gs,bitarray:Ws},Ys=function(t,n){return function(e){var r=e.length;return[t.left(e,n,0,r),t.right(e,n,0,r)]}},Xs=function(t,n){var e=n[0],r=n[1];return function(n){var o=n.length;return[t.left(n,e,0,o),t.left(n,r,0,o)]}},Us=function(t){return[0,t.length]},Vs=function(t){return t},Qs=function(){return null},$s=function(){return 0};function Js(t){function n(t,n,r){for(var o=r-n,i=1+(o>>>1);--i>0;)e(t,i,o,n);return t}function e(n,e,r,o){for(var i,a=n[--o+e],s=t(a);(i=e<<1)<=r&&(i<r&&t(n[o+i])>t(n[o+i+1])&&i++,!(s<=t(n[o+i])));)n[o+e]=n[o+i],e=i;n[o+e]=a}return n.sort=function(t,n,r){for(var o,i=r-n;--i>0;)o=t[n],t[n]=t[n+i],t[n+i]=o,e(t,1,i,n);return t},n}var Ks=Js(Vs);Ks.by=Js;var Zs=Ks;function tc(t){var n=Zs.by(t);return function(e,r,o,i){var a,s,c,l=new Array(i=Math.min(o-r,i));for(s=0;s<i;++s)l[s]=e[r++];if(n(l,0,i),r<o){a=t(l[0]);do{t(c=e[r])>a&&(l[0]=c,a=t(n(l,0,i)[0]))}while(++r<o)}return l}}var nc=tc(Vs);nc.by=tc;var ec=nc;function rc(t){function n(n,e,r,o){for(;r<o;){var i=r+o>>>1;e<t(n[i])?o=i:r=i+1}return r}return n.right=n,n.left=function(n,e,r,o){for(;r<o;){var i=r+o>>>1;t(n[i])<e?r=i+1:o=i}return r},n}var oc=rc(Vs);oc.by=rc;var ic=oc,ac=function(t,n,e){for(var r=0,o=n.length,i=e?JSON.parse(JSON.stringify(t)):new Array(o);r<o;++r)i[r]=t[n[r]];return i},sc=function(t){return t+1},cc=function(t){return t-1},lc=function(t){return function(n,e){return n+ +t(e)}},uc=function(t){return function(n,e){return n-t(e)}},hc=function(t,n){var e=t[n];return"function"==typeof e?e.call(t):e},fc=/\[([\w\d]+)\]/g,dc=function(t,n){return function(t,n,e,r,o){for(o in r=(e=e.split(".")).splice(-1,1),e)n=n[e[o]]=n[e[o]]||{};return t(n,r)}(hc,t,n.replace(fc,".$1"))},mc=-1;gc.heap=Zs,gc.heapselect=ec,gc.bisect=ic,gc.permute=ac;var pc=gc;function gc(){var t,n={add:c,remove:l,dimension:f,groupAll:d,size:m,all:p,allFiltered:g,onChange:v,isElementFiltered:h},e=[],r=0,o=[],i=[],a=[],s=[];function c(o){var a=r,s=o.length;return s&&(e=e.concat(o),t.lengthen(r+=s),i.forEach((function(t){t(o,a,s)})),y("dataAdded")),n}function l(n){for(var i,s=new Array(r),c=[],l="function"==typeof n,u=0,h=0;u<r;++u)i=u,(l?n(e[i],i):t.zero(i))?(c.push(u),s[u]=mc):s[u]=h++;o.forEach((function(t){t(-1,-1,[],c,!0)})),a.forEach((function(t){t(s)}));for(var f=0,d=0;f<r;++f)s[f]!==mc&&(f!==d&&(t.copy(d,f),e[d]=e[f]),++d);e.length=r=d,t.truncate(d),y("dataRemoved")}function u(n){var e,r,o,i,a=Array(t.subarrays);for(e=0;e<t.subarrays;e++)a[e]=-1;for(r=0,o=n.length;r<o;r++)a[(i=n[r].id())>>7]&=~(1<<(63&i));return a}function h(n,e){var r=u(e||[]);return t.zeroExceptMask(n,r)}function f(n,s){if("string"==typeof n){var c=n;n=function(t){return dc(t,c)}}var l,u,h,f,d,m,p,g,v,b,w,x,_,A,k={filter:function(t){return null==t?z():Array.isArray(t)?j(t):"function"==typeof t?H(t):R(t)},filterExact:R,filterRange:j,filterFunction:H,filterAll:z,currentFilter:function(){return x},hasCurrentFilter:function(){return _},top:function(n,r){var o,i=[],a=N,c=0;for(r&&r>0&&(c=r);--a>=P&&n>0;)t.zero(o=m[a])&&(c>0?--c:(i.push(e[o]),--n));if(s)for(a=0;a<C.length&&n>0;a++)t.zero(o=C[a])&&(c>0?--c:(i.push(e[o]),--n));return i},bottom:function(n,r){var o,i,a=[],c=0;if(r&&r>0&&(c=r),s)for(o=0;o<C.length&&n>0;o++)t.zero(i=C[o])&&(c>0?--c:(a.push(e[i]),--n));for(o=P;o<N&&n>0;)t.zero(i=m[o])&&(c>0?--c:(a.push(e[i]),--n)),o++;return a},group:W,groupAll:function(){var t=W(Qs),n=t.all;return delete t.all,delete t.top,delete t.order,delete t.orderNatural,delete t.size,t.value=function(){return n()[0].value},t},dispose:q,remove:q,accessor:n,id:function(){return f}},C=[],T=function(t){return yc(t).sort((function(t,n){var e=p[t],r=p[n];return e<r?-1:e>r?1:t-n}))},L=Us,S=[],M=[],P=0,N=0,E=0;i.unshift(B),i.push(D),a.push(F);var I=t.add();function B(e,o,i){var a,c;if(s){E=0,G=0,A=[];for(var u=0;u<e.length;u++)for(G=0,A=n(e[u]);G<A.length;G++)E++;p=[],a=yc(e.length),c=vc(E,1);for(var f=yc(E),y=0,x=0;x<e.length;x++)if((A=n(e[x])).length)for(a[x]=A.length,G=0;G<A.length;G++)p.push(A[G]),f[y]=x,y++;else a[x]=0,C.push(x+o);var _=T(E);p=ac(p,_),g=ac(f,_)}else p=e.map(n),g=T(i),p=ac(p,g);var k,S,M,I=L(p),B=I[0],D=I[1];if(s)if(i=E,w)for(k=0;k<i;++k)w(p[k],k)||(0==--a[g[k]]&&(t[h][g[k]+o]|=l),c[k]=1);else{for(S=0;S<B;++S)0==--a[g[S]]&&(t[h][g[S]+o]|=l),c[S]=1;for(M=D;M<i;++M)0==--a[g[M]]&&(t[h][g[M]+o]|=l),c[M]=1}else if(w)for(k=0;k<i;++k)w(p[k],k)||(t[h][g[k]+o]|=l);else{for(S=0;S<B;++S)t[h][g[S]+o]|=l;for(M=D;M<i;++M)t[h][g[M]+o]|=l}if(!o)return d=p,m=g,v=a,b=c,P=B,void(N=D);var F,O=d,R=m,j=b,z=0;if(u=0,s&&(F=o,o=O.length,i=E),d=new Array(s?o+i:r),m=s?new Array(o+i):vc(r,r),s&&(b=vc(o+i,1)),s){var H=v.length;v=qs.arrayLengthen(v,r);for(var G=0;G+H<r;G++)v[G+H]=a[G]}for(var W=0;u<o&&z<i;++W)O[u]<p[z]?(d[W]=O[u],s&&(b[W]=j[u]),m[W]=R[u++]):(d[W]=p[z],s&&(b[W]=c[z]),m[W]=g[z++]+(s?F:o));for(;u<o;++u,++W)d[W]=O[u],s&&(b[W]=j[u]),m[W]=R[u];for(;z<i;++z,++W)d[W]=p[z],s&&(b[W]=c[z]),m[W]=g[z]+(s?F:o);I=L(d),P=I[0],N=I[1]}function D(t,n,e){S.forEach((function(t){t(p,g,n,e)})),p=g=null}function F(t){if(s){for(var n=0,e=0;n<C.length;n++)t[C[n]]!==mc&&(C[e]=t[C[n]],e++);for(C.length=e,n=0,e=0;n<r;n++)t[n]!==mc&&(e!==n&&(v[e]=v[n]),e++);v=v.slice(0,e)}for(var o,i=d.length,a=0,c=0;a<i;++a)t[o=m[a]]!==mc&&(a!==c&&(d[c]=d[a]),m[c]=t[o],s&&(b[c]=b[a]),++c);for(d.length=c,s&&(b=b.slice(0,c));c<i;)m[c++]=0;var l=L(d);P=l[0],N=l[1]}function O(n){var e=n[0],r=n[1];if(w)return w=null,G((function(t,n){return e<=n&&n<r}),0===n[0]&&n[1]===d.length),P=e,N=r,k;var i,a,c,u=[],f=[],p=[],g=[];if(e<P)for(i=e,a=Math.min(P,r);i<a;++i)u.push(m[i]),p.push(i);else if(e>P)for(i=P,a=Math.min(e,N);i<a;++i)f.push(m[i]),g.push(i);if(r>N)for(i=Math.max(e,N),a=r;i<a;++i)u.push(m[i]),p.push(i);else if(r<N)for(i=Math.max(P,r),a=N;i<a;++i)f.push(m[i]),g.push(i);if(s){var x=[],_=[];for(i=0;i<u.length;i++)v[u[i]]++,b[p[i]]=0,1===v[u[i]]&&(t[h][u[i]]^=l,x.push(u[i]));for(i=0;i<f.length;i++)v[f[i]]--,b[g[i]]=1,0===v[f[i]]&&(t[h][f[i]]^=l,_.push(f[i]));if(u=x,f=_,L===Us)for(i=0;i<C.length;i++)t[h][c=C[i]]&l&&(t[h][c]^=l,u.push(c));else for(i=0;i<C.length;i++)t[h][c=C[i]]&l||(t[h][c]^=l,f.push(c))}else{for(i=0;i<u.length;i++)t[h][u[i]]^=l;for(i=0;i<f.length;i++)t[h][f[i]]^=l}return P=e,N=r,o.forEach((function(t){t(l,h,u,f)})),y("filtered"),k}function R(t){return x=t,_=!0,O((L=Ys(ic,t))(d))}function j(t){return x=t,_=!0,O((L=Xs(ic,t))(d))}function z(){return x=void 0,_=!1,O((L=Us)(d))}function H(t){x=t,_=!0,w=t,L=Us,G(t,!1);var n=L(d);return P=n[0],N=n[1],k}function G(n,e){var r,i,a,c=[],f=[],p=[],g=[],w=d.length;if(!s)for(r=0;r<w;++r)!(t[h][i=m[r]]&l)^!!(a=n(d[r],r))&&(a?c.push(i):f.push(i));if(s)for(r=0;r<w;++r)n(d[r],r)?(c.push(m[r]),p.push(r)):(f.push(m[r]),g.push(r));if(s){var x=[],_=[];for(r=0;r<c.length;r++)1===b[p[r]]&&(v[c[r]]++,b[p[r]]=0,1===v[c[r]]&&(t[h][c[r]]^=l,x.push(c[r])));for(r=0;r<f.length;r++)0===b[g[r]]&&(v[f[r]]--,b[g[r]]=1,0===v[f[r]]&&(t[h][f[r]]^=l,_.push(f[r])));if(c=x,f=_,e)for(r=0;r<C.length;r++)t[h][i=C[r]]&l&&(t[h][i]^=l,c.push(i));else for(r=0;r<C.length;r++)t[h][i=C[r]]&l||(t[h][i]^=l,f.push(i))}else{for(r=0;r<c.length;r++)t[h][c[r]]&l&&(t[h][c[r]]&=u);for(r=0;r<f.length;r++)t[h][f[r]]&l||(t[h][f[r]]|=l)}o.forEach((function(t){t(l,h,c,f)})),y("filtered")}function W(n){var i={top:O,all:F,reduce:R,reduceCount:j,reduceSum:z,order:H,orderNatural:G,size:W,dispose:q,remove:q};M.push(i);var c,f,p,g,v,y,b,w,x=8,_=bc(x),A=0,k=Qs,C=Qs,T=!0,L=n===Qs;function P(i,a,l,m){s&&(w=l,l=d.length-i.length,m=i.length);var p,g,S,M,P,N,F=c,O=s?[]:vc(A,_),R=v,j=y,z=b,H=A,G=0,W=0;for(T&&(R=z=Qs),T&&(j=z=Qs),c=new Array(A),A=0,f=s?H?f:[]:H>1?qs.arrayLengthen(f,r):vc(r,_),H&&(S=(g=F[0]).key);W<m&&!((M=n(i[W]))>=M);)++W;for(;W<m;){for(g&&S<=M?(P=g,N=S,O[G]=A,(g=F[++G])&&(S=g.key)):(P={key:M,value:z()},N=M),c[A]=P;M<=N&&(p=a[W]+(s?w:l),s?f[p]?f[p].push(A):f[p]=[A]:f[p]=A,P.value=R(P.value,e[p],!0),t.zeroExcept(p,h,u)||(P.value=j(P.value,e[p],!1)),!(++W>=m));)M=n(i[W]);Y()}for(;G<H;)c[O[G]=A]=F[G++],Y();if(s)for(var q=0;q<r;q++)f[q]||(f[q]=[]);if(A>G)if(s)for(G=0;G<w;++G)for(q=0;q<f[G].length;q++)f[G][q]=O[f[G][q]];else for(G=0;G<l;++G)f[G]=O[f[G]];function Y(){s?A++:++A===_&&(O=qs.arrayWiden(O,x<<=1),f=qs.arrayWiden(f,x),_=bc(x))}p=o.indexOf(k),A>1||s?(k=E,C=B):(!A&&L&&(A=1,c=[{key:null,value:z()}]),1===A?(k=I,C=D):(k=Qs,C=Qs),f=null),o[p]=k}function N(t){if(A>1||s){var n,e,i,a=A,l=c,u=vc(a,a);if(s){for(n=0,i=0;n<r;++n)if(t[n]!==mc){for(f[i]=f[n],e=0;e<f[i].length;e++)u[f[i][e]]=1;++i}}else for(n=0,i=0;n<r;++n)t[n]!==mc&&(u[f[i]=f[n]]=1,++i);for(c=[],A=0,n=0;n<a;++n)u[n]&&(u[n]=A++,c.push(l[n]));if(A>1||s)if(s)for(n=0;n<i;++n)for(e=0;e<f[n].length;++e)f[n][e]=u[f[n][e]];else for(n=0;n<i;++n)f[n]=u[f[n]];else f=null;o[o.indexOf(k)]=A>1||s?(C=B,k=E):1===A?(C=D,k=I):C=k=Qs}else if(1===A){if(L)return;for(var h=0;h<r;++h)if(t[h]!==mc)return;c=[],A=0,o[o.indexOf(k)]=k=C=Qs}}function E(n,r,o,i,a){var d,m,p,g,b;if(!(n===l&&r===h||T))if(s){for(d=0,g=o.length;d<g;++d)if(t.zeroExcept(p=o[d],h,u))for(m=0;m<f[p].length;m++)(b=c[f[p][m]]).value=v(b.value,e[p],!1,m);for(d=0,g=i.length;d<g;++d)if(t.onlyExcept(p=i[d],h,u,r,n))for(m=0;m<f[p].length;m++)(b=c[f[p][m]]).value=y(b.value,e[p],a,m)}else{for(d=0,g=o.length;d<g;++d)t.zeroExcept(p=o[d],h,u)&&((b=c[f[p]]).value=v(b.value,e[p],!1));for(d=0,g=i.length;d<g;++d)t.onlyExcept(p=i[d],h,u,r,n)&&((b=c[f[p]]).value=y(b.value,e[p],a))}}function I(n,r,o,i,a){if(!(n===l&&r===h||T)){var s,f,d,m=c[0];for(s=0,d=o.length;s<d;++s)t.zeroExcept(f=o[s],h,u)&&(m.value=v(m.value,e[f],!1));for(s=0,d=i.length;s<d;++s)t.onlyExcept(f=i[s],h,u,r,n)&&(m.value=y(m.value,e[f],a))}}function B(){var n,o,i;for(n=0;n<A;++n)c[n].value=b();if(s){for(n=0;n<r;++n)for(o=0;o<f[n].length;o++)(i=c[f[n][o]]).value=v(i.value,e[n],!0,o);for(n=0;n<r;++n)if(!t.zeroExcept(n,h,u))for(o=0;o<f[n].length;o++)(i=c[f[n][o]]).value=y(i.value,e[n],!1,o)}else{for(n=0;n<r;++n)(i=c[f[n]]).value=v(i.value,e[n],!0);for(n=0;n<r;++n)t.zeroExcept(n,h,u)||((i=c[f[n]]).value=y(i.value,e[n],!1))}}function D(){var n,o=c[0];for(o.value=b(),n=0;n<r;++n)o.value=v(o.value,e[n],!0);for(n=0;n<r;++n)t.zeroExcept(n,h,u)||(o.value=y(o.value,e[n],!1))}function F(){return T&&(C(),T=!1),c}function O(t){var n=p(F(),0,c.length,t);return g.sort(n,0,n.length)}function R(t,n,e){return v=t,y=n,b=e,T=!0,i}function j(){return R(sc,cc,$s)}function z(t){return R(lc(t),uc(t),$s)}function H(t){function n(n){return t(n.value)}return p=ec.by(n),g=Zs.by(n),i}function G(){return H(Vs)}function W(){return A}function q(){var t=o.indexOf(k);return t>=0&&o.splice(t,1),(t=S.indexOf(P))>=0&&S.splice(t,1),(t=a.indexOf(N))>=0&&a.splice(t,1),(t=M.indexOf(i))>=0&&M.splice(t,1),i}return arguments.length<1&&(n=Vs),o.push(k),S.push(P),a.push(N),P(d,m,0,r),j().orderNatural()}function q(){M.forEach((function(t){t.dispose()}));var n=i.indexOf(B);return n>=0&&i.splice(n,1),(n=i.indexOf(D))>=0&&i.splice(n,1),(n=a.indexOf(F))>=0&&a.splice(n,1),t.masks[h]&=u,z()}return h=I.offset,l=I.one,u=~l,f=h<<7|Math.log(l)/Math.log(2),B(e,0,r),D(0,0,r),k}function d(){var n,a,s,c,l={reduce:d,reduceCount:m,reduceSum:function(t){return d(lc(t),uc(t),$s)},value:function(){return u&&(function(){var o;for(n=c(),o=0;o<r;++o)n=a(n,e[o],!0),t.zero(o)||(n=s(n,e[o],!1))}(),u=!1),n},dispose:p,remove:p},u=!0;function h(o,i){var c;if(!u)for(c=i;c<r;++c)n=a(n,e[c],!0),t.zero(c)||(n=s(n,e[c],!1))}function f(r,o,i,c,l){var h,f,d;if(!u){for(h=0,d=i.length;h<d;++h)t.zero(f=i[h])&&(n=a(n,e[f],l));for(h=0,d=c.length;h<d;++h)t.only(f=c[h],o,r)&&(n=s(n,e[f],l))}}function d(t,n,e){return a=t,s=n,c=e,u=!0,l}function m(){return d(sc,cc,$s)}function p(){var t=o.indexOf(f);return t>=0&&o.splice(t,1),(t=i.indexOf(h))>=0&&i.splice(t,1),l}return o.push(f),i.push(h),h(0,0),m()}function m(){return r}function p(){return e}function g(n){var o=[],i=0,a=u(n||[]);for(i=0;i<r;i++)t.zeroExceptMask(i,a)&&o.push(e[i]);return o}function v(t){if("function"==typeof t)return s.push(t),function(){s.splice(s.indexOf(t),1)};console.warn("onChange callback parameter must be a function!")}function y(t){for(var n=0;n<s.length;n++)s[n](t)}return t=new qs.bitarray(0),arguments.length?c(arguments[0]):n}function vc(t,n){return(n<257?qs.array8:n<65537?qs.array16:qs.array32)(t)}function yc(t){for(var n=vc(t,t),e=-1;++e<t;)n[e]=e;return n}function bc(t){return 8===t?256:16===t?65536:4294967296}function wc(){var t,n,e=[],r=this.annots;for(n=0;n<r.length;n++)t=r[n].annots,e=e.concat(t);return e}function xc(t){var n,e,r,o=[],i=this.annots;for(n in i)o.push({chr:i[n].chr,annots:[]});for(r=0;r<t.length;r++)o[(e=t[r]).chrIndex].annots.push(e);return o}function _c(){var t,n,e=this,r=e.rawAnnots.keys;for(e.unpackedAnnots=e.unpackAnnots(),e.crossfilter=pc(e.unpackedAnnots),e.annotsByFacet={},e.facets=r.slice(3,r.length),t=0;t<e.facets.length;t++)n=e.facets[t],e.annotsByFacet[n]=e.crossfilter.dimension((function(t){return t[n]}));"filterSelections"in e&&e.filterAnnots(e.filterSelections),e.filteredAnnots=e.annots}function Ac(t){var n,e,r,i=Date.now(),a=this;for(a.filterSelections=t,s=function(t,n){var e,r,o,i,a,s={};if(0===Object.keys(t).length)i=n.unpackedAnnots;else{for(r=0;r<n.facets.length;r++)(o=n.facets[r])in t?(a=t[o],e=Array.isArray(a)?function(t){return 2===a.length?a[0]<=t&&t<a[1]:4===a.length?a[0]<=t&&t<a[1]||a[2]<=t&&t<a[3]:void 0}:function(t){return t in a}):e=null,n.annotsByFacet[o].filter(e),s[o]=n.annotsByFacet[o].group().top(1/0);i=n.annotsByFacet[o].top(1/0)}return[i,s]}(t,a),e=(c=o(s,2))[0],r=c[1];n<a.facets.length;n++){var s,c;a.annotsByFacet[void 0].filterAll()}return e=a.packAnnots(e),delete a.maxAnnotsPerBar,delete a.maxAnnotsPerBarAllChrs,a.filteredAnnots=e,Zo.selectAll(a.selector+" polygon.annot").remove(),a.drawAnnots(e),console.log("Time in filterAnnots: "+(Date.now()-i)+" ms"),r}function kc(t){var n,e,r,i,a,s,c,l=t.id.split("-")[1],u=this;return r=t.bands,i=u.config.chrHeight,a=0,(s=void 0!==r)?(n=function(t,n,e,r){var o,i,a,s,c,l=0,u=n.id.split("-")[1],h=r.coordinateSystem,f=r.config.chrHeight;for(o=0;o<t.length;o++)a=(i=t[o])[h].stop-i[h].start,r._layout._isRotated?s=f*a/n.length:(c="relative"===r.config.chromosomeScale?r.maxLength[u][h]:r.maxLength[h],s=f*n.length/c*a/n.length),t[o].px={start:l,stop:l+s,width:s},l=t[o].px.stop,e&&"acen"===i.stain&&"p"===i.name[0]&&(n.pcenIndex=o);return[t,n,l]}(r,t,s,u),r=(e=o(n,3))[0],t=e[1],a=e[2]):(c="relative"===u.config.chromosomeScale?u.maxLength[l][u.coordinateSystem]:u.maxLength[u.coordinateSystem],a=i*t.length/c),t.width=a,t.scale=function(t,n,e){var r=e.config.chrHeight,o=t.length,i=e.maxLength,a=t.id.split("-")[1],s={};return s.bp=r/i.bp,!0===e.config.multiorganism?"relative"===e.config.chromosomeScale?(s.iscn=r*o/i[a].bp,s.bp=r/i[a].bp):s.iscn=r*o/i.bp:n&&(s.iscn=r/i.iscn),s}(t,s,u),t.bands=r,t}function Cc(t,n,e,r){var o,i,a={},s=this;return o=void 0!==t,a=function(t,n,e,r){if(void 0!==n){var o=n[n.length-1];t.name=e,t.length=o[r.coordinateSystem].stop,t.bpLength=o.bp.stop,t.type="nuclear"}else t=e;return t}(a,t,n,s),a.chrIndex=r,a.id="chr"+a.name+"-"+e,!0===s.config.fullChromosomeLabels&&(i=this.organisms[e],a.name=i.scientificName+" chr"+a.name),a.bands=t,(a=s.getChromosomePixels(a)).centromerePosition=function(t,n){if(!1===t)return"";var e=n[0],r=n.slice(-1)[0],o=(r.bp.stop-e.bp.start)/20;return"p"===e.name[0]&&"q"===n[1].name[0]&&e.bp.stop-e.bp.start<o?"telocentric-p":"p"===n.slice(-2)[0].name[0]&&"q"===r.name[0]&&r.bp.stop-r.bp.start<o?"telocentric-q":""}(o,t),a=function(t,n){return n&&1===t.bands.length&&delete t.bands,t}(a,o),a}function Tc(t){t.forEach((function(t){t.classList.remove("active")}))}function Lc(){Tc(document.querySelectorAll("#tools > ul > li")),document.querySelectorAll(".ideo-modal, .ideo-tool-panel").forEach((function(t){t.remove()})),document.querySelector("#tools").style.display="none"}function Sc(t){document.querySelector(t.selector).insertAdjacentHTML("beforebegin",'\n \n <style>\n\n #gear {\n position: absolute;\n right: 3px;\n top: 24px;\n z-index: 8001;\n cursor: pointer;\n height: 18px;\n width: 18px;\n }\n\n #tools {\n position: absolute;\n width: 120px;\n right: 27px;\n top: 16px;\n z-index: 8000;\n background: white;\n margin: 0;\n border: 1px solid #CCC;\n border-radius: 4px;\n box-shadow: -2px 4px 6px #CCC;\n }\n\n #tools ul {\n margin-block-start: 0;\n margin-block-end: 0;\n padding-inline-start: 0;\n }\n\n #tools li, #download li {\n padding: 2px 12px 2px 12px;\n cursor: pointer;\n }\n\n #tools li:hover,\n #tools li.active,\n #download li:hover {\n background: #DDD;\n }\n\n #tools li.ideo-disabled,\n #tools li.active.ideo-disabled,\n #download li.ideo-disabled {\n background: #FFF;\n color: #CCC;\n cursor: default;\n }\n\n #download {\n position: absolute;\n right: 3px;\n top: 16px;\n z-index: 8000;\n background: white;\n margin: 0;\n padding-inline-start: 0;\n }\n\n #settings {\n position: absolute;\n right: 3px;\n top: 16px;\n z-index: 8000;\n background: white;\n margin: 0;\n padding-inline-start: 0;\n }\n\n #about {\n position: absolute;\n right: 24px;\n top: -8px;\n z-index: 8000;\n background: white;\n width: 300px;\n border: 1px solid #CCC;\n padding: 10px;\n border-radius: 4px;\n box-shadow: -2px 4px 6px #CCC;\n cursor: default;\n }\n\n #close {\n float: right;\n border: 1px solid #DDD;\n border-radius: 4px;\n padding: 0 6px;\n background: #EEE;\n font-weight: bold;\n cursor: pointer;\n }\n\n #settings label {\n display: inline;\n text-decoration: underline;\n text-decoration-style: dotted;\n cursor: pointer;\n }\n\n #download {\n position: absolute;\n width: 120px;\n top: -2px;\n right: 120px;\n z-index: 8000;\n background: white;\n margin: 0;\n border: 1px solid #CCC;\n border-radius: 4px;\n box-shadow: -2px 4px 6px #CCC;\n }\n\n li {\n list-style-type: none;\n }\n\n #settings .no-underline {\n text-decoration: none;\n }\n\n #settings .setting {\n margin-right: 8px;\n }\n\n #settings input[type="checkbox"], #settings input[type="radio"] {\n position: relative;\n top: 2px;\n }\n\n .area-header {\n font-size: 16px;\n font-weight: bold;\n margin-bottom: 10px;\n clear: both;\n }\n\n .area-content {\n display: flex;\n flex-wrap: wrap;\n }\n\n .area-content > div {\n margin-right: 30px;\n margin-bottom: 15px;\n }\n\n .tab-panel input[type="number"] {\n width: 50px;\n }\n\n .tab-panel ul {\n width: 600px;\n list-style: none;\n border-bottom: 1px solid #CCC;\n box-sizing: border-box;\n margin-bottom: 0;\n padding-left: 0;\n }\n\n .tab-panel .nav:before, .tab-panel .nav:after {\n content: " ";\n display: table;\n clear: both;\n }\n\n .tab-panel li {\n float: left;\n margin-right: 2px;\n display: block;\n margin-bottom: -1px;\n }\n\n .tab-panel li > a {\n padding: 10px 15px;\n text-decoration: none;\n border-radius: 4px 4px 0 0;\n display: block;\n position: relative;\n }\n\n .tab-panel li.active > a {\n border: 1px solid #CCC;\n border-bottom: none;\n background-color: white;\n }\n\n .tab-panel .tab-content {\n width: 600px;\n }\n\n .tab-panel .tab-content > div {\n display: none;\n padding-top: 20px;\n clear: both;\n }\n\n .tab-panel .tab-content > div {\n padding: 20px 10px 5px 10px;\n }\n\n .tab-panel .tab-content > div.active {\n display: block;\n border: 1px solid #CCC;\n border-top: none;\n }\n\n </style>\n <div id="gear" style="display: none"><svg viewBox="0 0 512 512"><path fill="#AAA" d="M444.788 291.1l42.616 24.599c4.867 2.809 7.126 8.618 5.459 13.985-11.07 35.642-29.97 67.842-54.689 94.586a12.016 12.016 0 0 1-14.832 2.254l-42.584-24.595a191.577 191.577 0 0 1-60.759 35.13v49.182a12.01 12.01 0 0 1-9.377 11.718c-34.956 7.85-72.499 8.256-109.219.007-5.49-1.233-9.403-6.096-9.403-11.723v-49.184a191.555 191.555 0 0 1-60.759-35.13l-42.584 24.595a12.016 12.016 0 0 1-14.832-2.254c-24.718-26.744-43.619-58.944-54.689-94.586-1.667-5.366.592-11.175 5.459-13.985L67.212 291.1a193.48 193.48 0 0 1 0-70.199l-42.616-24.599c-4.867-2.809-7.126-8.618-5.459-13.985 11.07-35.642 29.97-67.842 54.689-94.586a12.016 12.016 0 0 1 14.832-2.254l42.584 24.595a191.577 191.577 0 0 1 60.759-35.13V25.759a12.01 12.01 0 0 1 9.377-11.718c34.956-7.85 72.499-8.256 109.219-.007 5.49 1.233 9.403 6.096 9.403 11.723v49.184a191.555 191.555 0 0 1 60.759 35.13l42.584-24.595a12.016 12.016 0 0 1 14.832 2.254c24.718 26.744 43.619 58.944 54.689 94.586 1.667 5.366-.592 11.175-5.459 13.985L444.788 220.9a193.485 193.485 0 0 1 0 70.2zM336 256c0-44.112-35.888-80-80-80s-80 35.888-80 80 35.888 80 80 80 80-35.888 80-80z"/></svg></div>\n <div id="tools" style="display: none">\n <ul>\n <li id="download-tool" class="ideo-tool-hover">Download <span style="float: right">▸</span></li>\n <li id="about-tool">About</li>\n </ul>\n </div>'),function(t){document.querySelector("#gear").addEventListener("click",(function(t){var n=document.querySelector("#tools");"none"===n.style.display?(n.style.display="",function(t){var n=document.querySelectorAll("#gear, #tools"),e=function(t){var e=0;n.forEach((function(n){n.contains(t.target)||(e+=1)})),e===n.length&&(Lc(),r())},r=function(){document.removeEventListener("click",e)};document.addEventListener("click",e)}()):(n.style.display="none",Lc())})),function(t){var n=document.querySelectorAll("#tools > ul > li");n.forEach((function(e){var r=function(t){return Array.from(t.classList).includes("ideo-tool-hover")?"mouseenter":"click"}(e);e.addEventListener(r,(function(o){Tc(n),e.classList+=" active";var i=e.id.split("-")[0],a=function(t,n){var e;return"download"===t&&(e='\n <div id="download" class="ideo-tool-panel">\n <li id="download-image">Image</li>\n <li id="download-annots" class="'.concat(document.querySelectorAll(".annot").length>0?"":"ideo-disabled",'">Annotations</li>\n </div>\n ')),"about"===t&&(e='\n <div id="about" class="ideo-modal">\n \n <a href="https://github.com/eweitz/ideogram" target="_blank" rel="noopener">\n Ideogram.js</a>, version 1.33.0 <span id="close">x</span><br/>\n <i>Chromosome visualization for the web</i>\n </div>'),e.trim()}(i);"mouseenter"===r?(e.insertAdjacentHTML("beforeend",a),function(t,n,e,r){"mouseenter"===t&&e.addEventListener("mouseleave",(function(t){var e=t.toElement,o=e.id,i=document.querySelector(".ideo-tool-panel");document.querySelector("#tools").contains(e)&&i&&!i.contains(e)&&o!==n&&(Tc(r),i.remove())}))}(r,i,e,n),"download"===i&&(document.querySelector("#download-image").addEventListener("click",(function(n){Lc(),function(t){var n=document.querySelector(t.selector),e="_ideo-undisplayed-dl-canvas";(r=document.createElement("canvas")).setAttribute("style","display: none"),r.setAttribute("id",e);var r,o=n.width.baseVal.value+30,i=n.cloneNode(!0);i.style.left="",r.setAttribute("width",o),document.body.appendChild(r),(r=document.getElementById(e)).width*=2,r.height*=2;var a=r.getContext("2d");a.setTransform(2,0,0,2,0,0),a.imageSmoothingEnabled=!1;var s=(new XMLSerializer).serializeToString(i),c=window.URL||window.webkitURL||window,l=new Image,u=new Blob([s],{type:"image/svg+xml;charset=utf-8"}),h=c.createObjectURL(u);l.onload=function(){var t,n,e;a.drawImage(l,0,0),c.revokeObjectURL(h),t=r.toDataURL("image/png").replace("image/png","image/octet-stream"),n=new MouseEvent("click",{view:window,bubbles:!1,cancelable:!0}),(e=document.createElement("a")).setAttribute("download","ideogram.png"),e.setAttribute("href",t),e.setAttribute("target","_blank"),e.setAttribute("id","_ideo-undisplayed-dl-image-link"),e.setAttribute("style","display: none;"),document.body.appendChild(e),e.dispatchEvent(n),r.remove()},l.src=h}(t)})),document.querySelector("#download-annots").addEventListener("click",(function(n){var e=document.querySelector("#download-annots");!1===Array.from(e.classList).includes("ideo-disabled")&&(Lc(),t.downloadAnnotations())})))):document.querySelector("#gear").insertAdjacentHTML("beforeend",a)}))})),document.querySelectorAll("#close").forEach((function(t){t.addEventListener("click",(function(){Lc()}))}))}(t)}(t),function(t){var n=document.querySelector(t.selector),e=document.querySelector("#gear"),r=document.querySelector("#tools");n.addEventListener("mouseover",(function(){return e.style.display=""})),n.addEventListener("mouseout",(function(){"none"===r.style.display&&(e.style.display="none")})),e.addEventListener("mouseover",(function(){return e.style.display=""}))}(t)}var Mc,Pc=function(){function t(n){u(this,t),this._model=n,this._class="ModelAdapter"}return f(t,[{key:"getModel",value:function(){return this._model}},{key:"getCssClass",value:function(){return""}}],[{key:"getInstance",value:function(n){return n.bands?new t(n):new Nc(n)}}]),t}(),Nc=function(t){i(e,t);var n=s(e);function e(t){var r;return u(this,e),(r=n.call(this,t))._class="ModelNoBandsAdapter",r}return f(e,[{key:"getModel",value:function(){this._model.bands=[];var t="MT"===this._model.name,n=this._model.width;return(n>1||t)&&this._model.bands.push({name:"q",px:{start:0,stop:n,width:n},bp:{start:1,stop:this._model.bpLength},iscn:{start:1,stop:this._model.length}}),this._model}},{key:"getCssClass",value:function(){return"noBands"}}]),e}(Pc),Ec=function(){function t(n){u(this,t),this._config=n,this._ploidy=new xi(this._config)}return f(t,[{key:"getArmColor",value:function(t,n,e){return this._config.armColors?this._config.armColors[e]:this._config.ancestors?this._getPolyploidArmColor(t,n,e):null}},{key:"getBorderColor",value:function(t,n,e){var r=this._config,o=r.chrBorderColor?r.chrBorderColor:"#000";return n<r.ploidy||this._ploidy.exists(t,n,e)?o:"#fff"}},{key:"getFillColor",value:function(){var t=this._config;if(!t.chrFillColor)return"#AAA";var n=t.chrFillColor;return"string"==typeof n?{arm:n,centromere:""}:n}},{key:"_getPolyploidArmColor",value:function(t,n,e){if(this._ploidy.exists(t,n,e)){var r=this._ploidy.getAncestor(t,n,e);return this._config.ancestors[r]}return"transparent"}}]),t}(),Ic=function(){function t(n){u(this,t),this._data=n,this.start=n.start,this.stop=n.stop,this.length=this.stop-this.start}return f(t,[{key:"getColor",value:function(t){return"ploidy"in this._data?"ploidy"in this._data&&this._data.ploidy[t]?this._getColor(t):"transparent":this._getColor(t)}},{key:"_getColor",value:function(t){return Array.isArray(this._data.color)?this._data.color[t]:this._data.color}}]),t}(),Bc=function(){function t(n,e,r){u(this,t),this._adapter=n,this._model=this._adapter.getModel(),this._config=e,this._ideo=r,this._color=new Ec(this._config),this._bumpCoefficient=5}return f(t,[{key:"_addPArmShape",value:function(t,n){return n?t.concat(this._getPArmShape()):t}},{key:"_addQArmShape",value:function(t,n){return n?t.concat(this._getQArmShape()):t}},{key:"render",value:function(t,n,e){var r,o,i,a,s,c,l,u;if(r=this,t=t.append("g").attr("class","bands").attr("clip-path","url(#"+this._model.id+"-chromosome-set-clippath)"),o=this._renderArm(t,n,e,"p"),i=this._renderArm(t,n,e,"q"),this._renderRangeSet(t,n,e),a=[],a=this._addPArmShape(a,o),a=this._addQArmShape(a,i),s="0",c="",l=this.isFullyBanded(),"ancestors"in this._ideo.config&&!("rangeSet"in this._ideo.config)?(c=r._color.getArmColor(n,e,0),l&&(s="0.5")):l?(s=null,c="transparent"):"ancestors"in this._ideo.config||(s="1"),this._ideo.config.chrFillColor){var h=r._color.getFillColor();c=h.arm,u=h.centromere}return t.append("g").attr("class","chromosome-border").selectAll("path").data(a).enter().append("path").attr("fill",c).style("fill-opacity",s).style("fill",(function(t){if("acen"===t.class&&u)return u})).attr("stroke",(function(t,o){return r._color.getBorderColor(n,e,o)})).attr("stroke-width",(function(t){return"strokeWidth"in t?t.strokeWidth:1})).attr("d",(function(t){return t.path})).attr("class",(function(t){return t.class})),a}},{key:"_renderRangeSet",value:function(t,n,e){var r,o,i,a;"rangeSet"in this._config&&(o=this._config.rangeSet.filter((function(t){return t.chr-1===n})).map((function(t){return new Ic(t)})),i=t.append("g").attr("class","range-set"),a=(r=this)._ideo,i.selectAll("rect.range").data(o).enter().append("rect").attr("class","range").attr("x",(function(t){return a.convertBpToPx(r._model,t.start)})).attr("y",0).attr("width",(function(t){return a.convertBpToPx(r._model,t.length)})).attr("height",this._config.chrWidth).style("fill",(function(t){return t.getColor(e)})))}},{key:"_getShapeData",value:function(){var t,n,e,r;for(n=0;n<this._model.bands.length;n++)if("q"===this._model.bands[n].name[0]){t=this._model.bands[n];break}return e=this._model.bands.length-1,r=this._model.bands[e].px.stop,{x1:0,x2:t?t.px.start:r,x3:r,w:this._config.chrWidth,b:this._config.chrWidth/this._bumpCoefficient}}},{key:"_getPArmShape",value:function(){var t=this._getShapeData(),n=t.x2-t.b;return this.isFullyBanded()||"ancestors"in this._ideo.config?{class:"",path:"M"+t.b+",0 L"+n+",0 Q"+(t.x2+t.b)+","+t.w/2+","+n+","+t.w+" L"+t.b+","+t.w+" Q-"+t.b+","+t.w/2+","+t.b+",0"}:[{class:"",path:"M"+t.b+",0 L"+(n-2)+",0 L"+(n-2)+","+t.w+" L"+t.b+","+t.w+" Q-"+t.b+","+t.w/2+","+t.b+",0"},{class:"acen",path:"M"+n+",0 Q"+(t.x2+t.b)+","+t.w/2+","+n+","+t.w+" L"+n+","+t.w+" L"+(n-2)+","+t.w+" L"+(n-2)+",0"}]}},{key:"_getQArmShape",value:function(){var t=this._getShapeData(),n=t.x3-t.b,e=t.x2+t.b;return this.isFullyBanded()||"ancestors"in this._ideo.config?{class:"",path:"M"+e+",0 L"+n+",0 Q"+(t.x3+t.b)+","+t.w/2+","+n+","+t.w+" L"+e+","+t.w+" Q"+(t.x2-t.b)+","+t.w/2+","+e+",0"}:[{path:"M"+e+",0 L"+n+",0 Q"+(t.x3+t.b)+","+t.w/2+","+n+","+t.w+" L"+e+","+t.w+" L"+e+",0"},{class:"acen",path:"M"+e+",0Q"+(t.x2-t.b)+","+t.w/2+","+e+","+t.w+" L"+e+","+t.w+"L"+(e+2)+","+t.w+"L"+(e+2)+",0"}]}},{key:"isFullyBanded",value:function(){return this._model.bands&&(2!==this._model.bands.length||"q"===this._model.bands[0].name[0])}},{key:"_renderBands",value:function(t,n,e,r,o){var i,a,s;a="p"===o?0:1,s="","ancestors"in(i=this)._ideo.config&&!i.isFullyBanded()&&(s=i._color.getArmColor(n,e,a)),t.selectAll("path.band."+o).data(r).enter().append("path").attr("id",(function(t){return i._model.id+"-"+t.name.replace(".","-")})).attr("class",(function(t){return"band "+o+"-band "+t.stain})).attr("d",(function(t){var n;return"M "+i._ideo.round(t.px.start)+", 0l "+(n=i._ideo.round(t.px.width))+" 0 l 0 "+i._config.chrWidth+" l -"+n+" 0 z"})).style("fill",s)}},{key:"_renderArm",value:function(t,n,e,r){var o=this._model.bands.filter((function(t){return t.name[0]===r}));return this._renderBands(t,n,e,o,r),Boolean(o.length)}}],[{key:"getInstance",value:function(t,n,e){var r=t.getModel().centromerePosition;return"telocentric-p"===r?new Fc(t,n,e):"telocentric-q"===r?new Oc(t,n,e):new Dc(t,n,e)}}]),t}(),Dc=function(t){i(e,t);var n=s(e);function e(t,r,o){var i;return u(this,e),(i=n.call(this,t,r,o))._class="MetacentricChromosome",i}return f(e)}(Bc),Fc=function(t){i(e,t);var n=s(e);function e(t,r,o){var i;return u(this,e),(i=n.call(this,t,r,o))._class="TelocentricPChromosome",i._pArmOffset=3,i}return f(e,[{key:"_addPArmShape",value:function(t){return t.concat(this._getPArmShape())}},{key:"_getPArmShape",value:function(){var t=this._getShapeData();return t.o=this._pArmOffset,[{class:"acen",path:"M"+(t.x2+2)+",1L"+(t.x2+t.o+3.25)+",1 L"+(t.x2+t.o+3.25)+","+(t.w-1)+" L"+(t.x2+2)+","+(t.w-1)},{class:"gpos66",path:"M"+(t.x2-t.o+5)+",0L"+(t.x2-t.o+3)+",0 L"+(t.x2-t.o+3)+","+t.w+" L"+(t.x2-t.o+5)+","+t.w,strokeWidth:.5}]}},{key:"_getQArmShape",value:function(){var t=this._getShapeData(),n=t.x3-t.b,e=this._pArmOffset+3;return{class:"",path:"M"+(t.x2+e)+",0 L"+n+",0 Q"+(t.x3+t.b)+","+t.w/2+","+n+","+t.w+" L"+(t.x2+e)+","+t.w}}}]),e}(Bc),Oc=function(t){i(e,t);var n=s(e);function e(t,r,o){var i;return u(this,e),(i=n.call(this,t,r,o))._class="TelocentricQChromosome",i._qArmOffset=3,i}return f(e,[{key:"_getPArmShape",value:function(){var t=this._getShapeData(),n=t.x3-t.b,e=this._qArmOffset;return{class:"",path:"M"+(t.x2+e)+",0 L"+(n+e)+",0 L"+(n+e)+","+t.w+" L"+t.b+","+t.w+" Q-"+t.b+","+t.w/2+","+t.b+",0"}}},{key:"_addQArmShape",value:function(t){return t.concat(this._getQArmShape())}},{key:"_getQArmShape",value:function(){var t=this._getShapeData();return t.o=this._qArmOffset,[{class:"acen",path:"M"+(t.x2+2)+",1 L"+(t.x2+t.o+3.25)+",1 L"+(t.x2+t.o+3.25)+","+(t.w-1)+" L"+(t.x2+2)+","+(t.w-1)},{class:"gpos66",path:"M"+(t.x2+t.o+5)+",0 L"+(t.x2+t.o+3)+",0 L"+(t.x2+t.o+3)+","+t.w+" L"+(t.x2+t.o+5)+","+t.w,strokeWidth:.5}]}}]),e}(Bc);function Rc(t,n,e,r){var o,i,a,s,c;s=Zo.select(this.selector+" defs"),c=Pc.getInstance(t),o=e*this.config.chrMargin,i=r.append("g").attr("id",t.id).attr("class","chromosome "+c.getCssClass()).attr("transform","translate(0, "+o+")"),a=Bc.getInstance(c,this.config,this).render(i,n,e),Zo.select("#"+t.id+"-chromosome-set-clippath").remove(),s.append("clipPath").attr("id",t.id+"-chromosome-set-clippath").selectAll("path").data(a).enter().append("path").attr("d",(function(t){return t.path})).attr("class",(function(t){return t.class})),t.width<1&&Zo.select("#"+t.id+" .bands").style("opacity",0)}function jc(t){var n,e,r,o,i,a;if(n=t.chrIndex,o=this._layout.getChromosomeSetTranslate(n),a=this.selector+" #"+t.id+"-chromosome-set",Zo.selectAll(a+" g").remove(),0===(e=Zo.select(a)).nodes().length&&(e=Zo.select(this.selector).append("g").attr("class","chromosome-set").attr("transform",o).attr("id",t.id+"-chromosome-set")),"sex"in this.config&&2===this.config.ploidy&&this.sexChromosomes.index===n)this.drawSexChromosomes(e,n);else for(r=1,this.config.ploidy>1&&(r=this._ploidy.getChromosomesNumber(n)),i=0;i<r;i++)this.appendHomolog(t,n,i,e)}function zc(t){var n,e;this.unhighlight(),this.config.taxid&&(n=t.id.split("-")[0].replace("chr",""),e=this.chromosomes[this.config.taxid][n].chrIndex,this._layout.rotate(e,e,t))}function Hc(){var t,n,e,r,o,i,a,s;n=(t=this).config,i=Zo.select(n.container+" svg#_ideogram"),r=Zo.select(n.container+" #_ideogramInnerWrap"),o=Zo.select(n.container+" #_ideogramMiddleWrap"),s=1===(a=n.ploidy)?a:1.12*a;var c=0;"annotationsLayout"in n&&(c=n.annotationHeight*n.numAnnotTracks),"vertical"===n.orientation&&"comparative"!==n.perspective&&"collinear"!==n.geometry&&(e=t.numChromosomes*(n.chrWidth+n.chrMargin+c),"heatmap-2d"!==n.annotationsLayout&&(e=Math.ceil(e*s/n.rows),"SmallLayout"===t._layout._class&&(e+=100),e+=35,o.style("height",t._layout.getHeight()+"px"),r.style("max-width",e+"px").style("overflow-x","scroll").style("position","absolute"),i.style("min-width",e-5+"px"),t.config.showTools&&Sc(t)))}function Gc(){(function(t){var n=t._layout;Zo.selectAll(t.selector+" .chromosome-set").insert("text",":first-child").data(t.chromosomesArray).attr("class",n.getChromosomeLabelClass()).attr("transform",n.getChromosomeSetLabelTranslate()).attr("x",n.getChromosomeSetLabelXPosition()).attr("y",(function(t,e){return n.getChromosomeSetLabelYPosition(e)})).attr("text-anchor",n.getChromosomeSetLabelAnchor()).each((function(n,e){!function(t,n,e,r){var o=function(t,n,e){var r;return r=-1===t.name.indexOf(" ")?[t.name]:t.name.match(/^(.*)\s+([^\s]+)$/).slice(1).reverse(),"sex"in e.config&&2===e.config.ploidy&&n===e.sexChromosomes.index&&(r="male"===e.config.sex?["XY"]:["XX"]),r}(t,n,r);Zo.select(e).selectAll("tspan").data(o).enter().append("tspan").attr("dy",(function(t,n){return-1.2*n+"em"})).attr("x",r._layout.getChromosomeSetLabelXPosition()).attr("class",(function(t,n){var e=r.config.fullChromosomeLabels;return 1===n&&e?"italic":null})).text(String)}(n,e,this,t)}))})(this),function(t){var n=t._layout;Zo.selectAll(t.selector+" .chromosome-set").each((function(e,r){Zo.select(this).selectAll(".chromosome").append("text").attr("class","chrLabel").attr("transform",n.getChromosomeSetLabelTranslate()).attr("x",(function(t,e){return n.getChromosomeLabelXPosition(e)})).attr("y",(function(t,e){return n.getChromosomeLabelYPosition(e)})).text((function(n,e){return t._ploidy.getAncestor(r,e)})).attr("text-anchor","middle")}))}(this)}function Wc(t,n,e,r){var o;n-=1,o=function(t){var n,e,r;return void 0===t||!t.hasOwnProperty("x")||1===t.x&&1===t.y?(n=-8,e=-16,t={x:1,y:1},r=""):(r="scale("+t.x+","+t.y+")",n=-6,e=""===t?-16:-14),{x:n,y:e,scaleSvg:r,scale:t}}(r),"vertical"===e||""===e?function(t,n,e,r){var o,i,a,s=r.config;n=function(t,n){return(n.numAnnotTracks>1||""===n.orientation)&&(t-=1),t}(n,s),o=-4,!0===s.showBandLabels&&(o=s.chrMargin+s.chrWidth+26),i=s.chrMargin*n,s.numAnnotTracks>1==0&&(i+=1),a=i+o,t.selectAll("text.chrLabel").attr("transform",e.scaleSvg).selectAll("tspan").attr("x",e.x).attr("y",a)}(t,n,o,this):function(t,n,e,r){var o,i,a,s=r.config;o=-s.chrWidth-2,!0===s.showBandLabels&&(o=s.chrMargin+8),i=s.annotTracksHeight,"overlay"!==s.annotationsLayout&&(i*=2),a=3-(s.chrMargin*n+o)+i,a/=e.scale.x,t.selectAll("text.chrLabel").attr("transform","rotate(-90)"+e.scaleSvg).selectAll("tspan").attr("x",a).attr("y",e.y)}(t,n,o,this)}function qc(t){return Math.round(performance.now()-t)}function Yc(t){t.time={rg:{t0:performance.now()}},"_didRelatedGenesFirstPlot"in t&&delete t._didRelatedGenesFirstPlot}function Xc(){var t=this.annotDescriptions.annots,n=Object.values(t).slice(),e=n.filter((function(t){return t.type&&t.type.includes("paralogous")})),r=n.filter((function(t){return t.type&&t.type.includes("interacting gene")}));return{related:n,paralogous:e,interacting:r,searched:Object.entries(t).filter((function(t){return t[1].type&&t[1].type.includes("searched gene")}))[0][0]}}function Uc(t){var n=this,e=performance.now()-n.time.prevTooltipOff,r=n.time.prevTooltipAnnotDomId;if(e<300&&t.domId===r)return null;var o=t.name,i=n.annotDescriptions.annots[t.name].type.split(" ")[0],a=Vc(n);return Object.assign({tooltipGene:o,tooltipRelatedType:i},a)}function Vc(t){var n=t.getRelatedGenesByType();return{numRelatedGenes:n.related.length,numParalogs:n.paralogous.length,numInteractingGenes:n.interacting.length,searchedGene:n.searched}}function Qc(t,n){var e="WBGene"===t?8:11;return t+n.padStart(e,"0")}function $c(t,n){return Jc.apply(this,arguments)}function Jc(){return Jc=e(d().mark((function t(n,r){var i,a,s,c,l,u,h,f,m,p,g,v,y,b,w,x,_=arguments;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=_.length>2&&void 0!==_[2]?_[2]:null,a=performance.now(),Mc={},function(t){var n=function(t){var n=function(t){for(var n in t=hi(t),Ko){var e=Ko[n],r=hi(e.commonName),o=hi(e.scientificName);if(r===t||o===t)return n}return null}(t);return Ko[n]}(t);return n.hasGeneCache&&!0===n.hasGeneCache}(n)){t.next=4;break}return t.abrupt("return");case 4:if(!Ideogram.geneCache||!Ideogram.geneCache[n]){t.next=6;break}return t.abrupt("return",void(r.geneCache=Ideogram.geneCache[n]));case 6:return Ideogram.geneCache||(Ideogram.geneCache={}),t.next=9,caches.open("ideogram-1.33.0");case 9:return Ideogram.cache=t.sent,s=function(t,n,e){var r=hi(t);if(!n){var o=e.config.dataDir.split("/"),i=o.indexOf("data");n=o.slice(0,i).join("/")+"/data/cache/"}return n+r+"-genes.tsv"}(n,i,r),c=performance.now(),t.next=14,function(){var t=e(d().mark((function t(n){return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=void 0,t.next=3,Ideogram.cache.match(n);case 3:if(t.t1=t.sent,t.t2=t.t0===t.t1,!t.t2){t.next=8;break}return t.next=8,Ideogram.cache.add(n);case 8:return t.next=10,Ideogram.cache.match(n);case 10:return t.abrupt("return",t.sent);case 11:case"end":return t.stop()}}),t)})));return function(n){return t.apply(this,arguments)}}()(s);case 14:return l=t.sent,t.next=17,l.text();case 17:u=t.sent,h=performance.now(),Mc.fetch=Math.round(h-c),f=function(t,n){var e,r=[],i={},a={},s={},c={},l={},u=[],h=performance.now(),f=t.split(/\r\n|\n/);Mc.rawTsvSplit=Math.round(performance.now()-h),h=performance.now();for(var d=0;d<f.length;d++){var m=f[d];if(""!==m)if("#"!==m[0]){var p=o(m.trim().split(/\t/),5),g=p[0],v=p[1],y=p[2],b=p[3],w=p[4],x=parseInt(v),_=x+parseInt(y),A=Qc(e,b);u.push([g,x,_,A,w]);var k=[g,x,_];r.push(w),i[w.toLowerCase()]=w,a[A]=w,s[w]=A,c[w]=k,l[A]=k}else"## prefix"===m.slice(0,9)&&(e=m.split("prefix: ")[1])}var C=performance.now();Mc.parseCacheLoop=Math.round(C-h);var T=function(t){for(var n={},e=0;e<t.length;e++){var r=o(t[e],5),i=r[0],a=r[1],s=r[2],c=r[3],l=r[4];if(i in n){var u={name:l,start:a,stop:s,ensemblId:c};n[i].annots.push(u)}else n[i]={chr:i,annots:[]}}var h={};return Object.entries(n).forEach((function(t){var n=o(t,2),e=n[0],r=n[1];h[e]={chr:e,annots:r.annots.sort((function(t,n){return t.start-n.start}))}})),h}(u);return Mc.parseAnnots=Math.round(performance.now()-C),[r,i,a,s,c,l,T]}(u),m=o(f,7),p=m[0],g=m[1],v=m[2],y=m[3],b=m[4],w=m[5],x=m[6],Mc.parseCache=Math.round(performance.now()-h),r.geneCache={interestingNames:p,nameCaseMap:g,namesById:v,idsByName:y,lociByName:b,lociById:w,sortedAnnots:x},Ideogram.geneCache[n]=r.geneCache,r.config.debug&&(Mc.total=Math.round(performance.now()-a),console.log("perfTimes in initGeneCache:",Mc));case 22:case"end":return t.stop()}}),t)}))),Jc.apply(this,arguments)}var Kc={Arrow:["acts on","acted on by"],TBar:["inhibits","is inhibited by"],"mim-binding":["binds","binds"],"mim-catalysis":["catalyzes","catalyzed by"],"mim-cleavage":["cleaves","cleaved by"],"mim-conversion":["converts","converted by"],"mim-inhibition":["inhibits","is inhibited by"],"mim-modification":["modifies","is modified by"],"mim-necessary-stimulation":["necessarily stimulates","is necessarily stimulated by"],"mim-stimulation":["stimulates","is stimulated by"],"mim-transcription-translation":["transcribes / translates","is transcribed / translated by"]};function Zc(t){return tl.apply(this,arguments)}function tl(){return tl=e(d().mark((function t(n){var e;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch("https://mygene.info/v3/query"+n+"&size=400");case 2:return e=t.sent,t.next=5,e.json();case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)}))),tl.apply(this,arguments)}function nl(t){var n=t.name,e=t.genomic_pos.ensemblgene,r=e;return void 0===e&&(r=t.genomic_pos.filter((function(t){return!t.chr.includes("_")}))[0].ensemblgene),{name:n,ensemblId:r}}function el(t,n){var e=n.organismScientificName;throw Error('"'.concat(t,'" is not a known gene in ').concat(e))}function rl(t,n,e){return ol.apply(this,arguments)}function ol(){return ol=e(d().mark((function t(n,e,r){var o,i,a,s;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("string"==typeof n&&(n=[n]),i="?q=".concat(n.map((function(t){return"".concat(e,":").concat(t.trim())})).join(" OR "),"&species=").concat(r.config.taxid,"&fields="),!r.geneCache){t.next=7;break}a=function(t,n,e){var r=e.geneCache,o="symbol"===n,i=o?r.lociByName:r.lociById,a=o?r.idsByName:r.namesById;return t.map((function(t){var n=t.toLowerCase();if(!i[t]&&!r.nameCaseMap[n]){if(!o)return;el(t,e)}o&&!i[t]&&r.nameCaseMap[n]&&(t=r.nameCaseMap[n]);var s=i[t],c=o?t:a[t],l=o?a[t]:t;return{symbol:c,name:"",source:"cache",genomic_pos:{chr:s[0],start:s[1],end:s[2],ensemblgene:l}}})).filter((function(t){return void 0!==t}))}(n,e,r),o=Zc("".concat(i,"symbol,name")).then((function(t){t.hits.forEach((function(t){var n=t.symbol,e=t.name;n in r.annotDescriptions.annots?r.annotDescriptions.annots[n].name=e:r.annotDescriptions.annots[n]={name:e}}))})),o={hits:a,fromGeneCache:!0},t.next=11;break;case 7:return s="".concat(i,"symbol,genomic_pos,name"),t.next=10,Zc(s);case 10:o=t.sent;case 11:return t.abrupt("return",o);case 12:case"end":return t.stop()}}),t)}))),ol.apply(this,arguments)}function il(t,n){return Array.isArray(t.genomic_pos)?t.genomic_pos.filter((function(t){return t.chr in n.chromosomes[n.config.taxid]}))[0]:t.genomic_pos}function al(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"red",r=il(t,n);return{name:t.symbol,chr:r.chr,start:r.start,stop:r.end,id:r.ensemblgene,color:e}}function sl(){var t=document.querySelector("#_ideogramInnerWrap"),n="position: absolute; top: 15px; left: ".concat(_l({}).legendPad+20,"px"),e=document.querySelector("#_ideogramLegend");t.prepend(e),e.style=n}function cl(t,n){return new Promise(function(){var o=e(d().mark((function o(i){var a,s,c,l;return d().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return s=performance.now(),o.next=3,function(){var t=e(d().mark((function t(n,e){var r,o,i,a,s;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={},o={},i=e.config.organism.replace(/-/g," "),a="https://webservice.wikipathways.org/findInteractions?query=".concat(n.name,"&format=json"),t.next=6,fetch(a);case 6:return s=t.sent,t.next=9,s.json();case 9:return t.sent.result.forEach((function(t){if(t.species.toLowerCase()===i){var a=t.fields.right.values,s=t.fields.left.values,c=a.concat(s),l=t.name,u=t.id;c.forEach((function(t){if(!t.includes(n.name)){var i=l+u,a=function(t,n,e,r,o){var i;return i="geneCache"in o&&n.name?t.toLowerCase()in o.geneCache.nameCaseMap:function(t,n){return""!==t&&!t.includes(" ")&&!t.includes("/")&&t.toLowerCase()!==n.name.toLowerCase()}(t,n),i&&!(e in r)}(t,n,i,o,e);if(a){o[i]=1;var s={name:l,pathwayId:u};t in r?r[t].push(s):r[t]=[s]}}}))}})),t.abrupt("return",r);case 11:case"end":return t.stop()}}),t)})));return function(n,e){return t.apply(this,arguments)}}()(t,n);case 3:return c=o.sent,o.next=6,function(){var t=e(d().mark((function t(n,e,r){var o,i;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=[],i=Object.keys(n),t.t0=0===i.length,t.t0){t.next=6;break}return t.next=5,rl(i,"symbol",r);case 5:t.sent.hits.forEach((function(t){if("genomic_pos"in t!=0&&t.symbol!==e.name){var i=al(t,r,"purple");o.push(i);var a=function(t,n,e){var r=[],o=[],i="";if(void 0!==n){var a=n.map((function(t){var n="".concat("https://www.wikipathways.org/index.php/Pathway:").concat(t.pathwayId);return r.push(t.pathwayId),o.push(t.name),'<a href="'.concat(n,'" target="_blank">').concat(t.name,"</a>")})).join("<br/>");i="Interacts with ".concat(e.name," in:<br/>").concat(a)}var s=nl(t),c=s.name;return{description:i,ixnsDescription:i,ensemblId:s.ensemblId,name:c,type:"interacting gene",pathwayIds:r,pathwayNames:o}}(t,n[t.symbol],e);hl(i,a,r)}}));case 6:return t.abrupt("return",o);case 7:case"end":return t.stop()}}),t)})));return function(n,e,r){return t.apply(this,arguments)}}()(c,t,n);case 6:l=o.sent,(a=n.relatedAnnots).push.apply(a,r(l)),dl("interacting",n),n.time.rg.interactions=qc(s),i();case 8:case"end":return o.stop()}}),o)})));return function(t){return o.apply(this,arguments)}}())}function ll(t,n){return new Promise(function(){var o=e(d().mark((function o(i){var a,s,c;return d().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return s=performance.now(),o.next=3,function(){var t=e(d().mark((function t(n,r){var o,i,a,s;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o="&format=condensed&type=paralogues&target_taxon=".concat(r.config.taxid),i="/homology/id/".concat(n.id,"?").concat(o),t.next=4,Ideogram.fetchEnsembl(i);case 4:return a=t.sent.data[0].homologies,t.next=7,function(){var t=e(d().mark((function t(n,e,r){var o,i;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=[],i=n.map((function(t){return t.id})),t.next=3,rl(i,"ensemblgene",r);case 3:return t.sent.hits.forEach((function(t){if("genomic_pos"in t!=0&&"name"in t!=0){var n=al(t,r,"pink");o.push(n);var i="Paralog of ".concat(e.name),a=nl(t),s=a.name;hl(n,{description:i,ensemblId:a.ensemblId,name:s,type:"paralogous gene"},r)}})),t.abrupt("return",o);case 5:case"end":return t.stop()}}),t)})));return function(n,e,r){return t.apply(this,arguments)}}()(a,n,r);case 7:return s=t.sent,t.abrupt("return",(s=s.filter((function(t){return!t.name.match(/^AC[0-9.]+$/)})),s));case 9:case"end":return t.stop()}}),t)})));return function(n,e){return t.apply(this,arguments)}}()(t,n);case 3:c=o.sent,(a=n.relatedAnnots).push.apply(a,r(c)),dl("paralogous",n),n.time.rg.paralogs=qc(s),i();case 5:case"end":return o.stop()}}),o)})));return function(t){return o.apply(this,arguments)}}())}function ul(t,n){var e,r,o,i,a,s;return"name"in t?(o=t.name,i=n.name,a=t.color,s=n.color):(o=(e=[t[0],t[3]])[0],a=e[1],i=(r=[n[0],n[3]])[0],s=r[1]),"red"===a?-1:"red"===s?1:"purple"===a&&"pink"===s?-1:"purple"===s&&"pink"===a?1:i.length!==o.length?i.length-o.length:0===[o,i].sort().indexOf(o)?1:-1}function hl(t,n,e){var r,o=e.annotDescriptions.annots;if(t.name in o){var i=o[t.name];if(r=n,n.type===i.type)return;Object.keys(i).forEach((function(t){t in r==0&&(r[t]=i[t])})),r.type+=", "+i.type,r.description+="<br/><br/>".concat(i.description)}else r=n;e.annotDescriptions.annots[t.name]=r}function fl(t){var n={},e=[];return t.forEach((function(t){t.name in n==0?(e.push(t),n[t.name]=1):"purple"===t.color&&(e=e.map((function(n){return t.name===n.name?t:n})))})),e}function dl(t,n){var e=n.relatedAnnots.slice();e=function(t,n){if("all"===n.config.annotsInList)return t;var e=[];return t.forEach((function(t){n.config.annotsInList.includes(t.name.toLowerCase())&&e.push(t)})),e}(e,n),e=ba(e=fl(e),40,n),n.relatedAnnots=fl(e),n.relatedAnnots=ba(e,40,n),e.sort(ul),n.relatedAnnots.sort(ul),e.length>1&&n.onFindRelatedGenesCallback&&n.onFindRelatedGenesCallback(),n.drawAnnots(e),n.config.showAnnotLabels&&(function(t){var n=[],e=t.chromosomesArray.map((function(t){return t.name})),r={};t.relatedAnnots.forEach((function(t){t.chr in r?r[t.chr].push(t):r[t.chr]=[t]}));var i={};Object.entries(r).map((function(n){var e=o(n,2),r=e[0],a=e[1];a.sort((function(n,e){return t.annotSortFunction(n,e)}));var s=a.map((function(t){return t.name})).reverse();i[r]=s})),t.relatedAnnots.forEach((function(t){var r=t.chr,o=e.indexOf(r),a=i[r].indexOf(t.name);t.domId=Ya(o,a),n.push(t)})),t.relatedAnnots=n}(n),n.fillAnnotLabels(n.relatedAnnots)),sl(),function(t,n){var e=n.getRelatedGenesByType(),r={paralogous:"interacting",interacting:"paralogous"}[t],o=e[t].length,i=e[r]?e[r].length:0;if(n._didRelatedGenesFirstPlot)if(o>0&&i>0){var a=n.time.rg.timestampFirstPlot;n.time.rg.totalLastPlotDiff=qc(a)}else o>0&&0===i?(n.time.rg.timestampFirstPlot=performance.now(),n.time.rg.totalFirstPlot=qc(n.time.rg.t0),n._relatedGenesFirstPlotType=t,n.time.rg.totalLastPlotDiff=0):(0===o&&i>0||(n._relatedGenesFirstPlotType="searched"),n.time.rg.totalLastPlotDiff=0);else n._didRelatedGenesFirstPlot=!0,n.time.rg.totalFirstPlot=qc(n.time.rg.t0),o>0&&(n.time.rg.timestampFirstPlot=performance.now(),n._relatedGenesFirstPlotType=t)}(t,n)}function ml(t){var n=document.querySelector(t.config.container);n.style.visibility="",n.style.position="absolute",n.style.width="100%";var e=document.querySelector("#_ideogramInnerWrap");e.style.position="relative",e.style.marginLeft="auto",e.style.marginRight="auto",e.style.overflowY="hidden",document.querySelector("#_ideogramMiddleWrap").style.overflowY="hidden";var r=t.config.legendPad;if(void 0===t.didAdjustIdeogramLegend){var o=document.querySelector("#_ideogram");e.style.maxWidth=parseInt(e.style.maxWidth)+160+r+"px",o.style.minWidth=parseInt(o.style.minWidth)+r+"px",o.style.maxWidth=parseInt(o.style.minWidth)+r+"px",o.style.position="relative",o.style.left="160px",t.didAdjustIdeogramLegend=!0}}function pl(){return gl.apply(this,arguments)}function gl(){return gl=e(d().mark((function t(){var n,r,o,i,a,s,c=arguments;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=c.length>0&&void 0!==c[0]?c[0]:null,(r=this).clearAnnotLabels(),(o=document.querySelector("#_ideogramLegend"))&&o.remove(),n){t.next=6;break}return t.abrupt("return",Al());case 6:return r.config=_l(r.config),i=["# Related genes for ".concat(n," in ").concat(r.getScientificName(r.config.taxid)),"# Generated by Ideogram.js version ".concat(Ideogram.version,", https://github.com/eweitz/ideogram"),"# Generated at ".concat(window.location.href)].join("\n"),delete r.annotDescriptions,r.annotDescriptions={headers:i,annots:{}},a=r.selector+" .annot",document.querySelectorAll(a).forEach((function(t){return t.remove()})),r.startHideAnnotTooltipTimeout(),document.querySelectorAll(".chromosome").forEach((function(t){t.style.cursor=""})),ml(r),r.relatedAnnots=[],t.next=13,function(){var t=e(d().mark((function t(n,e){var r,o,i,a,s,c;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=performance.now(),t.next=3,rl(n,"symbol",e);case 3:if(0!==(o=t.sent).hits.length){t.next=6;break}return t.abrupt("return");case 6:return i=o.hits.find((function(t){var n=il(t,e);return n&&n.ensemblgene})),a={description:"",ensemblId:i.genomic_pos.ensemblgene,type:"searched gene"},i.symbol in e.annotDescriptions.annots?(s=e.annotDescriptions.annots[i.symbol],a=Object.assign(s,a)):a.name=i.name,e.annotDescriptions.annots[i.symbol]=a,c=al(i,e),t.abrupt("return",(e.relatedAnnots.push(c),e.time.rg.searchedGene=qc(r),c));case 12:case"end":return t.stop()}}),t)})));return function(n,e){return t.apply(this,arguments)}}()(n,r);case 13:return void 0===(s=t.sent)&&el(n,r),r.config.legend=wl,Sa(r),sl(),t.next=20,Promise.all([cl(s,r),ll(s,r)]);case 20:r.time.rg.total=qc(r.time.rg.t0),function(t){var n=Vc(t),e=t.time.rg.total,r=t.time.rg.totalFirstPlot,o=t.time.rg.totalLastPlotDiff,i=t.time.rg.paralogs,a=t.time.rg.interactions,s=t.time.rg.searchedGene,c=t._relatedGenesFirstPlotType,l=Object.assign({firstPlotType:c,timeTotal:e,timeTotalFirstPlot:r,timeTotalLastPlotDiff:o,timeSearchedGene:s,timeInteractingGenes:a,timeParalogs:i},n);t.relatedGenesAnalytics=l}(r),r.onPlotRelatedGenesCallback&&r.onPlotRelatedGenesCallback();case 23:case"end":return t.stop()}}),t,this)}))),gl.apply(this,arguments)}function vl(t){var n=this,r=n.annotDescriptions.annots[t.name],i=r.description.length>0?"<br/>".concat(r.description):"",a=r.name,s='<span id="ideo-related-gene" style="color: #0366d6; cursor: pointer;">'.concat(t.name,"</span><br/>").concat(a,"<br/>").concat(i,"<br/>");return t.displayName=s,r.type.includes("interacting gene")&&(r.originalDisplay=s,r.description=i,function(t,n,r){var i,a=n.description,s=n.originalDisplay,c=n.pathwayIds;t.displayName=t.displayName.replace(a,""),(i=e(d().mark((function t(n,r,i){var a;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a={},t.next=3,Promise.all(r.map(function(){var t=e(d().mark((function t(r){var s;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,function(){var t=e(d().mark((function t(n,e,r){var i,a,s,c,l,u,h,f,m,p,g,v,y,b;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i="https://webservice.wikipathways.org/getPathway?pwId=".concat(e,"&format=json"),t.next=3,fetch(i);case 3:return a=t.sent,t.next=6,a.json();case 6:return s=t.sent.pathway.gpml,c=(new DOMParser).parseFromString(s,"text/xml"),l=Object.entries(r.annotDescriptions.annots).find((function(t){var n=o(t,2);return n[0],"searched gene"===n[1].type}))[0],u=c.querySelectorAll('DataNode[TextLabel="'.concat(l,'"],DataNode[TextLabel="').concat(n,'"]')),h=Array.from(u).map((function(t){return{textLabel:t.getAttribute("TextLabel"),graphId:t.getAttribute("GraphId"),groupRef:t.getAttribute("GroupRef")}})),f=h.map((function(t){return t.graphId})),m=h.map((function(t){return t.groupRef})).map((function(t){return'Group[GroupId="'.concat(t,'"]')})).join(","),p=c.querySelectorAll(m),g=Array.from(p).map((function(t){return{graphId:t.getAttribute("GraphId"),groupId:t.getAttribute("GroupId")}})).map((function(t){return t.graphId})),v=f.concat(g),y=[],b=c.querySelectorAll("Interaction Graphics"),t.abrupt("return",(Array.from(b).forEach((function(t){var n=[],e=0,r=null,o=null;if(Array.from(t.children).forEach((function(t){if("Point"===t.nodeName){var i=t,a=i.getAttribute("GraphRef");if(null!==a&&v.includes(a)&&(e+=1,n.push(a),i.getAttribute("ArrowHead"))){var s=i.getAttribute("ArrowHead"),c=h.find((function(t){return t.graphId=a})).textLabel===l;null===o&&(o=c?0:1),r=Kc[s][c?0:1]}}})),e>=2){if(null===o){var i=h.indexOf(h.find((function(t){return t.textLabel=l})));o=i,r="interacts with"}r=r[0].toUpperCase()+r.slice(1);var a={interactionId:t.parentNode.getAttribute("GraphId"),endIds:n,ixnType:r,genes:h,searchedGeneIndex:o};y.push(a)}})),y));case 19:case"end":return t.stop()}}),t)})));return function(n,e,r){return t.apply(this,arguments)}}()(n,r,i);case 2:s=t.sent,a[r]=s;case 4:case"end":return t.stop()}}),t)})));return function(n){return t.apply(this,arguments)}}()));case 3:return t.abrupt("return",a);case 4:case"end":return t.stop()}}),t)}))),function(t,n,e){return i.apply(this,arguments)})(t.name,c,r).then((function(t){var n=document.querySelector("#_ideogramTooltip").innerHTML.match(/<br\/?>chr.*/)[0],e=t[c[0]];if(void 0!==e){var r=s.replaceAll(/(<br\/?>){3,}/g,"<br/><br/>"),o=r+n,i=e.every((function(t){return t.ixnType===e[0].ixnType}));if(e.length>0&&i){var a=e[0].ixnType;o=r.replace("Interacts with",a)+n}document.querySelector("#_ideogramTooltip").innerHTML=o}}))}(t,r,n)),function(t){var n=document.querySelector("._ideogramTooltip");t.addedTooltipClickHandler||(n.addEventListener("click",(function(){var n=function(t,n){var e;return n.annots.forEach((function(n){n.annots.forEach((function(n){t===n.name&&(e=n)}))})),e}(document.querySelector("#ideo-related-gene").textContent,t);t.onClickAnnot(n)})),t.addedTooltipClickHandler=!0)}(n),t}var yl="triangle",bl="font-size: 14px; font-weight: bold; font-color: #333;",wl=[{name:'\n <div style="position: relative; left: 30px;">\n <div style="'.concat(bl,'">Related genes</div>\n <i>Click gene to search</i>\n </div>\n '),nameHeight:50,rows:[{name:"Interacting gene",color:"purple",shape:yl},{name:"Paralogous gene",color:"pink",shape:yl},{name:"Searched gene",color:"red",shape:yl}]}],xl=[{name:'\n <div style="position: relative; left: 30px;">\n <div style="'.concat(bl,'">Highly cited genes</div>\n <i>Click gene to search</i>\n </div>\n '),nameHeight:30,rows:[]}];function _l(t){return t.showAnnotLabels?t.legendPad=70:t.legendPad=30,t}function Al(){var t=this;if(t&&!("annotDescriptions"in t)){t.annotDescriptions={annots:{}},t.flattenAnnots().map((function(n){var e=[];"significance"in n&&"n/a"!==n.significance&&e.push(n.significance),"citations"in n&&void 0!==n.citations&&e.push(n.citations),e=e.join("<br/><br/>"),t.annotDescriptions.annots[n.name]={description:e,name:n.fullName}})),ml(t),sl(),t.fillAnnotLabels();var n=t.config.container;document.querySelector(n).style.visibility=""}}var kl=function(){function t(n){u(this,t),this.configure=vi,this.initDrawChromosomes=Bi,this.onLoad=Fi,this.handleRotateOnClick=Di,this.init=Gi,this.finishInit=wi,this.writeContainer=Si,this.onLoadAnnots=sa,this.onDrawAnnots=ca,this.processAnnotData=Va,this.restoreDefaultTracks=za,this.updateDisplayedTracks=Ha,this.initAnnotSettings=Ja,this.fetchAnnots=ts,this.drawAnnots=Ma,this.getHistogramBars=Aa,this.drawHeatmaps=oa,this.deserializeAnnotsForHeatmap=aa,this.fillAnnots=ns,this.drawProcessedAnnots=Pa,this.drawSynteny=ja,this.startHideAnnotTooltipTimeout=la,this.showAnnotTooltip=fa,this.onWillShowAnnotTooltip=ua,this.onClickAnnot=ha,this.setOriginalTrackIndexes=Ga,this.afterRawAnnots=Ka,this.downloadAnnotations=$a,this.addAnnotLabel=ya,this.removeAnnotLabel=xa,this.fillAnnotLabels=wa,this.clearAnnotLabels=_a,this.flattenAnnots=Za,this.highlight=es,this.unhighlight=rs,this.esearch="https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?retmode=json&api_key=7e33ac6a08a6955ec3b83d214d22b21a2808",this.esummary="https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?retmode=json&api_key=7e33ac6a08a6955ec3b83d214d22b21a2808",this.elink="https://eutils.ncbi.nlm.nih.gov/entrez/eutils/elink.fcgi?retmode=json&api_key=7e33ac6a08a6955ec3b83d214d22b21a2808",this.getOrganismFromEutils=is,this.getTaxids=cs,this.getAssemblyAndChromosomesFromEutils=us,this.drawBandLabels=ys,this.getBandColorGradients=ws,this.processBandData=ks,this.setBandsToShow=ps,this.hideUnshownBandLabels=hs,this.drawBandLabelText=gs,this.drawBandLabelStalk=vs,this.onBrushMove=Cs,this.onBrushEnd=Ts,this.createBrush=Ls,this.createClickCursor=Ms,this.onCursorMove=Ss,this.drawSexChromosomes=Ps,this.setSexChromosomes=Ns,this.convertBpToPx=Es,this.convertPxToBp=Bs,this.unpackAnnots=wc,this.packAnnots=xc,this.initCrossFilter=_c,this.filterAnnots=Ac,this.assemblyIsAccession=ti,this.getDataDir=ri,this.round=oi,this.onDidRotate=ii,this.getSvg=ai,this.fetch=si,this.getTaxid=ci,this.getCommonName=li,this.getScientificName=ui,this.getChromosomeModel=Cc,this.getChromosomePixels=kc,this.drawChromosomeLabels=Gc,this.rotateChromosomeLabels=Wc,this.appendHomolog=Rc,this.drawChromosome=jc,this.rotateAndToggleDisplay=zc,this.setOverflowScroll=Hc,this.plotRelatedGenes=pl,this.getRelatedGenesByType=Xc,this.configure(n)}return f(t,null,[{key:"version",get:function(){return"1.33.0"}},{key:"d3",get:function(){return Zo}},{key:"fetchEnsembl",value:(n=e(d().mark((function t(n){var e,r,o,i,a,s=arguments;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=s.length>1&&void 0!==s[1]?s[1]:null,r=s.length>2&&void 0!==s[2]?s[2]:"GET",o={method:r},null!==e&&(o.body=JSON.stringify(e)),"GET"===r?(i=n.includes("&")?"&":"?",n+=i+"content-type=application/json"):o.headers={"Content-Type":"application/json"},t.next=6,fetch("https://rest.ensembl.org".concat(n),o);case 6:return a=t.sent,t.next=9,a.json();case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}}),t)}))),function(t){return n.apply(this,arguments)})},{key:"getChrSortNamesAndTypes",value:function(t,n){var e,r,o,i,a,s,c,l,u,h;return"string"==typeof t||"chr"in t&&"annots"in t?(a="MT"===(e="string"==typeof t?t:t.chr),s="MT"===(r="string"==typeof n?n:n.chr),c="AP"===e,l="AP"===r,u=!(o="CP"===e)&&!a&&!c,h=!(i="CP"===r)&&!s&&!l):(e=t.name,r=n.name,o="chloroplast"===t.type,i="chloroplast"===n.type,a="mitochondrion"===t.type,s="mitochondrion"===n.type,c="apicoplast"===t.type,l="apicoplast"===n.type,u="nuclear"===t.type,h="nuclear"===n.type),[e,r,{aIsNuclear:u,bIsNuclear:h,aIsCP:o,bIsCP:i,aIsMT:a,bIsMT:s,aIsAP:c,bIsAP:l}]}},{key:"sortChromosomes",value:function(n,e){var r=o(t.getChrSortNamesAndTypes(n,e),3),i=r[0],a=r[1],s=r[2],c=s.aIsNuclear,l=s.bIsNuclear,u=s.aIsCP,h=s.bIsCP,f=s.aIsMT,d=s.bIsMT,m=s.aIsAP,p=s.bIsAP;return c&&l?(fi(i)&&fi(a)&&(i=di(i).toString(),a=di(a).toString()),i.localeCompare(a,"en",{numeric:!0})):!c&&l||f&&h?1:u&&d?-1:m||f||u||!(d||h||p)?void 0:-1}},{key:"initRelatedGenes",value:function(t){return function(t,n){"all"!==n&&(n=n.map((function(t){return t.toLowerCase()})));var e={showFullyBanded:!1,rotatable:!1,legend:wl,chrBorderColor:"#333",chrLabelColor:"#333",onWillShowAnnotTooltip:vl,annotsInList:n,showTools:!0,showAnnotLabels:!0};if("onWillShowAnnotTooltip"in t){var r="onWillShowAnnotTooltip",o=t[r],i=e[r];e[r]=function(t){return t=i.bind(this)(t),o.bind(this)(t)},delete t[r]}var a=Object.assign(e,t);a=_l(a);var s=new Ideogram(a);return t.onPlotRelatedGenes&&(s.onPlotRelatedGenesCallback=t.onPlotRelatedGenes),t.onFindRelatedGenes&&(s.onFindRelatedGenesCallback=t.onFindRelatedGenes),s.getTooltipAnalytics=Uc,s.annotSortFunction=ul,Yc(s),$c(s.config.organism,s),s}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all")}},{key:"initGeneHints",value:function(t){return function(t,n){delete t.onPlotRelatedGenes,"all"!==n&&(n=n.map((function(t){return t.toLowerCase()})));var e=ni("cache/homo-sapiens-top-genes.tsv"),r={showFullyBanded:!1,rotatable:!1,legend:xl,chrMargin:-4,chrBorderColor:"#333",chrLabelColor:"#333",onWillShowAnnotTooltip:vl,annotsInList:n,showTools:!0,showAnnotLabels:!0,onDrawAnnots:Al,annotationsPath:e};if("onWillShowAnnotTooltip"in t){var o="onWillShowAnnotTooltip",i=t[o],a=r[o];r[o]=function(t){return t=a.bind(this)(t),i.bind(this)(t)},delete t[o]}if("onDrawAnnots"in t){var s="onDrawAnnots",c=t[s],l=r[s];r[s]=function(){l.bind(this)(),c.bind(this)()},delete t[s]}var u=Object.assign(r,t);u.showAnnotLabels?u.legendPad=80:u.legendPad=30;var h=new Ideogram(u);return t.onPlotRelatedGenes&&(h.onPlotRelatedGenesCallback=t.onPlotRelatedGenes),t.onFindRelatedGenes&&(h.onFindRelatedGenesCallback=t.onFindRelatedGenes),h.getTooltipAnalytics=Uc,h.annotSortFunction=ul,Yc(h),$c(h.config.organism,h),h}(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"all")}}]),t;var n}();window.Ideogram=kl;var Cl=kl;return n}()},8850:function(t,n,e){"use strict";e.r(n),e.d(n,{default:function(){return g}});var r=e(9196),o=e.n(r),i=e(1830),a=e.n(i),s=e(7584),c=e(4128);function l(){return l=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},l.apply(this,arguments)}function u(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(void 0,"symbol"==typeof(o=function(t,n){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(r.key))?o:String(o)),r)}var o}function h(t,n){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},h(t,n)}function f(t,n){if(n&&("object"==typeof n||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return d(t)}function d(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function m(t){return m=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},m(t)}var p=["accessToken","ancestors","annotations","annotationHeight","annotationsColor","annotationsLayout","annotationsPath","annotationTracks","assembly","barWidth","brush","chrHeight","chrMargin","chrWidth","chromosomes","container","dataDir","demarcateCollinearChromosomes","geometry","histogramScaling","heatmaps","filterable","fullChromosomeLabels","legend","loading_state","onBrushMove","onDidRotate","onDrawAnnots","onLoadAnnots","onLoad","onWillShowAnnotTooltip","organism","orientation","perspective","ploidy","ploidyDesc","rangeSet","resolution","rotatable","rows","sex","showBandLabels","showChromosomeLabels","showAnnotTooltip","showFullyBanded","showNonNuclearChromosomes"],g=function(t){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&h(t,n)}(g,t);var n,e,r,i,c=(r=g,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=m(r);if(i){var e=m(this).constructor;t=Reflect.construct(n,arguments,e)}else t=n.apply(this,arguments);return f(this,t)});function g(){var t;return function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,g),(t=c.call(this)).ideogram=null,t.isRotated=!1,t.tooltipData=null,t.tooltipDataTwo=null,t.onBrushHandler=t.onBrushHandler.bind(d(t)),t.onLoadHandler=t.onLoadHandler.bind(d(t)),t.onRotateHandler=t.onRotateHandler.bind(d(t)),t.onHomologyHandler=t.onHomologyHandler.bind(d(t)),t.onToolTipHandler=t.onToolTipHandler.bind(d(t)),t.onMouseOverHandler=t.onMouseOverHandler.bind(d(t)),t.setConfig=t.setConfig.bind(d(t)),t.initIdeogram=t.initIdeogram.bind(d(t)),t}return n=g,(e=[{key:"onHomologyHandler",value:function(){var t=this.ideogram.chromosomes,n=null,e=null,r=this.props.organism,o=this.props.chromosomes,i=this.props.homology;"string"!=typeof this.props.organism?(n=t[i.chrOne.organism][o[r[0]]],e=t[i.chrTwo.organism][o[r[1]]]):(n=t[i.chrOne.organism][o[0]],e=t[i.chrTwo.organism][o[1]]);var a=[{r1:{chr:n,start:i.chrOne.start[0],stop:i.chrOne.stop[0]},r2:{chr:e,start:i.chrTwo.start[0],stop:i.chrTwo.stop[0]}},{r1:{chr:n,start:i.chrOne.start[1],stop:i.chrOne.stop[1]},r2:{chr:e,start:i.chrTwo.start[1],stop:i.chrTwo.stop[1]}}];this.ideogram.drawSynteny(a)}},{key:"onToolTipHandler",value:function(){this.tooltipDataTwo=this.tooltipData,this.props.setProps({annotationsData:this.tooltipData})}},{key:"onBrushHandler",value:function(){var t=this.ideogram.selectedRegion,n=t.from.toLocaleString(),e=t.to.toLocaleString(),r=t.extent.toLocaleString();void 0!==this.props.brush&&this.props.setProps({brushData:{start:n,end:e,extent:r}})}},{key:"onLoadHandler",value:function(){return void 0!==this.props.brush?this.onBrushHandler():void 0!==this.props.homology&&this.onHomologyHandler(),null}},{key:"onRotateHandler",value:function(){this.isRotated=!this.isRotated,this.props.setProps({rotated:this.isRotated})}},{key:"onMouseOverHandler",value:function(){this.tooltipData=document.getElementById("_ideogramTooltip").innerHTML,this.tooltipDataTwo=this.tooltipData!==this.tooltipDataTwo?this.onToolTipHandler():document.getElementById("_ideogramTooltip").innerHTML}},{key:"setConfig",value:function(){var t=(0,s.Z)(["setProps"],this.props);return t.onDidRotate=this.onRotateHandler,t.onBrushMove=this.props.brush?this.onBrushHandler:null,t.onLoad=this.onLoadHandler,t.container="#ideogram-container-"+this.props.id,t}},{key:"initIdeogram",value:function(){this.ideogram=new(a())(this.setConfig())}},{key:"shouldComponentUpdate",value:function(t){var n=this;return p.some((function(e){return n.props[e]!==t[e]}))}},{key:"componentDidMount",value:function(){this.initIdeogram()}},{key:"componentDidUpdate",value:function(){this.initIdeogram()}},{key:"render",value:function(){return o().createElement("div",{id:this.props.id,className:this.props.className,style:this.props.style,"data-dash-is-loading":this.props.loading_state&&this.props.loading_state.is_loading||void 0},o().createElement("div",l({},(0,s.Z)(["setProps","loading_state"],this.props),{id:"ideogram-container-"+this.props.id,onMouseOver:this.onMouseOverHandler})))}}])&&u(n.prototype,e),Object.defineProperty(n,"prototype",{writable:!1}),g}(r.Component);g.defaultProps=c.lG,g.propTypes=c.iG}}]);
//# sourceMappingURL=async-ideogram.js.map