blob: 6a184ee6e8a83778d6a5bf41fe3e1690c253cbed [file] [log] [blame]
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("platform"),require("dagreD3")):"function"==typeof define&&define.amd?define(["platform","dagreD3"],e):"object"==typeof exports?exports.LineageHelper=e(require("platform"),require("dagreD3")):t.LineageHelper=e(t.platform,t.dagreD3)}(window,(function(t,e){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=10)}([,function(e,n){e.exports=t},function(t,n){t.exports=e},,,,,,,function(t,e,n){},function(t,e,n){"use strict";n.r(e),n.d(e,"default",(function(){return Cr}));var r=n(2),i=n.n(r);function o(){}var a=function(t){return null==t?o:function(){return this.querySelector(t)}};function s(){return[]}var u=function(t){return null==t?s:function(){return this.querySelectorAll(t)}},l=function(t){return function(){return this.matches(t)}},c=function(t){return new Array(t.length)};function h(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}h.prototype={constructor:h,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function f(t,e,n,r,i,o){for(var a,s=0,u=e.length,l=o.length;s<l;++s)(a=e[s])?(a.__data__=o[s],r[s]=a):n[s]=new h(t,o[s]);for(;s<u;++s)(a=e[s])&&(i[s]=a)}function p(t,e,n,r,i,o,a){var s,u,l,c={},f=e.length,p=o.length,d=new Array(f);for(s=0;s<f;++s)(u=e[s])&&(d[s]=l="$"+a.call(u,u.__data__,s,e),l in c?i[s]=u:c[l]=u);for(s=0;s<p;++s)(u=c[l="$"+a.call(t,o[s],s,o)])?(r[s]=u,u.__data__=o[s],c[l]=null):n[s]=new h(t,o[s]);for(s=0;s<f;++s)(u=e[s])&&c[d[s]]===u&&(i[s]=u)}function d(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}var g="http://www.w3.org/1999/xhtml",v={svg:"http://www.w3.org/2000/svg",xhtml:g,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},y=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),v.hasOwnProperty(e)?{space:v[e],local:t}:t};function m(t){return function(){this.removeAttribute(t)}}function w(t){return function(){this.removeAttributeNS(t.space,t.local)}}function b(t,e){return function(){this.setAttribute(t,e)}}function x(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function k(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function E(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var T=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function N(t){return function(){this.style.removeProperty(t)}}function O(t,e,n){return function(){this.style.setProperty(t,e,n)}}function S(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function P(t,e){return t.style.getPropertyValue(e)||T(t).getComputedStyle(t,null).getPropertyValue(e)}function A(t){return function(){delete this[t]}}function M(t,e){return function(){this[t]=e}}function z(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function j(t){return t.trim().split(/^|\s+/)}function D(t){return t.classList||new C(t)}function C(t){this._node=t,this._names=j(t.getAttribute("class")||"")}function B(t,e){for(var n=D(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function I(t,e){for(var n=D(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function L(t){return function(){B(this,t)}}function R(t){return function(){I(this,t)}}function G(t,e){return function(){(e.apply(this,arguments)?B:I)(this,t)}}C.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function q(){this.textContent=""}function F(t){return function(){this.textContent=t}}function U(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function H(){this.innerHTML=""}function V(t){return function(){this.innerHTML=t}}function X(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function Y(){this.nextSibling&&this.parentNode.appendChild(this)}function Z(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function W(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===g&&e.documentElement.namespaceURI===g?e.createElement(t):e.createElementNS(n,t)}}function K(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var Q=function(t){var e=y(t);return(e.local?K:W)(e)};function J(){return null}function tt(){var t=this.parentNode;t&&t.removeChild(this)}function et(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function nt(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}var rt={},it=null;"undefined"!=typeof document&&("onmouseenter"in document.documentElement||(rt={mouseenter:"mouseover",mouseleave:"mouseout"}));function ot(t,e,n){return t=at(t,e,n),function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t.call(this,e)}}function at(t,e,n){return function(r){var i=it;it=r;try{t.call(this,this.__data__,e,n)}finally{it=i}}}function st(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function ut(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r<o;++r)n=e[r],t.type&&n.type!==t.type||n.name!==t.name?e[++i]=n:this.removeEventListener(n.type,n.listener,n.capture);++i?e.length=i:delete this.__on}}}function lt(t,e,n){var r=rt.hasOwnProperty(t.type)?ot:at;return function(i,o,a){var s,u=this.__on,l=r(e,o,a);if(u)for(var c=0,h=u.length;c<h;++c)if((s=u[c]).type===t.type&&s.name===t.name)return this.removeEventListener(s.type,s.listener,s.capture),this.addEventListener(s.type,s.listener=l,s.capture=n),void(s.value=e);this.addEventListener(t.type,l,n),s={type:t.type,name:t.name,value:e,listener:l,capture:n},u?u.push(s):this.__on=[s]}}function ct(t,e,n,r){var i=it;t.sourceEvent=it,it=t;try{return e.apply(n,r)}finally{it=i}}function ht(t,e,n){var r=T(t),i=r.CustomEvent;"function"==typeof i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function ft(t,e){return function(){return ht(this,t,e)}}function pt(t,e){return function(){return ht(this,t,e.apply(this,arguments))}}var dt=[null];function gt(t,e){this._groups=t,this._parents=e}function vt(){return new gt([[document.documentElement]],dt)}gt.prototype=vt.prototype={constructor:gt,select:function(t){"function"!=typeof t&&(t=a(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,s,u=e[i],l=u.length,c=r[i]=new Array(l),h=0;h<l;++h)(o=u[h])&&(s=t.call(o,o.__data__,h,u))&&("__data__"in o&&(s.__data__=o.__data__),c[h]=s);return new gt(r,this._parents)},selectAll:function(t){"function"!=typeof t&&(t=u(t));for(var e=this._groups,n=e.length,r=[],i=[],o=0;o<n;++o)for(var a,s=e[o],l=s.length,c=0;c<l;++c)(a=s[c])&&(r.push(t.call(a,a.__data__,c,s)),i.push(a));return new gt(r,i)},filter:function(t){"function"!=typeof t&&(t=l(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,a=e[i],s=a.length,u=r[i]=[],c=0;c<s;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&u.push(o);return new gt(r,this._parents)},data:function(t,e){if(!t)return v=new Array(this.size()),c=-1,this.each((function(t){v[++c]=t})),v;var n,r=e?p:f,i=this._parents,o=this._groups;"function"!=typeof t&&(n=t,t=function(){return n});for(var a=o.length,s=new Array(a),u=new Array(a),l=new Array(a),c=0;c<a;++c){var h=i[c],d=o[c],g=d.length,v=t.call(h,h&&h.__data__,c,i),y=v.length,m=u[c]=new Array(y),_=s[c]=new Array(y);r(h,d,m,_,l[c]=new Array(g),v,e);for(var w,b,x=0,k=0;x<y;++x)if(w=m[x]){for(x>=k&&(k=x+1);!(b=_[k])&&++k<y;);w._next=b||null}}return(s=new gt(s,i))._enter=u,s._exit=l,s},enter:function(){return new gt(this._enter||this._groups.map(c),this._parents)},exit:function(){return new gt(this._exit||this._groups.map(c),this._parents)},join:function(t,e,n){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=e&&(i=e(i)),null==n?o.remove():n(o),r&&i?r.merge(i).order():i},merge:function(t){for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var u,l=e[s],c=n[s],h=l.length,f=a[s]=new Array(h),p=0;p<h;++p)(u=l[p]||c[p])&&(f[p]=u);for(;s<r;++s)a[s]=e[s];return new gt(a,this._parents)},order:function(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r,i=t[e],o=i.length-1,a=i[o];--o>=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=d);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var a,s=n[o],u=s.length,l=i[o]=new Array(u),c=0;c<u;++c)(a=s[c])&&(l[c]=a);l.sort(e)}return new gt(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),e=-1;return this.each((function(){t[++e]=this})),t},node:function(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,o=r.length;i<o;++i){var a=r[i];if(a)return a}return null},size:function(){var t=0;return this.each((function(){++t})),t},empty:function(){return!this.node()},each:function(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i,o=e[n],a=0,s=o.length;a<s;++a)(i=o[a])&&t.call(i,i.__data__,a,o);return this},attr:function(t,e){var n=y(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==e?n.local?w:m:"function"==typeof e?n.local?E:k:n.local?x:b)(n,e))},style:function(t,e,n){return arguments.length>1?this.each((null==e?N:"function"==typeof e?S:O)(t,e,null==n?"":n)):P(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?A:"function"==typeof e?z:M)(t,e)):this.node()[t]},classed:function(t,e){var n=j(t+"");if(arguments.length<2){for(var r=D(this.node()),i=-1,o=n.length;++i<o;)if(!r.contains(n[i]))return!1;return!0}return this.each(("function"==typeof e?G:e?L:R)(n,e))},text:function(t){return arguments.length?this.each(null==t?q:("function"==typeof t?U:F)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?H:("function"==typeof t?X:V)(t)):this.node().innerHTML},raise:function(){return this.each(Y)},lower:function(){return this.each(Z)},append:function(t){var e="function"==typeof t?t:Q(t);return this.select((function(){return this.appendChild(e.apply(this,arguments))}))},insert:function(t,e){var n="function"==typeof t?t:Q(t),r=null==e?J:"function"==typeof e?e:a(e);return this.select((function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)}))},remove:function(){return this.each(tt)},clone:function(t){return this.select(t?nt:et)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,e,n){var r,i,o=st(t+""),a=o.length;if(!(arguments.length<2)){for(s=e?lt:ut,null==n&&(n=!1),r=0;r<a;++r)this.each(s(o[r],e,n));return this}var s=this.node().__on;if(s)for(var u,l=0,c=s.length;l<c;++l)for(r=0,u=s[l];r<a;++r)if((i=o[r]).type===u.type&&i.name===u.name)return u.value},dispatch:function(t,e){return this.each(("function"==typeof e?pt:ft)(t,e))}};var yt=vt,mt=function(t){return"string"==typeof t?new gt([[document.querySelector(t)]],[document.documentElement]):new gt([[t]],dt)};function _t(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function wt(t){this._context=t}wt.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:_t(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:_t(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var bt=function(t){return new wt(t)},xt={value:function(){}};function kt(){for(var t,e=0,n=arguments.length,r={};e<n;++e){if(!(t=arguments[e]+"")||t in r||/[\s.]/.test(t))throw new Error("illegal type: "+t);r[t]=[]}return new Et(r)}function Et(t){this._=t}function Tt(t,e){return t.trim().split(/^|\s+/).map((function(t){var n="",r=t.indexOf(".");if(r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function Nt(t,e){for(var n,r=0,i=t.length;r<i;++r)if((n=t[r]).name===e)return n.value}function Ot(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=xt,t=t.slice(0,r).concat(t.slice(r+1));break}return null!=n&&t.push({name:e,value:n}),t}Et.prototype=kt.prototype={constructor:Et,on:function(t,e){var n,r=this._,i=Tt(t+"",r),o=-1,a=i.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o<a;)if(n=(t=i[o]).type)r[n]=Ot(r[n],t.name,e);else if(null==e)for(n in r)r[n]=Ot(r[n],t.name,null);return this}for(;++o<a;)if((n=(t=i[o]).type)&&(n=Nt(r[n],t.name)))return n},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new Et(t)},call:function(t,e){if((n=arguments.length-2)>0)for(var n,r,i=new Array(n),o=0;o<n;++o)i[o]=arguments[o+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(o=0,n=(r=this._[t]).length;o<n;++o)r[o].value.apply(e,i)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,o=r.length;i<o;++i)r[i].value.apply(e,n)}};var St=kt;function Pt(){it.stopImmediatePropagation()}var At=function(){it.preventDefault(),it.stopImmediatePropagation()},Mt=function(t){var e=t.document.documentElement,n=mt(t).on("dragstart.drag",At,!0);"onselectstart"in e?n.on("selectstart.drag",At,!0):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")};function zt(t,e){var n=t.document.documentElement,r=mt(t).on("dragstart.drag",null);e&&(r.on("click.drag",At,!0),setTimeout((function(){r.on("click.drag",null)}),0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var jt=Math.SQRT2;function Dt(t){return((t=Math.exp(t))+1/t)/2}var Ct,Bt,It=function(t,e){var n,r,i=t[0],o=t[1],a=t[2],s=e[0],u=e[1],l=e[2],c=s-i,h=u-o,f=c*c+h*h;if(f<1e-12)r=Math.log(l/a)/jt,n=function(t){return[i+t*c,o+t*h,a*Math.exp(jt*t*r)]};else{var p=Math.sqrt(f),d=(l*l-a*a+4*f)/(2*a*2*p),g=(l*l-a*a-4*f)/(2*l*2*p),v=Math.log(Math.sqrt(d*d+1)-d),y=Math.log(Math.sqrt(g*g+1)-g);r=(y-v)/jt,n=function(t){var e,n=t*r,s=Dt(v),u=a/(2*p)*(s*(e=jt*n+v,((e=Math.exp(2*e))-1)/(e+1))-function(t){return((t=Math.exp(t))-1/t)/2}(v));return[i+u*c,o+u*h,a*s/Dt(jt*n+v)]}}return n.duration=1e3*r,n},Lt=function(){for(var t,e=it;t=e.sourceEvent;)e=t;return e},Rt=function(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]},Gt=function(t){var e=Lt();return e.changedTouches&&(e=e.changedTouches[0]),Rt(t,e)},qt=function(t,e,n){arguments.length<3&&(n=e,e=Lt().changedTouches);for(var r,i=0,o=e?e.length:0;i<o;++i)if((r=e[i]).identifier===n)return Rt(t,r);return null},Ft=0,Ut=0,Ht=0,$t=0,Vt=0,Xt=0,Yt="object"==typeof performance&&performance.now?performance:Date,Zt="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Wt(){return Vt||(Zt(Kt),Vt=Yt.now()+Xt)}function Kt(){Vt=0}function Qt(){this._call=this._time=this._next=null}function Jt(t,e,n){var r=new Qt;return r.restart(t,e,n),r}function te(){Vt=($t=Yt.now())+Xt,Ft=Ut=0;try{!function(){Wt(),++Ft;for(var t,e=Ct;e;)(t=Vt-e._time)>=0&&e._call.call(null,t),e=e._next;--Ft}()}finally{Ft=0,function(){var t,e,n=Ct,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Ct=e);Bt=t,ne(r)}(),Vt=0}}function ee(){var t=Yt.now(),e=t-$t;e>1e3&&(Xt-=e,$t=t)}function ne(t){Ft||(Ut&&(Ut=clearTimeout(Ut)),t-Vt>24?(t<1/0&&(Ut=setTimeout(te,t-Yt.now()-Xt)),Ht&&(Ht=clearInterval(Ht))):(Ht||($t=Yt.now(),Ht=setInterval(ee,1e3)),Ft=1,Zt(te)))}Qt.prototype=Jt.prototype={constructor:Qt,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Wt():+n)+(null==e?0:+e),this._next||Bt===this||(Bt?Bt._next=this:Ct=this,Bt=this),this._call=t,this._time=n,ne()},stop:function(){this._call&&(this._call=null,this._time=1/0,ne())}};var re=function(t,e,n){var r=new Qt;return e=null==e?0:+e,r.restart((function(n){r.stop(),t(n+e)}),e,n),r},ie=St("start","end","cancel","interrupt"),oe=[],ae=function(t,e,n,r,i,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(u){var l,c,h,f;if(1!==n.state)return s();for(l in i)if((f=i[l]).name===n.name){if(3===f.state)return re(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[l]):+l<e&&(f.state=6,f.timer.stop(),f.on.call("cancel",t,t.__data__,f.index,f.group),delete i[l])}if(re((function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(u))})),n.state=2,n.on.call("start",t,t.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(h=n.tween.length),l=0,c=-1;l<h;++l)(f=n.tween[l].value.call(t,t.__data__,n.index,n.group))&&(r[++c]=f);r.length=c+1}}function a(e){for(var i=e<n.duration?n.ease.call(null,e/n.duration):(n.timer.restart(s),n.state=5,1),o=-1,a=r.length;++o<a;)r[o].call(t,i);5===n.state&&(n.on.call("end",t,t.__data__,n.index,n.group),s())}function s(){for(var r in n.state=6,n.timer.stop(),delete i[e],i)return;delete t.__transition}i[e]=n,n.timer=Jt((function(t){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=t&&o(t-n.delay)}),0,n.time)}(t,n,{name:e,index:r,group:i,on:ie,tween:oe,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})};function se(t,e){var n=le(t,e);if(n.state>0)throw new Error("too late; already scheduled");return n}function ue(t,e){var n=le(t,e);if(n.state>3)throw new Error("too late; already running");return n}function le(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var ce,he,fe,pe,de=function(t,e){var n,r,i,o=t.__transition,a=!0;if(o){for(i in e=null==e?null:e+"",o)(n=o[i]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]):a=!1;a&&delete t.__transition}},ge=function(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}},ve=180/Math.PI,ye={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},me=function(t,e,n,r,i,o){var a,s,u;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(u=t*n+e*r)&&(n-=t*u,r-=e*u),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,u/=s),t*r<e*n&&(t=-t,e=-e,u=-u,a=-a),{translateX:i,translateY:o,rotate:Math.atan2(e,t)*ve,skewX:Math.atan(u)*ve,scaleX:a,scaleY:s}};function _e(t,e,n,r){function i(t){return t.length?t.pop()+" ":""}return function(o,a){var s=[],u=[];return o=t(o),a=t(a),function(t,r,i,o,a,s){if(t!==i||r!==o){var u=a.push("translate(",null,e,null,n);s.push({i:u-4,x:ge(t,i)},{i:u-2,x:ge(r,o)})}else(i||o)&&a.push("translate("+i+e+o+n)}(o.translateX,o.translateY,a.translateX,a.translateY,s,u),function(t,e,n,o){t!==e?(t-e>180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:ge(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,s,u),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:ge(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,s,u),function(t,e,n,r,o,a){if(t!==n||e!==r){var s=o.push(i(o)+"scale(",null,",",null,")");a.push({i:s-4,x:ge(t,n)},{i:s-2,x:ge(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,s,u),o=a=null,function(t){for(var e,n=-1,r=u.length;++n<r;)s[(e=u[n]).i]=e.x(t);return s.join("")}}}var we=_e((function(t){return"none"===t?ye:(ce||(ce=document.createElement("DIV"),he=document.documentElement,fe=document.defaultView),ce.style.transform=t,t=fe.getComputedStyle(he.appendChild(ce),null).getPropertyValue("transform"),he.removeChild(ce),t=t.slice(7,-1).split(","),me(+t[0],+t[1],+t[2],+t[3],+t[4],+t[5]))}),"px, ","px)","deg)"),be=_e((function(t){return null==t?ye:(pe||(pe=document.createElementNS("http://www.w3.org/2000/svg","g")),pe.setAttribute("transform",t),(t=pe.transform.baseVal.consolidate())?(t=t.matrix,me(t.a,t.b,t.c,t.d,t.e,t.f)):ye)}),", ",")",")");function xe(t,e){var n,r;return function(){var i=ue(this,t),o=i.tween;if(o!==n)for(var a=0,s=(r=n=o).length;a<s;++a)if(r[a].name===e){(r=r.slice()).splice(a,1);break}i.tween=r}}function ke(t,e,n){var r,i;if("function"!=typeof n)throw new Error;return function(){var o=ue(this,t),a=o.tween;if(a!==r){i=(r=a).slice();for(var s={name:e,value:n},u=0,l=i.length;u<l;++u)if(i[u].name===e){i[u]=s;break}u===l&&i.push(s)}o.tween=i}}function Ee(t,e,n){var r=t._id;return t.each((function(){var t=ue(this,r);(t.value||(t.value={}))[e]=n.apply(this,arguments)})),function(t){return le(t,r).value[e]}}var Te=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function Ne(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Oe(){}var Se="\\s*([+-]?\\d+)\\s*",Pe="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ae="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Me=/^#([0-9a-f]{3,8})$/,ze=new RegExp("^rgb\\("+[Se,Se,Se]+"\\)$"),je=new RegExp("^rgb\\("+[Ae,Ae,Ae]+"\\)$"),De=new RegExp("^rgba\\("+[Se,Se,Se,Pe]+"\\)$"),Ce=new RegExp("^rgba\\("+[Ae,Ae,Ae,Pe]+"\\)$"),Be=new RegExp("^hsl\\("+[Pe,Ae,Ae]+"\\)$"),Ie=new RegExp("^hsla\\("+[Pe,Ae,Ae,Pe]+"\\)$"),Le={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 Re(){return this.rgb().formatHex()}function Ge(){return this.rgb().formatRgb()}function qe(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Me.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Fe(e):3===n?new Ve(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Ue(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Ue(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ze.exec(t))?new Ve(e[1],e[2],e[3],1):(e=je.exec(t))?new Ve(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=De.exec(t))?Ue(e[1],e[2],e[3],e[4]):(e=Ce.exec(t))?Ue(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Be.exec(t))?We(e[1],e[2]/100,e[3]/100,1):(e=Ie.exec(t))?We(e[1],e[2]/100,e[3]/100,e[4]):Le.hasOwnProperty(t)?Fe(Le[t]):"transparent"===t?new Ve(NaN,NaN,NaN,0):null}function Fe(t){return new Ve(t>>16&255,t>>8&255,255&t,1)}function Ue(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ve(t,e,n,r)}function He(t){return t instanceof Oe||(t=qe(t)),t?new Ve((t=t.rgb()).r,t.g,t.b,t.opacity):new Ve}function $e(t,e,n,r){return 1===arguments.length?He(t):new Ve(t,e,n,null==r?1:r)}function Ve(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Xe(){return"#"+Ze(this.r)+Ze(this.g)+Ze(this.b)}function Ye(){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 Ze(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function We(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Qe(t,e,n,r)}function Ke(t){if(t instanceof Qe)return new Qe(t.h,t.s,t.l,t.opacity);if(t instanceof Oe||(t=qe(t)),!t)return new Qe;if(t instanceof Qe)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n<r):n===o?(r-e)/s+2:(e-n)/s+4,s/=u<.5?o+i:2-o-i,a*=60):s=u>0&&u<1?0:a,new Qe(a,s,u,t.opacity)}function Qe(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Je(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function tn(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}Te(Oe,qe,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Re,formatHex:Re,formatHsl:function(){return Ke(this).formatHsl()},formatRgb:Ge,toString:Ge}),Te(Ve,$e,Ne(Oe,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ve(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ve(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:Xe,formatHex:Xe,formatRgb:Ye,toString:Ye})),Te(Qe,(function(t,e,n,r){return 1===arguments.length?Ke(t):new Qe(t,e,n,null==r?1:r)}),Ne(Oe,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Qe(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Qe(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Ve(Je(t>=240?t-240:t+120,i,r),Je(t,i,r),Je(t<120?t+240:t-120,i,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 en=function(t){return function(){return t}};function nn(t,e){return function(n){return t+n*e}}function rn(t){return 1==(t=+t)?on:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):en(isNaN(e)?n:e)}}function on(t,e){var n=e-t;return n?nn(t,n):en(isNaN(t)?e:t)}var an=function t(e){var n=rn(e);function r(t,e){var r=n((t=$e(t)).r,(e=$e(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=on(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function sn(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n<i;++n)r=$e(e[n]),o[n]=r.r||0,a[n]=r.g||0,s[n]=r.b||0;return o=t(o),a=t(a),s=t(s),r.opacity=1,function(t){return r.r=o(t),r.g=a(t),r.b=s(t),r+""}}}sn((function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=r<e-1?t[r+2]:2*o-i;return tn((n-r/e)*e,a,i,o,s)}})),sn((function(t){var e=t.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*e),i=t[(r+e-1)%e],o=t[r%e],a=t[(r+1)%e],s=t[(r+2)%e];return tn((n-r/e)*e,i,o,a,s)}}));var un=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ln=new RegExp(un.source,"g");var cn=function(t,e){var n,r,i,o=un.lastIndex=ln.lastIndex=0,a=-1,s=[],u=[];for(t+="",e+="";(n=un.exec(t))&&(r=ln.exec(e));)(i=r.index)>o&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:ge(n,r)})),o=ln.lastIndex;return o<e.length&&(i=e.slice(o),s[a]?s[a]+=i:s[++a]=i),s.length<2?u[0]?function(t){return function(e){return t(e)+""}}(u[0].x):function(t){return function(){return t}}(e):(e=u.length,function(t){for(var n,r=0;r<e;++r)s[(n=u[r]).i]=n.x(t);return s.join("")})},hn=function(t,e){var n;return("number"==typeof e?ge:e instanceof qe?an:(n=qe(e))?(e=n,an):cn)(t,e)};function fn(t){return function(){this.removeAttribute(t)}}function pn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function dn(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttribute(t);return a===o?null:a===r?i:i=e(r=a,n)}}function gn(t,e,n){var r,i,o=n+"";return function(){var a=this.getAttributeNS(t.space,t.local);return a===o?null:a===r?i:i=e(r=a,n)}}function vn(t,e,n){var r,i,o;return function(){var a,s,u=n(this);if(null!=u)return(a=this.getAttribute(t))===(s=u+"")?null:a===r&&s===i?o:(i=s,o=e(r=a,u));this.removeAttribute(t)}}function yn(t,e,n){var r,i,o;return function(){var a,s,u=n(this);if(null!=u)return(a=this.getAttributeNS(t.space,t.local))===(s=u+"")?null:a===r&&s===i?o:(i=s,o=e(r=a,u));this.removeAttributeNS(t.space,t.local)}}function mn(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function _n(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function wn(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&_n(t,i)),n}return i._value=e,i}function bn(t,e){var n,r;function i(){var i=e.apply(this,arguments);return i!==r&&(n=(r=i)&&mn(t,i)),n}return i._value=e,i}function xn(t,e){return function(){se(this,t).delay=+e.apply(this,arguments)}}function kn(t,e){return e=+e,function(){se(this,t).delay=e}}function En(t,e){return function(){ue(this,t).duration=+e.apply(this,arguments)}}function Tn(t,e){return e=+e,function(){ue(this,t).duration=e}}function Nn(t,e){if("function"!=typeof e)throw new Error;return function(){ue(this,t).ease=e}}function On(t,e,n){var r,i,o=function(t){return(t+"").trim().split(/^|\s+/).every((function(t){var e=t.indexOf(".");return e>=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?se:ue;return function(){var a=o(this,t),s=a.on;s!==r&&(i=(r=s).copy()).on(e,n),a.on=i}}var Sn=yt.prototype.constructor;function Pn(t){return function(){this.style.removeProperty(t)}}function An(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Mn(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&An(t,o,n)),r}return o._value=e,o}function zn(t){return function(e){this.textContent=t.call(this,e)}}function jn(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&zn(r)),e}return r._value=t,r}var Dn=0;function Cn(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Bn(){return++Dn}var In=yt.prototype;Cn.prototype=function(t){return yt().transition(t)}.prototype={constructor:Cn,select:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=a(t));for(var r=this._groups,i=r.length,o=new Array(i),s=0;s<i;++s)for(var u,l,c=r[s],h=c.length,f=o[s]=new Array(h),p=0;p<h;++p)(u=c[p])&&(l=t.call(u,u.__data__,p,c))&&("__data__"in u&&(l.__data__=u.__data__),f[p]=l,ae(f[p],e,n,p,f,le(u,n)));return new Cn(o,this._parents,e,n)},selectAll:function(t){var e=this._name,n=this._id;"function"!=typeof t&&(t=u(t));for(var r=this._groups,i=r.length,o=[],a=[],s=0;s<i;++s)for(var l,c=r[s],h=c.length,f=0;f<h;++f)if(l=c[f]){for(var p,d=t.call(l,l.__data__,f,c),g=le(l,n),v=0,y=d.length;v<y;++v)(p=d[v])&&ae(p,e,n,v,d,g);o.push(d),a.push(l)}return new Cn(o,a,e,n)},filter:function(t){"function"!=typeof t&&(t=l(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var o,a=e[i],s=a.length,u=r[i]=[],c=0;c<s;++c)(o=a[c])&&t.call(o,o.__data__,c,a)&&u.push(o);return new Cn(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,o=Math.min(r,i),a=new Array(r),s=0;s<o;++s)for(var u,l=e[s],c=n[s],h=l.length,f=a[s]=new Array(h),p=0;p<h;++p)(u=l[p]||c[p])&&(f[p]=u);for(;s<r;++s)a[s]=e[s];return new Cn(a,this._parents,this._name,this._id)},selection:function(){return new Sn(this._groups,this._parents)},transition:function(){for(var t=this._name,e=this._id,n=Bn(),r=this._groups,i=r.length,o=0;o<i;++o)for(var a,s=r[o],u=s.length,l=0;l<u;++l)if(a=s[l]){var c=le(a,e);ae(a,t,n,l,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new Cn(r,this._parents,t,n)},call:In.call,nodes:In.nodes,node:In.node,size:In.size,empty:In.empty,each:In.each,on:function(t,e){var n=this._id;return arguments.length<2?le(this.node(),n).on.on(t):this.each(On(n,t,e))},attr:function(t,e){var n=y(t),r="transform"===n?be:hn;return this.attrTween(t,"function"==typeof e?(n.local?yn:vn)(n,r,Ee(this,"attr."+t,e)):null==e?(n.local?pn:fn)(n):(n.local?gn:dn)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=y(t);return this.tween(n,(r.local?wn:bn)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?we:hn;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var o=P(this,t),a=(this.style.removeProperty(t),P(this,t));return o===a?null:o===n&&a===r?i:i=e(n=o,r=a)}}(t,r)).on("end.style."+t,Pn(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,o;return function(){var a=P(this,t),s=n(this),u=s+"";return null==s&&(this.style.removeProperty(t),u=s=P(this,t)),a===u?null:a===r&&u===i?o:(i=u,o=e(r=a,s))}}(t,r,Ee(this,"style."+t,e))).each(function(t,e){var n,r,i,o,a="style."+e,s="end."+a;return function(){var u=ue(this,t),l=u.on,c=null==u.value[a]?o||(o=Pn(e)):void 0;l===n&&i===c||(r=(n=l).copy()).on(s,i=c),u.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,o=n+"";return function(){var a=P(this,t);return a===o?null:a===r?i:i=e(r=a,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,Mn(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Ee(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,jn(t))},remove:function(){return this.on("end.remove",(t=this._id,function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}));var t},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=le(this.node(),n).tween,o=0,a=i.length;o<a;++o)if((r=i[o]).name===t)return r.value;return null}return this.each((null==e?xe:ke)(n,t,e))},delay:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?xn:kn)(e,t)):le(this.node(),e).delay},duration:function(t){var e=this._id;return arguments.length?this.each(("function"==typeof t?En:Tn)(e,t)):le(this.node(),e).duration},ease:function(t){var e=this._id;return arguments.length?this.each(Nn(e,t)):le(this.node(),e).ease},end:function(){var t,e,n=this,r=n._id,i=n.size();return new Promise((function(o,a){var s={value:a},u={value:function(){0==--i&&o()}};n.each((function(){var n=ue(this,r),i=n.on;i!==t&&((e=(t=i).copy())._.cancel.push(s),e._.interrupt.push(s),e._.end.push(u)),n.on=e}))}))}};var Ln={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function Rn(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))return Ln.time=Wt(),Ln;return n}yt.prototype.interrupt=function(t){return this.each((function(){de(this,t)}))},yt.prototype.transition=function(t){var e,n;t instanceof Cn?(e=t._id,t=t._name):(e=Bn(),(n=Ln).time=Wt(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,o=0;o<i;++o)for(var a,s=r[o],u=s.length,l=0;l<u;++l)(a=s[l])&&ae(a,t,e,l,s,n||Rn(a,e));return new Cn(r,this._parents,t,e)};var Gn=function(t){return function(){return t}};function qn(t,e,n){this.target=t,this.type=e,this.transform=n}function Fn(t,e,n){this.k=t,this.x=e,this.y=n}Fn.prototype={constructor:Fn,scale:function(t){return 1===t?this:new Fn(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Fn(this.k,this.x+this.k*t,this.y+this.k*e)},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 Un=new Fn(1,0,0);function Hn(){it.stopImmediatePropagation()}Fn.prototype;var $n=function(){it.preventDefault(),it.stopImmediatePropagation()};function Vn(){return!it.ctrlKey&&!it.button}function Xn(){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 Yn(){return this.__zoom||Un}function Zn(){return-it.deltaY*(1===it.deltaMode?.05:it.deltaMode?1:.002)}function Wn(){return navigator.maxTouchPoints||"ontouchstart"in this}function Kn(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],o=t.invertY(e[0][1])-n[0][1],a=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}var Qn=function(t){return function(){return t}};function Jn(t,e,n,r,i,o,a,s,u,l){this.target=t,this.type=e,this.subject=n,this.identifier=r,this.active=i,this.x=o,this.y=a,this.dx=s,this.dy=u,this._=l}function tr(){return!it.ctrlKey&&!it.button}function er(){return this.parentNode}function nr(t){return null==t?{x:it.x,y:it.y}:t}function rr(){return navigator.maxTouchPoints||"ontouchstart"in this}Jn.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};var ir=function(){var t,e,n,r,i=tr,o=er,a=nr,s=rr,u={},l=St("start","drag","end"),c=0,h=0;function f(t){t.on("mousedown.drag",p).filter(s).on("touchstart.drag",v).on("touchmove.drag",y).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(){if(!r&&i.apply(this,arguments)){var a=_("mouse",o.apply(this,arguments),Gt,this,arguments);a&&(mt(it.view).on("mousemove.drag",d,!0).on("mouseup.drag",g,!0),Mt(it.view),Pt(),n=!1,t=it.clientX,e=it.clientY,a("start"))}}function d(){if(At(),!n){var r=it.clientX-t,i=it.clientY-e;n=r*r+i*i>h}u.mouse("drag")}function g(){mt(it.view).on("mousemove.drag mouseup.drag",null),zt(it.view,n),At(),u.mouse("end")}function v(){if(i.apply(this,arguments)){var t,e,n=it.changedTouches,r=o.apply(this,arguments),a=n.length;for(t=0;t<a;++t)(e=_(n[t].identifier,r,qt,this,arguments))&&(Pt(),e("start"))}}function y(){var t,e,n=it.changedTouches,r=n.length;for(t=0;t<r;++t)(e=u[n[t].identifier])&&(At(),e("drag"))}function m(){var t,e,n=it.changedTouches,i=n.length;for(r&&clearTimeout(r),r=setTimeout((function(){r=null}),500),t=0;t<i;++t)(e=u[n[t].identifier])&&(Pt(),e("end"))}function _(t,e,n,r,i){var o,s,h,p=n(e,t),d=l.copy();if(ct(new Jn(f,"beforestart",o,t,c,p[0],p[1],0,0,d),(function(){return null!=(it.subject=o=a.apply(r,i))&&(s=o.x-p[0]||0,h=o.y-p[1]||0,!0)})))return function a(l){var g,v=p;switch(l){case"start":u[t]=a,g=c++;break;case"end":delete u[t],--c;case"drag":p=n(e,t),g=c}ct(new Jn(f,l,o,t,g,p[0]+s,p[1]+h,p[0]-v[0],p[1]-v[1],d),d.apply,d,[l,r,i])}}return f.filter=function(t){return arguments.length?(i="function"==typeof t?t:Qn(!!t),f):i},f.container=function(t){return arguments.length?(o="function"==typeof t?t:Qn(t),f):o},f.subject=function(t){return arguments.length?(a="function"==typeof t?t:Qn(t),f):a},f.touchable=function(t){return arguments.length?(s="function"==typeof t?t:Qn(!!t),f):s},f.on=function(){var t=l.on.apply(l,arguments);return t===l?f:t},f.clickDistance=function(t){return arguments.length?(h=(t=+t)*t,f):Math.sqrt(h)},f},or=Math.PI,ar=2*or,sr=ar-1e-6;function ur(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function lr(){return new ur}ur.prototype=lr.prototype={constructor:ur,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,n,r){this._+="Q"+ +t+","+ +e+","+(this._x1=+n)+","+(this._y1=+r)},bezierCurveTo:function(t,e,n,r,i,o){this._+="C"+ +t+","+ +e+","+ +n+","+ +r+","+(this._x1=+i)+","+(this._y1=+o)},arcTo:function(t,e,n,r,i){t=+t,e=+e,n=+n,r=+r,i=+i;var o=this._x1,a=this._y1,s=n-t,u=r-e,l=o-t,c=a-e,h=l*l+c*c;if(i<0)throw new Error("negative radius: "+i);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(h>1e-6)if(Math.abs(c*s-u*l)>1e-6&&i){var f=n-o,p=r-a,d=s*s+u*u,g=f*f+p*p,v=Math.sqrt(d),y=Math.sqrt(h),m=i*Math.tan((or-Math.acos((d+h-g)/(2*v*y)))/2),_=m/y,w=m/v;Math.abs(_-1)>1e-6&&(this._+="L"+(t+_*l)+","+(e+_*c)),this._+="A"+i+","+i+",0,0,"+ +(c*f>l*p)+","+(this._x1=t+w*s)+","+(this._y1=e+w*u)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,o){t=+t,e=+e,o=!!o;var a=(n=+n)*Math.cos(r),s=n*Math.sin(r),u=t+a,l=e+s,c=1^o,h=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+u+","+l:(Math.abs(this._x1-u)>1e-6||Math.abs(this._y1-l)>1e-6)&&(this._+="L"+u+","+l),n&&(h<0&&(h=h%ar+ar),h>sr?this._+="A"+n+","+n+",0,1,"+c+","+(t-a)+","+(e-s)+"A"+n+","+n+",0,1,"+c+","+(this._x1=u)+","+(this._y1=l):h>1e-6&&(this._+="A"+n+","+n+",0,"+ +(h>=or)+","+c+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var cr=lr,hr=function(t){return function(){return t}};function fr(t){this._context=t}fr.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}};var pr=function(t){return new fr(t)};function dr(t){return t[0]}function gr(t){return t[1]}var vr=n(1),yr=n.n(vr),mr={entityStateReadOnly:{ACTIVE:!1,DELETED:!0,STATUS_ACTIVE:!1,STATUS_DELETED:!0}},_r={nodeArrowDistance:24,refreshGraphForSafari:function(t){t.edgeEl.each((function(t){var e=this,n=$(this).find("pattern");setTimeout((function(t){$(e).find("defs").append(n)}),500)}))},refreshGraphForIE:function(t){var e=t.edgePathEl,n=0;e.each((function(t){var e=$(this).find("marker");$(this).find("marker").remove();var r=this;++n,setTimeout((function(t){$(r).find("defs").append(e),0===--n&&(this.$(".fontLoader").hide(),this.$("svg").fadeTo(1e3,1))}),1e3)}))},dragNode:function(t){var e=this,n=t.g,r=t.svg,i=t.guid,o=(t.edgePathEl,{dragmove:function(t,e){var r=this,i=mt(t),o=n.node(e),a=o.x,s=o.y;o.x+=it.dx,o.y+=it.dy,i.attr("transform","translate("+o.x+","+o.y+")");var u=o.x-a,l=o.y-s;n.edges().forEach((function(t){if(t.v==e||t.w==e){var i=n.edge(t.v,t.w);r.translateEdge(i,u,l),mt(i.elem).select("path").attr("d",r.calcPoints(t))}}))},translateEdge:function(t,e,n){t.points.forEach((function(t){t.x=t.x+e,t.y=t.y+n}))},calcPoints:function(t){var e=n.edge(t.v,t.w),r=n.node(t.v),i=n.node(t.w),o=e.points.slice(1,e.points.length-1);e.points.slice(1,e.points.length-1);return o.unshift(this.intersectRect(r,o[0])),o.push(this.intersectRect(i,o[o.length-1])),function(){var t=dr,e=gr,n=hr(!0),r=null,i=pr,o=null;function a(a){var s,u,l,c=a.length,h=!1;for(null==r&&(o=i(l=cr())),s=0;s<=c;++s)!(s<c&&n(u=a[s],s,a))===h&&((h=!h)?o.lineStart():o.lineEnd()),h&&o.point(+t(u,s,a),+e(u,s,a));if(l)return o=null,l+""||null}return a.x=function(e){return arguments.length?(t="function"==typeof e?e:hr(+e),a):t},a.y=function(t){return arguments.length?(e="function"==typeof t?t:hr(+t),a):e},a.defined=function(t){return arguments.length?(n="function"==typeof t?t:hr(!!t),a):n},a.curve=function(t){return arguments.length?(i=t,null!=r&&(o=i(r)),a):i},a.context=function(t){return arguments.length?(null==t?r=o=null:o=i(r=t),a):r},a}().x((function(t){return t.x})).y((function(t){return t.y})).curve(bt)(o)},intersectRect:function(t,n){var r=t.x,o=t.y,a=n.x-r,s=n.y-o,u=i?e.nodeArrowDistance+3:e.nodeArrowDistance,l=u,c=u,h=0,f=0;return Math.abs(s)*l>Math.abs(a)*c?(s<0&&(c=-c),h=0===s?0:c*a/s,f=c):(a<0&&(l=-l),h=l,f=0===a?0:l*s/a),{x:r+h,y:o+f}}}),a=ir().on("drag",(function(t){o.dragmove.call(o,this,t)})),s=ir().on("drag",(function(t){o.translateEdge(n.edge(t.v,t.w),it.dx,it.dy);var e=n.edge(t.v,t.w);mt(e.elem).select("path").attr("d",o.calcPoints(t))}));a(r.selectAll("g.node")),s(r.selectAll("g.edgePath"))},zoomIn:function(t){var e=t.svg,n=t.scaleFactor,r=void 0===n?1.3:n;this.d3Zoom.scaleBy(e.transition().duration(750),r)},zoomOut:function(t){var e=t.svg,n=t.scaleFactor,r=void 0===n?.8:n;this.d3Zoom.scaleBy(e.transition().duration(750),r)},zoom:function(t){var e=t.svg,n=t.xa,r=t.ya,i=t.scale;e.transition().duration(750).call(this.d3Zoom.transform,Un.translate(n,r).scale(i))},fitToScreen:function(t){var e=t.svg,n=e.node(),r=n.getBBox(),i=n.parentElement,o=i.clientWidth,a=i.clientHeight,s=r.width,u=r.height,l=r.x+s/2,c=r.y+u/2,h=(h||.95)/Math.max(s/o,u/a),f=o/2-h*l,p=a/2-h*c;this.zoom({svg:e,xa:f,ya:p,scale:h})},centerNode:function(t){var e=t.guid,n=t.g,r=t.svg,i=t.svgGroupEl,o=(t.edgePathEl,t.width),a=t.height,s=t.fitToScreen,u=t.onCenterZoomed,l=t.isSelected;this.d3Zoom=function(){var t,e,n=Vn,r=Xn,i=Kn,o=Zn,a=Wn,s=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],l=250,c=It,h=St("start","zoom","end"),f=0;function p(t){t.property("__zoom",Yn).on("wheel.zoom",w).on("mousedown.zoom",b).on("dblclick.zoom",x).filter(a).on("touchstart.zoom",k).on("touchmove.zoom",E).on("touchend.zoom touchcancel.zoom",T).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function d(t,e){return(e=Math.max(s[0],Math.min(s[1],e)))===t.k?t:new Fn(e,t.x,t.y)}function g(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new Fn(t.k,r,i)}function v(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function y(t,e,n){t.on("start.zoom",(function(){m(this,arguments).start()})).on("interrupt.zoom end.zoom",(function(){m(this,arguments).end()})).tween("zoom",(function(){var t=this,i=arguments,o=m(t,i),a=r.apply(t,i),s=null==n?v(a):"function"==typeof n?n.apply(t,i):n,u=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),l=t.__zoom,h="function"==typeof e?e.apply(t,i):e,f=c(l.invert(s).concat(u/l.k),h.invert(s).concat(u/h.k));return function(t){if(1===t)t=h;else{var e=f(t),n=u/e[2];t=new Fn(n,s[0]-e[0]*n,s[1]-e[1]*n)}o.zoom(null,t)}}))}function m(t,e,n){return!n&&t.__zooming||new _(t,e)}function _(t,e){this.that=t,this.args=e,this.active=0,this.extent=r.apply(t,e),this.taps=0}function w(){if(n.apply(this,arguments)){var t=m(this,arguments),e=this.__zoom,r=Math.max(s[0],Math.min(s[1],e.k*Math.pow(2,o.apply(this,arguments)))),a=Gt(this);if(t.wheel)t.mouse[0][0]===a[0]&&t.mouse[0][1]===a[1]||(t.mouse[1]=e.invert(t.mouse[0]=a)),clearTimeout(t.wheel);else{if(e.k===r)return;t.mouse=[a,e.invert(a)],de(this),t.start()}$n(),t.wheel=setTimeout(l,150),t.zoom("mouse",i(g(d(e,r),t.mouse[0],t.mouse[1]),t.extent,u))}function l(){t.wheel=null,t.end()}}function b(){if(!e&&n.apply(this,arguments)){var t=m(this,arguments,!0),r=mt(it.view).on("mousemove.zoom",l,!0).on("mouseup.zoom",c,!0),o=Gt(this),a=it.clientX,s=it.clientY;Mt(it.view),Hn(),t.mouse=[o,this.__zoom.invert(o)],de(this),t.start()}function l(){if($n(),!t.moved){var e=it.clientX-a,n=it.clientY-s;t.moved=e*e+n*n>f}t.zoom("mouse",i(g(t.that.__zoom,t.mouse[0]=Gt(t.that),t.mouse[1]),t.extent,u))}function c(){r.on("mousemove.zoom mouseup.zoom",null),zt(it.view,t.moved),$n(),t.end()}}function x(){if(n.apply(this,arguments)){var t=this.__zoom,e=Gt(this),o=t.invert(e),a=t.k*(it.shiftKey?.5:2),s=i(g(d(t,a),e,o),r.apply(this,arguments),u);$n(),l>0?mt(this).transition().duration(l).call(y,s,e):mt(this).call(p.transform,s)}}function k(){if(n.apply(this,arguments)){var e,r,i,o,a=it.touches,s=a.length,u=m(this,arguments,it.changedTouches.length===s);for(Hn(),r=0;r<s;++r)i=a[r],o=[o=qt(this,a,i.identifier),this.__zoom.invert(o),i.identifier],u.touch0?u.touch1||u.touch0[2]===o[2]||(u.touch1=o,u.taps=0):(u.touch0=o,e=!0,u.taps=1+!!t);t&&(t=clearTimeout(t)),e&&(u.taps<2&&(t=setTimeout((function(){t=null}),500)),de(this),u.start())}}function E(){if(this.__zooming){var e,n,r,o,a=m(this,arguments),s=it.changedTouches,l=s.length;for($n(),t&&(t=clearTimeout(t)),a.taps=0,e=0;e<l;++e)n=s[e],r=qt(this,s,n.identifier),a.touch0&&a.touch0[2]===n.identifier?a.touch0[0]=r:a.touch1&&a.touch1[2]===n.identifier&&(a.touch1[0]=r);if(n=a.that.__zoom,a.touch1){var c=a.touch0[0],h=a.touch0[1],f=a.touch1[0],p=a.touch1[1],v=(v=f[0]-c[0])*v+(v=f[1]-c[1])*v,y=(y=p[0]-h[0])*y+(y=p[1]-h[1])*y;n=d(n,Math.sqrt(v/y)),r=[(c[0]+f[0])/2,(c[1]+f[1])/2],o=[(h[0]+p[0])/2,(h[1]+p[1])/2]}else{if(!a.touch0)return;r=a.touch0[0],o=a.touch0[1]}a.zoom("touch",i(g(n,r,o),a.extent,u))}}function T(){if(this.__zooming){var t,n,r=m(this,arguments),i=it.changedTouches,o=i.length;for(Hn(),e&&clearTimeout(e),e=setTimeout((function(){e=null}),500),t=0;t<o;++t)n=i[t],r.touch0&&r.touch0[2]===n.identifier?delete r.touch0:r.touch1&&r.touch1[2]===n.identifier&&delete r.touch1;if(r.touch1&&!r.touch0&&(r.touch0=r.touch1,delete r.touch1),r.touch0)r.touch0[1]=this.__zoom.invert(r.touch0[0]);else if(r.end(),2===r.taps){var a=mt(this).on("dblclick.zoom");a&&a.apply(this,arguments)}}}return p.transform=function(t,e,n){var r=t.selection?t.selection():t;r.property("__zoom",Yn),t!==r?y(t,e,n):r.interrupt().each((function(){m(this,arguments).start().zoom(null,"function"==typeof e?e.apply(this,arguments):e).end()}))},p.scaleBy=function(t,e,n){p.scaleTo(t,(function(){var t=this.__zoom.k,n="function"==typeof e?e.apply(this,arguments):e;return t*n}),n)},p.scaleTo=function(t,e,n){p.transform(t,(function(){var t=r.apply(this,arguments),o=this.__zoom,a=null==n?v(t):"function"==typeof n?n.apply(this,arguments):n,s=o.invert(a),l="function"==typeof e?e.apply(this,arguments):e;return i(g(d(o,l),a,s),t,u)}),n)},p.translateBy=function(t,e,n){p.transform(t,(function(){return i(this.__zoom.translate("function"==typeof e?e.apply(this,arguments):e,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),u)}))},p.translateTo=function(t,e,n,o){p.transform(t,(function(){var t=r.apply(this,arguments),a=this.__zoom,s=null==o?v(t):"function"==typeof o?o.apply(this,arguments):o;return i(Un.translate(s[0],s[1]).scale(a.k).translate("function"==typeof e?-e.apply(this,arguments):-e,"function"==typeof n?-n.apply(this,arguments):-n),t,u)}),o)},_.prototype={start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(t,e){return this.mouse&&"mouse"!==t&&(this.mouse[1]=e.invert(this.mouse[0])),this.touch0&&"touch"!==t&&(this.touch0[1]=e.invert(this.touch0[0])),this.touch1&&"touch"!==t&&(this.touch1[1]=e.invert(this.touch1[0])),this.that.__zoom=e,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(t){ct(new qn(p,t,this.that.__zoom),h.apply,h,[t,this.that,this.args])}},p.wheelDelta=function(t){return arguments.length?(o="function"==typeof t?t:Gn(+t),p):o},p.filter=function(t){return arguments.length?(n="function"==typeof t?t:Gn(!!t),p):n},p.touchable=function(t){return arguments.length?(a="function"==typeof t?t:Gn(!!t),p):a},p.extent=function(t){return arguments.length?(r="function"==typeof t?t:Gn([[+t[0][0],+t[0][1]],[+t[1][0],+t[1][1]]]),p):r},p.scaleExtent=function(t){return arguments.length?(s[0]=+t[0],s[1]=+t[1],p):[s[0],s[1]]},p.translateExtent=function(t){return arguments.length?(u[0][0]=+t[0][0],u[1][0]=+t[1][0],u[0][1]=+t[0][1],u[1][1]=+t[1][1],p):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},p.constrain=function(t){return arguments.length?(i=t,p):i},p.duration=function(t){return arguments.length?(l=+t,p):l},p.interpolate=function(t){return arguments.length?(c=t,p):c},p.on=function(){var t=h.on.apply(h,arguments);return t===h?p:t},p.clickDistance=function(t){return arguments.length?(f=(t=+t)*t,p):Math.sqrt(f)},p}(),r.call(this.d3Zoom).on("dblclick.zoom",null);var c=r.selectAll("g.nodes>g[id='"+e+"']"),h=(this.d3Zoom.scaleExtent([.01,50]).on("zoom",(function(){i.attr("transform",it.transform)})),null),f=null;if(c.empty()){if(s)return void this.fitToScreen({svg:r});h=n.graph().width/2,f=n.graph().height/2}else{var p=c.attr("transform").replace(/[^0-9\-.,]/g,"").split(",");h=p[0],f=p[1]}var d=-(1.2*h-o/2),g=-(1.2*f-a/2);this.zoom({svg:r,xa:d,ya:g,scale:1.2}),l?r.transition().duration(750).call(this.d3Zoom.transform,Un.translate(d,g).scale(1.2)):r.call(this.d3Zoom.transform,Un.translate(d,g).scale(1.2)),u&&u({newScale:1.2,newTranslate:[d,g],d3Zoom:this.d3Zoom,selectedNodeEl:c})},getToolTipDirection:function(t){var e=t.el,n=mt("body").node().getBoundingClientRect().width,r=mt(e).node().getBoundingClientRect(),i="e";return n-r.left<330?(i=n-r.left<330&&r.top<400?"sw":"w",n-r.left<330&&r.top>600&&(i="nw")):r.top>600?(i=n-r.left<330&&r.top>600?"nw":"n",r.left<50&&(i="ne")):r.top<400&&(i=r.left<50?"se":"s"),i},onHoverFade:function(t){var e=t.svg,n=t.g,r=t.mouseenter,i=t.nodesToHighlight,o=t.hoveredNode;return function(t){var i=e.selectAll(".node"),a=e.selectAll(".edgePath");if(r){e.classed("hover",!0);var s=n.successors(o),u=n.predecessors(o);t=s.concat(u);i.classed("hover-active-node",(function(e,n,r){return!!function(t,e,n){if(t===n||e&&e.length&&-1!=e.indexOf(n))return!0}(o,t,e)})),a.classed("hover-active-path",(function(t){return!!(t.v===o||t.w===o?1:0)}))}else e.classed("hover",!1),i.classed("hover-active-node",!1),a.classed("hover-active-path",!1)}(i)},getBaseUrl:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.pathname;return t.replace(/\/[\w-]+.(jsp|html)|\/+$/gi,"")},getEntityIconPath:function(t){var e=t.entityData,n=t.errorUrl,r=t.imgBasePath,i=this.getBaseUrl()+(r||"/img/entity-icon/");if(e){var o=function(t){return i+(mr.entityStateReadOnly[l]?"disabled/"+t:t)},a=function(){return c?mr.entityStateReadOnly[l]?i+"disabled/process.png":i+"process.png":mr.entityStateReadOnly[l]?i+"disabled/table.png":i+"table.png"},s=e.typeName,u=e.serviceType,l=e.status,c=e.isProcess;if(n){if(n.indexOf("table.png")>-1)return null;var h=!(!n||!n.match("entity-icon/"+s+".png|disabled/"+s+".png"));return u&&h?o(u+".png"):a()}return s?o(s+".png"):u?o(u+".png"):a()}},base64Encode:function(t,e){var n=new FileReader;n.addEventListener("load",(function(){return e(n.result)})),n.readAsDataURL(t)},imgShapeRender:function(t,e,n,r){var i=r.dagreD3,o=r.defsEl,a=r.imgBasePath,s=r.guid,u=r.isRankdirToBottom,l=this,c=s,h=n.btnType?"/img/entity-icon/expandBtn.svg":this.getEntityIconPath({entityData:n,imgBasePath:a}),f=h.split("/").pop();if(void 0===this.imageObject&&(this.imageObject={}),n.isDeleted&&(f="deleted_"+f),n.id==c)var p=!0;var d=t.append("circle").attr("fill","url(#img_"+f+")").attr("r",u?"30px":"24px").attr("data-stroke",n.id).attr("stroke-width","2px").attr("class","nodeImage "+(p?"currentNode":n.isProcess?"process":"node"));if(p&&d.attr("stroke","#fb4200"),!0===n.isIncomplete){t.attr("class","node isIncomplete show"),t.insert("rect").attr("x","-5").attr("y","-23").attr("width","14").attr("height","16").attr("fill","url(#img_hourglass.svg)").attr("data-stroke",n.id).attr("stroke-width","2px");g({imgName:"hourglass.svg",imageIconPath:"/img/entity-icon/hourglass.svg",leftPosition:"0",topPosition:"0",width:"12",height:"14"})}function g(t){o.select('pattern[id="img_'+t.imgName+'"]').empty()&&o.append("pattern").attr("x","0%").attr("y","0%").attr("patternUnits","objectBoundingBox").attr("id","img_"+t.imgName).attr("width","100%").attr("height","100%").append("image").attr("href",(function(e){var r=this;if(n){!function e(i){var o=i.imagePath,a={url:o,method:"GET",cache:!0};d.attr("data-iconpath",o);var s=new XMLHttpRequest;s.onreadystatechange=function(){if(4===s.readyState)if(200===s.status)"IE"!==yr.a.name?l.base64Encode(this.response,(function(e){l.imageObject[t.imageIconPath]=e,mt(r).attr("xlink:href",e)})):l.imageObject[t.imageIconPath]=o,t.imageIconPath!==d.attr("data-iconpath")&&d.attr("data-iconpathorigin",t.imageIconPath);else if(404===s.status){var i=l.getEntityIconPath({entityData:n,errorUrl:o});if(null===i){var a=mt(r.parentElement);a.select("image").remove(),a.attr("patternContentUnits","objectBoundingBox").append("circle").attr("r","24px").attr("fill","#e8e8e8")}else e({imagePath:i})}},s.responseType="blob",s.open(a.method,a.url,!0),s.send(null)}({imagePath:t.imageIconPath})}})).attr("x",t.leftPosition).attr("y",t.topPosition).attr("width",t.width).attr("height",t.height)}return g({imgName:f,imageIconPath:h,leftPosition:u?"11":"4",topPosition:u?"20":p?"3":"4",width:"40",height:"40"}),n.intersect=function(t){return i.intersect.circle(n,p?l.nodeArrowDistance+3:l.nodeArrowDistance,t)},d},arrowPointRender:function(t,e,n,r,i){var o=i.dagreD3,a=t.node(),s=a?a.parentNode:t;mt(s).select("path.path").attr("marker-end","url(#"+e+")");var u=t.append("marker").attr("id",e).attr("viewBox","0 0 10 10").attr("refX",8).attr("refY",5).attr("markerUnits","strokeWidth").attr("markerWidth",4).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").style("fill",n.styleObj.stroke);o.util.applyStyle(u,n[r+"Style"])},saveSvg:function(t){var e=t.svg,n=t.width,r=t.height,i=t.downloadFileName,o=t.onExportLineage,a=this,s=e.clone(!0).node();setTimeout((function(){"Firefox"===yr.a.name&&(s.setAttribute("width",n),s.setAttribute("height",r));var t=mt("body").append("div");t.classed("hidden-svg",!0),t.node().appendChild(s);var e=mt(".hidden-svg svg");e.select("g").attr("transform","scale(1)"),e.select("foreignObject").remove();var u=150,l=150,c=s.getBBox().width+u,h=s.getBBox().height+l,f=s.getBBox().x,p=s.getBBox().y;s.attributes.viewBox.value=f+","+p+","+c+","+h;var d=document.createElement("canvas");d.id="canvas",d.style.display="none",d.width=1*s.getBBox().width+u,d.height=1*s.getBBox().height+l,mt("body").node().appendChild(d);var g=d.getContext("2d"),v=(new XMLSerializer).serializeToString(s),y=window.URL||window.webkitURL||window;g.fillStyle="#FFFFFF",g.fillRect(0,0,d.width,d.height),g.strokeRect(0,0,d.width,d.height),g.restore();var m=new Image(d.width,d.height),_=new Blob([v],{type:"image/svg+xml;base64"});"Safari"===yr.a.name&&(_=new Blob([v],{type:"image/svg+xml"})),g.drawImage(m,50,50,d.width,d.height);var w=y.createObjectURL(_);m.onload=function(){try{var e=document.createElement("a");e.download=i,document.body.appendChild(e),g.drawImage(m,50,50,d.width,d.height),d.toBlob((function(t){t?(e.href=y.createObjectURL(t),t.size>1e7&&o({status:"failed",message:"The Image size is huge, please open the image in a browser!"}),e.click(),o({status:"Success",message:"Successful"}),"Safari"===yr.a.name&&a.refreshGraphForSafari({edgeEl:a.$("svg g.node")})):o({status:"failed",message:"There was an error in downloading Lineage!"})}),"image/png"),t.remove(),d.remove()}catch(t){o({status:"failed",message:"There was an error in downloading Lineage!"})}},m.src=w}),0)}};function wr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function br(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?wr(Object(n),!0).forEach((function(e){xr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function xr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var kr={getBaseUrl:function(t){return t.replace(/\/[\w-]+.(jsp|html)|\/+$/gi,"")},getEntityIconPath:function(){var t,e,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.entityData,o=r.errorUrl,a=this.getBaseUrl(window.location.pathname)+Globals.entityImgPath;function s(t){return a+(mr.entityStateReadOnly[e]?"disabled/"+t:t)}function u(){return i.isProcess?mr.entityStateReadOnly[e]?a+"disabled/process.png":a+"process.png":mr.entityStateReadOnly[e]?a+"disabled/table.png":a+"table.png"}if(i&&(n=i.typeName,t=i&&i.serviceType,e=i&&i.status),i){if(o){var l=!(!o||!o.match("entity-icon/"+n+".png|disabled/"+n+".png"));return t&&l?s(t+".png"):u()}return i.typeName?s(i.typeName+".png"):u()}},isProcess:function(t){var e=t.typeName,n=t.superTypes;t.entityDef;return"Process"==e||n.indexOf("Process")>-1},isDeleted:function(t){if(void 0!==t)return mr.entityStateReadOnly[t.status]},isNodeToBeUpdated:function(t,e){var n=e.isProcessHideCheck,r=e.isDeletedEntityHideCheck,i={isProcess:n&&t.isProcess,isDeleted:r&&t.isDeleted};return i.update=i.isProcess||i.isDeleted,"Expand"===t.label&&(i.update=!0),i},getServiceType:function(t){var e=t.typeName,n=t.entityDef,r=null;return e&&n&&(r=n.serviceType||null),r},getEntityDef:function(t){var e=t.typeName,n=t.entityDefCollection,r=null;return e&&(r=n.find((function(t){return t.name==e}))),r},getNestedSuperTypes:function(t){var e=t.entityDef,n=t.entityDefCollection,r=new Set;return function t(e,n){e&&e.superTypes&&e.superTypes.length&&e.superTypes.forEach((function(e){r.add(e);var i=n.find((function(t){t.name}));i&&t(i,n)}))}(e,n),Array.from(r)},generateData:function(t){var e=this,n=t.data,r=void 0===n?{}:n,i=t.filterObj,o=t.entityDefCollection,a=t.g,s=t.guid,u=t.setGraphEdge,l=t.setGraphNode;return new Promise((function(t,n){try{var c=r.relations||{},h=r.guidEntityMap||{},f=i.isProcessHideCheck||i.isDeletedEntityHideCheck,p={fill:"none",stroke:"#ffb203",width:3},d=function(t){if(t){if(t.updatedValues)return t;var n=t.displayText?t.displayText:" ",r=Object.assign(t,{shape:"img",updatedValues:!0,label:n.trunc(18),toolTipLabel:n,id:t.guid,isLineage:!0,isIncomplete:t.isIncomplete,entityDef:e.getEntityDef({typeName:t.typeName,entityDefCollection:o})});return r.serviceType=e.getServiceType(r),r.superTypes=e.getNestedSuperTypes(br(br({},r),{},{entityDefCollection:o})),r.isProcess=e.isProcess(r),r.isDeleted=e.isDeleted(r),r}},g=function(t){return"fill:"+t.fill+";stroke:"+t.stroke+";stroke-width:"+t.width},v=function(t,n,r){var i=[];return t.forEach((function(t){if(e.isNodeToBeUpdated(d(h[t]),r).update)if(w[t])i=i.concat(w[t]);else{var n=function t(n,r){if(n&&b[n]){var i=[];return b[n].forEach((function(n){if(e.isNodeToBeUpdated(d(h[n]),r).update){var o=t(n,r);o&&(i=i.concat(o))}else i.push(n)})),i}return null}(t,r);n&&(i=i.concat(n))}else i.push(t)})),i},y=function(t){if(a._nodes[t])return a._nodes[t];var e=d(h[t]);return l(t,e),e},m=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};u(t,e,br({arrowhead:"arrowPoint",curve:bt,style:g(p),styleObj:p},n))},_=function(t,e){y(t),y(e),m(t,e)},w={};if(f){var b=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.relations,n={};return e.forEach((function(t){n[t.fromEntityId]?n[t.fromEntityId].push(t.toEntityId):n[t.fromEntityId]=[t.toEntityId]})),n}(r);Object.keys(b).forEach((function(t){var n=b[t],r=e.isNodeToBeUpdated(d(h[t]),i),o=v(n,0,i);r.update?w[t]?w[t]=w[t].concat(o):w[t]=o:o.forEach((function(e){_(t,e)}))}))}else c.length?c.forEach((function(t){_(t.fromEntityId,t.toEntityId)})):y(s);a._nodes[s]&&(a._nodes[s]&&(a._nodes[s].isLineage=!1),e.findImpactNodeAndUpdateData({guid:s,g:a,setEdge:m,getStyleObjStr:g})),a._nodes[s]||y(s),t(a)}catch(t){n(t)}}))},findImpactNodeAndUpdateData:function(t){var e=t.guid,n=t.getStyleObjStr,r=t.g,i=t.setEdge,o={},a={fill:"none",stroke:"#fb4200",width:3};!function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0,u=Object.keys(e);u.length&&(o[s]||(o[s]=!0,u.forEach((function(e){r._nodes[e]&&(r._nodes[e].isLineage=!1),i(s,e,{style:n(a),styleObj:a}),t(r._sucs[e],e)}))))}(r._sucs[e],e)}};String.prototype.trunc=String.prototype.trunc||function(t){return this.length>t?this.substr(0,t-1)+"...":this};function Er(){}function Tr(t,e){var n=new Er;if(t instanceof Er)t.each((function(t,e){n.set(e,t)}));else if(Array.isArray(t)){var r,i=-1,o=t.length;if(null==e)for(;++i<o;)n.set(i,t[i]);else for(;++i<o;)n.set(e(r=t[i],i,t),r)}else if(t)for(var a in t)n.set(a,t[a]);return n}Er.prototype=Tr.prototype={constructor:Er,has:function(t){return"$"+t in this},get:function(t){return this["$"+t]},set:function(t,e){return this["$"+t]=e,this},remove:function(t){var e="$"+t;return e in this&&delete this[e]},clear:function(){for(var t in this)"$"===t[0]&&delete this[t]},keys:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(e.slice(1));return t},values:function(){var t=[];for(var e in this)"$"===e[0]&&t.push(this[e]);return t},entries:function(){var t=[];for(var e in this)"$"===e[0]&&t.push({key:e.slice(1),value:this[e]});return t},size:function(){var t=0;for(var e in this)"$"===e[0]&&++t;return t},empty:function(){for(var t in this)if("$"===t[0])return!1;return!0},each:function(t){for(var e in this)"$"===e[0]&&t(this[e],e.slice(1),this)}};var Nr=Tr;function Or(){}var Sr=Nr.prototype;function Pr(t,e){var n=new Or;if(t instanceof Or)t.each((function(t){n.add(t)}));else if(t){var r=-1,i=t.length;if(null==e)for(;++r<i;)n.add(t[r]);else for(;++r<i;)n.add(e(t[r],r,t))}return n}Or.prototype=Pr.prototype={constructor:Or,has:Sr.has,add:function(t){return this["$"+(t+="")]=t,this},remove:Sr.remove,clear:Sr.clear,values:Sr.keys,size:Sr.size,empty:Sr.empty,each:Sr.each};n(9);function Ar(t){return(Ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Mr(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function zr(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Mr(Object(n),!0).forEach((function(e){jr(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mr(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function jr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dr(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var Cr=function(){function t(e){var n=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._setGraphNode=function(t,e){n.actualData[t]=Object.assign({},e),n.g.setNode(t,e)},this._setGraphEdge=function(t,e,r){n.g.setEdge(t,e,zr({curve:bt},r))},this.options={},this._updateOptions(e);var r=this.options,i=r.el,o=r.manualTrigger,a=void 0!==o&&o;if(void 0===i)throw new Error("LineageHelper requires el propety to render the graph");return this.initReturnObj={init:function(t){return n.init(t)},updateOptions:function(t){return n._updateAllOptions(t)},createGraph:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n._createGraph(n.options,n.graphOptions,t)},clear:function(t){return n.clear(t)},refresh:function(t){return n.refresh(t)},centerAlign:function(t){return n.centerAlign(t)},exportLineage:function(t){return n.exportLineage(t)},zoomIn:function(t){return n.zoomIn(t)},zoomOut:function(t){return n.zoomOut(t)},zoom:function(t){return n.zoom(t)},fullScreen:function(t){return n.fullScreen(t)},searchNode:function(t){return n.searchNode(t)},displayFullName:function(t){return n.displayFullName(t)},removeNodeSelection:function(t){return n.removeNodeSelection(t)},getGraphOptions:function(){return n.graphOptions},getNode:function(t,e){var r=null;return(r=e?n.actualData[t]:n.g._nodes[t])&&(r=Object.assign({},r)),r},getNodes:function(t,e){var r=null;return(r=e?n.actualData:n.g._nodes)&&(r=Object.assign({},r)),r},setNode:this._setGraphNode,setEdge:this._setGraphEdge},!1===a&&this.init(),this.initReturnObj}var e,n,r;return e=t,(n=[{key:"_updateAllOptions",value:function(t){Object.assign(this.options,t);var e=this.svg.node().getBoundingClientRect();this.graphOptions.width=this.options.width||e.width,this.graphOptions.height=this.options.height||e.height;var n=this.graphOptions,r=n.svg,i=n.width,o=n.height,a=n.guid,s=this.options.fitToScreen;r.select("g").node().removeAttribute("transform"),r.attr("viewBox","0 0 "+i+" "+o).attr("enable-background","new 0 0 "+i+" "+o),this.centerAlign({fitToScreen:s,guid:a})}},{key:"_updateOptions",value:function(t){Object.assign(this.options,{filterObj:{isProcessHideCheck:!1,isDeletedEntityHideCheck:!1}},t)}},{key:"init",value:function(){var t=this.options.data,e=void 0===t?{}:t;e.baseEntityGuid&&(this.guid=e.baseEntityGuid),this._initializeGraph(),this._initGraph()}},{key:"clear",value:function(){this.options.el||(this.svg.remove(),this.svg=null),this.g=null,this.graphOptions={}}},{key:"centerAlign",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.svg.select("g"),n=e.selectAll("g.edgePath");_r.centerNode(zr(zr({},this.graphOptions),{},{svgGroupEl:e,edgePathEl:n},t))}},{key:"zoomIn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_r.zoomIn(zr(zr({},this.graphOptions),t))}},{key:"zoomOut",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_r.zoomOut(zr(zr({},this.graphOptions),t))}},{key:"zoom",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_r.zoom(zr(zr({},this.graphOptions),t))}},{key:"displayFullName",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this;this.g.nodes().forEach((function(n){var r=e.svg.selectAll("g.nodes>g[id='"+n+"']"),i=e.g.node(n).toolTipLabel;1==t.bLabelFullText?r.select("tspan").text(i):r.select("tspan").text(i.trunc(18))})),this.selectedNode&&this.searchNode({guid:this.selectedNode})}},{key:"refresh",value:function(t){if(this.clear(),this._initializeGraph(),this._initGraph({refresh:!0}),this.selectedNode="",t&&t.compactLineageEnabled&&t.filterObj){var e=t.filterObj.isProcessHideCheck,n=t.filterObj.isDeletedEntityHideCheck;this._AddFilterNotification(e,n)}}},{key:"removeNodeSelection",value:function(){this.svg.selectAll("g.node>circle").classed("node-detail-highlight",!1)}},{key:"searchNode",value:function(t){var e=t.guid,n=t.onSearchNode;this.svg.selectAll(".serach-rect").remove(),this.svg.selectAll(".label").attr("stroke","none"),this.selectedNode=e,this.centerAlign({guid:e,onCenterZoomed:function(t){var e=t.selectedNodeEl,r=e.node().getBBox(),i=r.width+10,o=r.x-5;e.select(".label").attr("stroke","#316132"),e.select("circle").classed("wobble",!0),e.insert("rect","circle").attr("class","serach-rect").attr("stroke","#37bb9b").attr("stroke-width","2.5px").attr("fill","none").attr("x",o).attr("y",-27.5).attr("width",i).attr("height",60),n&&"function"==typeof n&&n(t)},isSelected:!0})}},{key:"exportLineage",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.downloadFileName;if(void 0===e){var n=this.g._nodes[this.guid];e=n&&n.attributes?"".concat(n.attributes.qualifiedName||n.attributes.name||"lineage_export",".png"):"export.png"}_r.saveSvg(zr(zr({},this.graphOptions),{},{downloadFileName:e,onExportLineage:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(e){t.onExportLineage&&onExportLineage(e)}))}))}},{key:"fullScreen",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.el;if(void 0===e)throw new Error("LineageHelper requires el propety to apply fullScreen class");var n=mt(e);return n.classed("fullscreen-mode")?(n.classed("fullscreen-mode",!1),!1):(n.classed("fullscreen-mode",!0),!0)}},{key:"_getValueFromUser",value:function(t){if(void 0!==t)return"function"==typeof t?t():t}},{key:"_initializeGraph",value:function(){var t=this.options,e=t.width,n=void 0===e?"100%":e,r=t.height,o=void 0===r?"100%":r,a=t.el;this.svg=mt(a),a instanceof SVGElement||(this.svg.selectAll("*").remove(),this.svg=this.svg.append("svg").attr("xmlns","http://www.w3.org/2000/svg").attr(" xmlns:xlink","http://www.w3.org/1999/xlink").attr("version","1.1").attr("width",n).attr("height",o)),this.g=(new i.a.graphlib.Graph).setGraph(Object.assign({nodesep:50,ranksep:90,rankdir:"LR",marginx:20,marginy:20,transition:function(t){return t.transition().duration(500)}},this.options.dagreOptions)).setDefaultEdgeLabel((function(){return{}}));var s=this.svg.node().getBoundingClientRect();this.actualData={},this.graphOptions={svg:this.svg,g:this.g,dagreD3:i.a,guid:this.guid,width:this.options.width||s.width,height:this.options.height||s.height}}},{key:"_initGraph",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.refresh;this.svg&&this.svg.select("g").remove();var r=this.options.filterObj;if(this.options.getFilterObj){var i=this.options.getFilterObj();if(void 0!==i||null!==i){if("object"!==Ar(i))throw new Error("getFilterObj expect return type `object`,`null` or `Undefined`");r=i}}if(!0!==this.options.setDataManually)return void 0===this.options.data||this.options.data&&0===this.options.data.relations.length&&_.isEmpty(this.options.data.guidEntityMap)?(this.options.beforeRender&&this.options.beforeRender(),this.svg.append("text").attr("x","50%").attr("y","50%").attr("alignment-baseline","middle").attr("text-anchor","middle").text("No lineage data found"),void(this.options.afterRender&&this.options.afterRender())):kr.generateData(zr(zr(zr({},this.options),{},{filterObj:r},this.graphOptions),{},{setGraphNode:this._setGraphNode,setGraphEdge:this._setGraphEdge})).then((function(e){t._createGraph(t.options,t.graphOptions,{refresh:n})}))}},{key:"_createGraph",value:function(t,e,n){var r=this,o=t.data,a=void 0===o?{}:o,s=t.imgBasePath,u=t.isShowTooltip,l=t.isShowHoverPath,c=t.onLabelClick,h=t.onPathClick,f=t.onNodeClick,p=t.zoom,d=t.fitToScreen,g=t.getToolTipContent,v=t.toolTipTitle,y=n.refresh;this.options.beforeRender&&this.options.beforeRender(),this.selectedNode="";var m=this,_=e.svg,w=e.g,b=e.width,x=e.height,k=this.options.dagreOptions&&"tb"===this.options.dagreOptions.rankdir;if(_ instanceof yt==0)throw new Error("svg is not initialized or something went wrong while creatig graph instance");if(void 0!==w._nodes&&0!==w._nodes.length){w.nodes().forEach((function(t){var e=w.node(t);e&&(e.rx=e.ry=5)})),_.attr("viewBox","0 0 "+b+" "+x).attr("enable-background","new 0 0 "+b+" "+x);var E=_.append("g"),T=_.append("defs"),N=new i.a.render;N.arrows().arrowPoint=function(){return _r.arrowPointRender.apply(_r,Array.prototype.slice.call(arguments).concat([zr({},e)]))},N.shapes().img=function(){return _r.imgShapeRender.apply(_r,Array.prototype.slice.call(arguments).concat([zr(zr({},e),{},{isRankdirToBottom:k,imgBasePath:m._getValueFromUser(s),defsEl:T})]))};var O=function(){var t=function(){return"n"},e=function(){return[0,0]},n=function(){return" "},r=document.body,i=h(),o=null,a=null,s=null;function u(t){(o=function(t){var e=t.node();return e?"svg"===e.tagName.toLowerCase()?e:e.ownerSVGElement:null}(t))&&(a=o.createSVGPoint(),r.appendChild(i))}u.show=function(){var i=Array.prototype.slice.call(arguments);i[i.length-1]instanceof SVGElement&&(s=i.pop());var o,a=n.apply(this,i),h=e.apply(this,i),p=t.apply(this,i),d=f(),g=c.length,v=document.documentElement.scrollTop||r.scrollTop,y=document.documentElement.scrollLeft||r.scrollLeft;for(d.html(a).style("opacity",1).style("pointer-events","all");g--;)d.classed(c[g],!1);return o=l.get(p).apply(this),d.classed(p,!0).style("top",o.top+h[0]+v+"px").style("left",o.left+h[1]+y+"px"),u},u.hide=function(){return f().style("opacity",0).style("pointer-events","none"),u},u.attr=function(t,e){if(arguments.length<2&&"string"==typeof t)return f().attr(t);var n=Array.prototype.slice.call(arguments);return yt.prototype.attr.apply(f(),n),u},u.style=function(t,e){if(arguments.length<2&&"string"==typeof t)return f().style(t);var n=Array.prototype.slice.call(arguments);return yt.prototype.style.apply(f(),n),u},u.direction=function(e){return arguments.length?(t=null==e?e:d(e),u):t},u.offset=function(t){return arguments.length?(e=null==t?t:d(t),u):e},u.html=function(t){return arguments.length?(n=null==t?t:d(t),u):n},u.rootElement=function(t){return arguments.length?(r=null==t?t:d(t),u):r},u.destroy=function(){return i&&(f().remove(),i=null),u};var l=Nr({n:function(){var t=p(this);return{top:t.n.y-i.offsetHeight,left:t.n.x-i.offsetWidth/2}},s:function(){var t=p(this);return{top:t.s.y,left:t.s.x-i.offsetWidth/2}},e:function(){var t=p(this);return{top:t.e.y-i.offsetHeight/2,left:t.e.x}},w:function(){var t=p(this);return{top:t.w.y-i.offsetHeight/2,left:t.w.x-i.offsetWidth}},nw:function(){var t=p(this);return{top:t.nw.y-i.offsetHeight,left:t.nw.x-i.offsetWidth}},ne:function(){var t=p(this);return{top:t.ne.y-i.offsetHeight,left:t.ne.x}},sw:function(){var t=p(this);return{top:t.sw.y,left:t.sw.x-i.offsetWidth}},se:function(){var t=p(this);return{top:t.se.y,left:t.se.x}}}),c=l.keys();function h(){var t=mt(document.createElement("div"));return t.style("position","absolute").style("top",0).style("opacity",0).style("pointer-events","none").style("box-sizing","border-box"),t.node()}function f(){return null==i&&(i=h(),r.appendChild(i)),mt(i)}function p(t){for(var e=s||t;null==e.getScreenCTM&&null!=e.parentNode;)e=e.parentNode;var n={},r=e.getScreenCTM(),i=e.getBBox(),o=i.width,u=i.height,l=i.x,c=i.y;return a.x=l,a.y=c,n.nw=a.matrixTransform(r),a.x+=o,n.ne=a.matrixTransform(r),a.y+=u,n.se=a.matrixTransform(r),a.x-=o,n.sw=a.matrixTransform(r),a.y-=u/2,n.w=a.matrixTransform(r),a.x+=o,n.e=a.matrixTransform(r),a.x-=o/2,a.y-=u/2,n.n=a.matrixTransform(r),a.y+=u,n.s=a.matrixTransform(r),n}function d(t){return"function"==typeof t?t:function(){return t}}return u}().attr("class","d3-tip").offset([10,0]).html((function(t){if(g&&"function"==typeof g)return g(t,w.node(t));var e=w.node(t),n="";return v?n="<h5 style='text-align: center;'>"+v+"</h5>":e.id!==r.guid&&(n="<h5 style='text-align: center;'>"+(e.isLineage?"Lineage":"Impact")+"</h5>"),n+="<h5 class='text-center'><span style='color:#359f89'>"+e.toolTipLabel+"</span></h5> ",e.typeName&&(n+="<h5 class='text-center'><span>("+e.typeName+")</span></h5> "),e.queryText&&(n+="<h5>Query: <span style='color:#359f89'>"+e.queryText+"</span></h5> "),"<div class='tip-inner-scroll'>"+n+"</div>"}));_.call(O),N(E,w),E.selectAll("g.nodes g.label").attr("transform",(function(){return k?"translate(2,-20)":"translate(2,-38)"})).attr("font-size","10px").on("mouseenter",(function(t){it.preventDefault(),mt(this).classed("highlight",!0)})).on("mouseleave",(function(t){it.preventDefault(),mt(this).classed("highlight",!1)})).on("click",(function(t){it.preventDefault(),c&&"function"==typeof c&&c({clickedData:t}),O.hide(t)})),E.selectAll("g.nodes g.node circle").on("mouseenter",(function(t,n,r){if(m.activeNode=!0,this.getScreenCTM().translate(+this.getAttribute("cx"),+this.getAttribute("cy")),m.svg.selectAll(".node").classed("active",!1),mt(this).classed("active",!0),m._getValueFromUser(u)&&0!==t.indexOf("more")){var i=_r.getToolTipDirection({el:this});O.direction(i).show(t,this)}!1!==m._getValueFromUser(l)&&_r.onHoverFade(zr({opacity:.3,mouseenter:!0,hoveredNode:t},e))})).on("mouseleave",(function(t){m.activeNode=!1;var n=this;setTimeout((function(e){m.activeTip||m.activeNode||(mt(n).classed("active",!1),m._getValueFromUser(u)&&O.hide(t))}),150),!1!==m._getValueFromUser(l)&&_r.onHoverFade(zr({mouseenter:!1,hoveredNode:t},e))})).on("click",(function(t){it.defaultPrevented||(it.preventDefault(),O.hide(t),_.selectAll("g.node>circle").classed("node-detail-highlight",!1),mt(this).classed("node-detail-highlight",!0),f&&"function"==typeof f&&f({clickedData:t,el:this}))}));var S=E.selectAll("g.edgePath");S.selectAll("path.path").on("click",(function(t){if(h&&"function"==typeof h){var e=a.relations.find((function(e){if(e.fromEntityId===t.v&&e.toEntityId===t.w)return!0}));h({pathRelationObj:e,clickedData:t})}})),!1!==p&&_r.centerNode(zr(zr({},e),{},{fitToScreen:d,svgGroupEl:E,edgePathEl:S})),_r.dragNode(zr(zr({},e),{},{edgePathEl:S})),!0!==y&&this._addLegend(),this.options.afterRender&&this.options.afterRender()}else _.html('<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">No relations to display</text>')}},{key:"_addLegend",value:function(){if(!1!==this.options.legends){var t=mt(this.options.legendsEl||this.options.el).insert("div",":first-child").classed("legends",!0),e=t.append("span").style("color","#fb4200");e.append("i").classed("fa fa-circle-o fa-fw",!0),e.append("span").html("Current Entity"),(e=t.append("span").style("color","#686868")).append("i").classed("fa fa-hourglass-half fa-fw",!0),e.append("span").html("In Progress"),(e=t.append("span").style("color","#df9b00")).append("i").classed("fa fa-long-arrow-right fa-fw",!0),e.append("span").html("Lineage"),(e=t.append("span").style("color","#fb4200")).append("i").classed("fa fa-long-arrow-right fa-fw",!0),e.append("span").html("Impact"),(e=t.append("span").classed("notification hide",!0).style("color","#686868")).append("i").classed("fa fa-exclamation fa-fw",!0),e.append("span").html("Filtering hides all Expand buttons.")}}},{key:"_AddFilterNotification",value:function(t,e){t||e?$(this.options.legendsEl).find(".notification").removeClass("hide"):$(this.options.legendsEl).find(".notification").addClass("hide")}}])&&Dr(e.prototype,n),r&&Dr(e,r),t}()}])}));