@skydesign/tf 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +12 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +364 -362
- package/dist/{render-BqWiqrE9.mjs → render-Dzu8gXVX.mjs} +1287 -1249
- package/dist/render-wQ_Mruy4.js +106 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.js +2 -2
- package/dist/server.mjs +2 -1
- package/package.json +2 -1
- package/dist/render-cE_lsgcR.js +0 -94
package/dist/server.mjs
CHANGED
|
@@ -2,7 +2,7 @@ var yn = Object.defineProperty;
|
|
|
2
2
|
var mn = (c, l, f) => l in c ? yn(c, l, { enumerable: !0, configurable: !0, writable: !0, value: f }) : c[l] = f;
|
|
3
3
|
var he = (c, l, f) => mn(c, typeof l != "symbol" ? l + "" : l, f);
|
|
4
4
|
import { parseHTML as wn } from "linkedom";
|
|
5
|
-
import { b as gn, d as Fn, e as En, D as Mn, h as Cn } from "./render-
|
|
5
|
+
import { b as gn, d as Fn, e as En, D as Mn, h as Cn } from "./render-Dzu8gXVX.mjs";
|
|
6
6
|
var Rn = ArrayBuffer, q = Uint8Array, ur = Uint16Array, Ln = Int16Array, cr = Int32Array, Lr = function(c, l, f) {
|
|
7
7
|
if (q.prototype.slice) return q.prototype.slice.call(c, l, f);
|
|
8
8
|
(l == null || l < 0) && (l = 0), (f == null || f > c.length) && (f = c.length);
|
|
@@ -2420,6 +2420,7 @@ function ra(c, l = {}) {
|
|
|
2420
2420
|
// null = auto: tightest spacing that fits the widest edge label —
|
|
2421
2421
|
// deterministic, so server and client stay pixel-identical
|
|
2422
2422
|
nodeColumnSpacing: l.nodeColumnSpacing ?? null,
|
|
2423
|
+
chainIcon: l.chainIcon,
|
|
2423
2424
|
headless: !0
|
|
2424
2425
|
})
|
|
2425
2426
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skydesign/tf",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"@serenity-js/playwright-test": "^3.39.0",
|
|
47
47
|
"@serenity-js/serenity-bdd": "^3.39.0",
|
|
48
48
|
"@serenity-js/web": "^3.39.0",
|
|
49
|
+
"@skydesign/icons": "^0.1.3",
|
|
49
50
|
"@tailwindcss/postcss": "^4",
|
|
50
51
|
"@testing-library/dom": "^10.4.1",
|
|
51
52
|
"@testing-library/jest-dom": "^6.9.1",
|
package/dist/render-cE_lsgcR.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use strict";function _n(t){return JSON.stringify(JSON.stringify(t)).slice(1,-1)}function pt(t){try{return JSON.parse(t)}catch{const e=JSON.parse(`"${t}"`);return JSON.parse(e)}}var wn={value:()=>{}};function re(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new kt(n)}function kt(t){this._=t}function vn(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}kt.prototype=re.prototype={constructor:kt,on:function(t,e){var n=this._,r=vn(t+"",n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(t=r[a]).type)&&(i=bn(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++a<o;)if(i=(t=r[a]).type)n[i]=he(n[i],t.name,e);else if(e==null)for(i in n)n[i]=he(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new kt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(a=this._[t],r=0,i=a.length;r<i;++r)a[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,a=r.length;i<a;++i)r[i].value.apply(e,n)}};function bn(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function he(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=wn,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}var Vt="http://www.w3.org/1999/xhtml";const de={svg:"http://www.w3.org/2000/svg",xhtml:Vt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Lt(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),de.hasOwnProperty(e)?{space:de[e],local:t}:t}function En(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===Vt&&e.documentElement.namespaceURI===Vt?e.createElement(t):e.createElementNS(n,t)}}function Nn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Pe(t){var e=Lt(t);return(e.local?Nn:En)(e)}function $n(){}function ie(t){return t==null?$n:function(){return this.querySelector(t)}}function Sn(t){typeof t!="function"&&(t=ie(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,c=r[i]=new Array(o),s,l,u=0;u<o;++u)(s=a[u])&&(l=t.call(s,s.__data__,u,a))&&("__data__"in s&&(l.__data__=s.__data__),c[u]=l);return new F(r,this._parents)}function kn(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function An(){return[]}function ze(t){return t==null?An:function(){return this.querySelectorAll(t)}}function Tn(t){return function(){return kn(t.apply(this,arguments))}}function Mn(t){typeof t=="function"?t=Tn(t):t=ze(t);for(var e=this._groups,n=e.length,r=[],i=[],a=0;a<n;++a)for(var o=e[a],c=o.length,s,l=0;l<c;++l)(s=o[l])&&(r.push(t.call(s,s.__data__,l,o)),i.push(s));return new F(r,i)}function Ye(t){return function(){return this.matches(t)}}function Re(t){return function(e){return e.matches(t)}}var Cn=Array.prototype.find;function In(t){return function(){return Cn.call(this.children,t)}}function Dn(){return this.firstElementChild}function Pn(t){return this.select(t==null?Dn:In(typeof t=="function"?t:Re(t)))}var zn=Array.prototype.filter;function Yn(){return Array.from(this.children)}function Rn(t){return function(){return zn.call(this.children,t)}}function Ln(t){return this.selectAll(t==null?Yn:Rn(typeof t=="function"?t:Re(t)))}function On(t){typeof t!="function"&&(t=Ye(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,c=r[i]=[],s,l=0;l<o;++l)(s=a[l])&&t.call(s,s.__data__,l,a)&&c.push(s);return new F(r,this._parents)}function Le(t){return new Array(t.length)}function Bn(){return new F(this._enter||this._groups.map(Le),this._parents)}function It(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}It.prototype={constructor:It,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 Hn(t){return function(){return t}}function Fn(t,e,n,r,i,a){for(var o=0,c,s=e.length,l=a.length;o<l;++o)(c=e[o])?(c.__data__=a[o],r[o]=c):n[o]=new It(t,a[o]);for(;o<s;++o)(c=e[o])&&(i[o]=c)}function Wn(t,e,n,r,i,a,o){var c,s,l=new Map,u=e.length,f=a.length,h=new Array(u),g;for(c=0;c<u;++c)(s=e[c])&&(h[c]=g=o.call(s,s.__data__,c,e)+"",l.has(g)?i[c]=s:l.set(g,s));for(c=0;c<f;++c)g=o.call(t,a[c],c,a)+"",(s=l.get(g))?(r[c]=s,s.__data__=a[c],l.delete(g)):n[c]=new It(t,a[c]);for(c=0;c<u;++c)(s=e[c])&&l.get(h[c])===s&&(i[c]=s)}function Gn(t){return t.__data__}function Vn(t,e){if(!arguments.length)return Array.from(this,Gn);var n=e?Wn:Fn,r=this._parents,i=this._groups;typeof t!="function"&&(t=Hn(t));for(var a=i.length,o=new Array(a),c=new Array(a),s=new Array(a),l=0;l<a;++l){var u=r[l],f=i[l],h=f.length,g=Xn(t.call(u,u&&u.__data__,l,r)),m=g.length,x=c[l]=new Array(m),y=o[l]=new Array(m),p=s[l]=new Array(h);n(u,f,x,y,p,g,e);for(var w=0,b=0,E,S;w<m;++w)if(E=x[w]){for(w>=b&&(b=w+1);!(S=y[b])&&++b<m;);E._next=S||null}}return o=new F(o,r),o._enter=c,o._exit=s,o}function Xn(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function qn(){return new F(this._exit||this._groups.map(Le),this._parents)}function Un(t,e,n){var r=this.enter(),i=this,a=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function Zn(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,a=r.length,o=Math.min(i,a),c=new Array(i),s=0;s<o;++s)for(var l=n[s],u=r[s],f=l.length,h=c[s]=new Array(f),g,m=0;m<f;++m)(g=l[m]||u[m])&&(h[m]=g);for(;s<i;++s)c[s]=n[s];return new F(c,this._parents)}function Kn(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Qn(t){t||(t=Jn);function e(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,i=new Array(r),a=0;a<r;++a){for(var o=n[a],c=o.length,s=i[a]=new Array(c),l,u=0;u<c;++u)(l=o[u])&&(s[u]=l);s.sort(e)}return new F(i,this._parents).order()}function Jn(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function jn(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function tr(){return Array.from(this)}function er(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function nr(){let t=0;for(const e of this)++t;return t}function rr(){return!this.node()}function ir(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],a=0,o=i.length,c;a<o;++a)(c=i[a])&&t.call(c,c.__data__,a,i);return this}function or(t){return function(){this.removeAttribute(t)}}function ar(t){return function(){this.removeAttributeNS(t.space,t.local)}}function sr(t,e){return function(){this.setAttribute(t,e)}}function cr(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function lr(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function ur(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function fr(t,e){var n=Lt(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?ar:or:typeof e=="function"?n.local?ur:lr:n.local?cr:sr)(n,e))}function Oe(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function hr(t){return function(){this.style.removeProperty(t)}}function dr(t,e,n){return function(){this.style.setProperty(t,e,n)}}function gr(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function pr(t,e,n){return arguments.length>1?this.each((e==null?hr:typeof e=="function"?gr:dr)(t,e,n??"")):lt(this.node(),t)}function lt(t,e){return t.style.getPropertyValue(e)||Oe(t).getComputedStyle(t,null).getPropertyValue(e)}function mr(t){return function(){delete this[t]}}function yr(t,e){return function(){this[t]=e}}function xr(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function _r(t,e){return arguments.length>1?this.each((e==null?mr:typeof e=="function"?xr:yr)(t,e)):this.node()[t]}function Be(t){return t.trim().split(/^|\s+/)}function oe(t){return t.classList||new He(t)}function He(t){this._node=t,this._names=Be(t.getAttribute("class")||"")}He.prototype={add:function(t){var e=this._names.indexOf(t);e<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 Fe(t,e){for(var n=oe(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function We(t,e){for(var n=oe(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function wr(t){return function(){Fe(this,t)}}function vr(t){return function(){We(this,t)}}function br(t,e){return function(){(e.apply(this,arguments)?Fe:We)(this,t)}}function Er(t,e){var n=Be(t+"");if(arguments.length<2){for(var r=oe(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?br:e?wr:vr)(n,e))}function Nr(){this.textContent=""}function $r(t){return function(){this.textContent=t}}function Sr(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function kr(t){return arguments.length?this.each(t==null?Nr:(typeof t=="function"?Sr:$r)(t)):this.node().textContent}function Ar(){this.innerHTML=""}function Tr(t){return function(){this.innerHTML=t}}function Mr(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function Cr(t){return arguments.length?this.each(t==null?Ar:(typeof t=="function"?Mr:Tr)(t)):this.node().innerHTML}function Ir(){this.nextSibling&&this.parentNode.appendChild(this)}function Dr(){return this.each(Ir)}function Pr(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function zr(){return this.each(Pr)}function Yr(t){var e=typeof t=="function"?t:Pe(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Rr(){return null}function Lr(t,e){var n=typeof t=="function"?t:Pe(t),r=e==null?Rr:typeof e=="function"?e:ie(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Or(){var t=this.parentNode;t&&t.removeChild(this)}function Br(){return this.each(Or)}function Hr(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Fr(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Wr(t){return this.select(t?Fr:Hr)}function Gr(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Vr(t){return function(e){t.call(this,e,this.__data__)}}function Xr(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function qr(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,a;n<i;++n)a=e[n],(!t.type||a.type===t.type)&&a.name===t.name?this.removeEventListener(a.type,a.listener,a.options):e[++r]=a;++r?e.length=r:delete this.__on}}}function Ur(t,e,n){return function(){var r=this.__on,i,a=Vr(e);if(r){for(var o=0,c=r.length;o<c;++o)if((i=r[o]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=e;return}}this.addEventListener(t.type,a,n),i={type:t.type,name:t.name,value:e,listener:a,options:n},r?r.push(i):this.__on=[i]}}function Zr(t,e,n){var r=Xr(t+""),i,a=r.length,o;if(arguments.length<2){var c=this.node().__on;if(c){for(var s=0,l=c.length,u;s<l;++s)for(i=0,u=c[s];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(c=e?Ur:qr,i=0;i<a;++i)this.each(c(r[i],e,n));return this}function Ge(t,e,n){var r=Oe(t),i=r.CustomEvent;typeof i=="function"?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 Kr(t,e){return function(){return Ge(this,t,e)}}function Qr(t,e){return function(){return Ge(this,t,e.apply(this,arguments))}}function Jr(t,e){return this.each((typeof e=="function"?Qr:Kr)(t,e))}function*jr(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var Ve=[null];function F(t,e){this._groups=t,this._parents=e}function wt(){return new F([[document.documentElement]],Ve)}function ti(){return this}F.prototype=wt.prototype={constructor:F,select:Sn,selectAll:Mn,selectChild:Pn,selectChildren:Ln,filter:On,data:Vn,enter:Bn,exit:qn,join:Un,merge:Zn,selection:ti,order:Kn,sort:Qn,call:jn,nodes:tr,node:er,size:nr,empty:rr,each:ir,attr:fr,style:pr,property:_r,classed:Er,text:kr,html:Cr,raise:Dr,lower:zr,append:Yr,insert:Lr,remove:Br,clone:Wr,datum:Gr,on:Zr,dispatch:Jr,[Symbol.iterator]:jr};function z(t){return typeof t=="string"?new F([[document.querySelector(t)]],[document.documentElement]):new F([[t]],Ve)}function ei(t){let e;for(;e=t.sourceEvent;)t=e;return t}function nt(t,e){if(t=ei(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}const Xt={capture:!0,passive:!1};function qt(t){t.preventDefault(),t.stopImmediatePropagation()}function ni(t){var e=t.document.documentElement,n=z(t).on("dragstart.drag",qt,Xt);"onselectstart"in e?n.on("selectstart.drag",qt,Xt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function ri(t,e){var n=t.document.documentElement,r=z(t).on("dragstart.drag",null);e&&(r.on("click.drag",qt,Xt),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}function ae(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Xe(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function vt(){}var mt=.7,Dt=1/mt,ct="\\s*([+-]?\\d+)\\s*",yt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",q="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ii=/^#([0-9a-f]{3,8})$/,oi=new RegExp(`^rgb\\(${ct},${ct},${ct}\\)$`),ai=new RegExp(`^rgb\\(${q},${q},${q}\\)$`),si=new RegExp(`^rgba\\(${ct},${ct},${ct},${yt}\\)$`),ci=new RegExp(`^rgba\\(${q},${q},${q},${yt}\\)$`),li=new RegExp(`^hsl\\(${yt},${q},${q}\\)$`),ui=new RegExp(`^hsla\\(${yt},${q},${q},${yt}\\)$`),ge={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};ae(vt,xt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:pe,formatHex:pe,formatHex8:fi,formatHsl:hi,formatRgb:me,toString:me});function pe(){return this.rgb().formatHex()}function fi(){return this.rgb().formatHex8()}function hi(){return qe(this).formatHsl()}function me(){return this.rgb().formatRgb()}function xt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ii.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?ye(e):n===3?new B(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Et(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Et(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=oi.exec(t))?new B(e[1],e[2],e[3],1):(e=ai.exec(t))?new B(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=si.exec(t))?Et(e[1],e[2],e[3],e[4]):(e=ci.exec(t))?Et(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=li.exec(t))?we(e[1],e[2]/100,e[3]/100,1):(e=ui.exec(t))?we(e[1],e[2]/100,e[3]/100,e[4]):ge.hasOwnProperty(t)?ye(ge[t]):t==="transparent"?new B(NaN,NaN,NaN,0):null}function ye(t){return new B(t>>16&255,t>>8&255,t&255,1)}function Et(t,e,n,r){return r<=0&&(t=e=n=NaN),new B(t,e,n,r)}function di(t){return t instanceof vt||(t=xt(t)),t?(t=t.rgb(),new B(t.r,t.g,t.b,t.opacity)):new B}function Ut(t,e,n,r){return arguments.length===1?di(t):new B(t,e,n,r??1)}function B(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}ae(B,Ut,Xe(vt,{brighter(t){return t=t==null?Dt:Math.pow(Dt,t),new B(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?mt:Math.pow(mt,t),new B(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new B(ot(this.r),ot(this.g),ot(this.b),Pt(this.opacity))},displayable(){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,formatHex8:gi,formatRgb:_e,toString:_e}));function xe(){return`#${it(this.r)}${it(this.g)}${it(this.b)}`}function gi(){return`#${it(this.r)}${it(this.g)}${it(this.b)}${it((isNaN(this.opacity)?1:this.opacity)*255)}`}function _e(){const t=Pt(this.opacity);return`${t===1?"rgb(":"rgba("}${ot(this.r)}, ${ot(this.g)}, ${ot(this.b)}${t===1?")":`, ${t})`}`}function Pt(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ot(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function it(t){return t=ot(t),(t<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 V(t,e,n,r)}function qe(t){if(t instanceof V)return new V(t.h,t.s,t.l,t.opacity);if(t instanceof vt||(t=xt(t)),!t)return new V;if(t instanceof V)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,c=a-i,s=(a+i)/2;return c?(e===a?o=(n-r)/c+(n<r)*6:n===a?o=(r-e)/c+2:o=(e-n)/c+4,c/=s<.5?a+i:2-a-i,o*=60):c=s>0&&s<1?0:o,new V(o,c,s,t.opacity)}function pi(t,e,n,r){return arguments.length===1?qe(t):new V(t,e,n,r??1)}function V(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}ae(V,pi,Xe(vt,{brighter(t){return t=t==null?Dt:Math.pow(Dt,t),new V(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?mt:Math.pow(mt,t),new V(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,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 B(Ft(t>=240?t-240:t+120,i,r),Ft(t,i,r),Ft(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new V(ve(this.h),Nt(this.s),Nt(this.l),Pt(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Pt(this.opacity);return`${t===1?"hsl(":"hsla("}${ve(this.h)}, ${Nt(this.s)*100}%, ${Nt(this.l)*100}%${t===1?")":`, ${t})`}`}}));function ve(t){return t=(t||0)%360,t<0?t+360:t}function Nt(t){return Math.max(0,Math.min(1,t||0))}function Ft(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Ue=t=>()=>t;function mi(t,e){return function(n){return t+n*e}}function yi(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)}}function xi(t){return(t=+t)==1?Ze:function(e,n){return n-e?yi(e,n,t):Ue(isNaN(e)?n:e)}}function Ze(t,e){var n=e-t;return n?mi(t,n):Ue(isNaN(t)?e:t)}const be=(function t(e){var n=xi(e);function r(i,a){var o=n((i=Ut(i)).r,(a=Ut(a)).r),c=n(i.g,a.g),s=n(i.b,a.b),l=Ze(i.opacity,a.opacity);return function(u){return i.r=o(u),i.g=c(u),i.b=s(u),i.opacity=l(u),i+""}}return r.gamma=t,r})(1);function tt(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var Zt=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Wt=new RegExp(Zt.source,"g");function _i(t){return function(){return t}}function wi(t){return function(e){return t(e)+""}}function vi(t,e){var n=Zt.lastIndex=Wt.lastIndex=0,r,i,a,o=-1,c=[],s=[];for(t=t+"",e=e+"";(r=Zt.exec(t))&&(i=Wt.exec(e));)(a=i.index)>n&&(a=e.slice(n,a),c[o]?c[o]+=a:c[++o]=a),(r=r[0])===(i=i[0])?c[o]?c[o]+=i:c[++o]=i:(c[++o]=null,s.push({i:o,x:tt(r,i)})),n=Wt.lastIndex;return n<e.length&&(a=e.slice(n),c[o]?c[o]+=a:c[++o]=a),c.length<2?s[0]?wi(s[0].x):_i(e):(e=s.length,function(l){for(var u=0,f;u<e;++u)c[(f=s[u]).i]=f.x(l);return c.join("")})}var Ee=180/Math.PI,Kt={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ke(t,e,n,r,i,a){var o,c,s;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(s=t*n+e*r)&&(n-=t*s,r-=e*s),(c=Math.sqrt(n*n+r*r))&&(n/=c,r/=c,s/=c),t*r<e*n&&(t=-t,e=-e,s=-s,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(e,t)*Ee,skewX:Math.atan(s)*Ee,scaleX:o,scaleY:c}}var $t;function bi(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?Kt:Ke(e.a,e.b,e.c,e.d,e.e,e.f)}function Ei(t){return t==null||($t||($t=document.createElementNS("http://www.w3.org/2000/svg","g")),$t.setAttribute("transform",t),!(t=$t.transform.baseVal.consolidate()))?Kt:(t=t.matrix,Ke(t.a,t.b,t.c,t.d,t.e,t.f))}function Qe(t,e,n,r){function i(l){return l.length?l.pop()+" ":""}function a(l,u,f,h,g,m){if(l!==f||u!==h){var x=g.push("translate(",null,e,null,n);m.push({i:x-4,x:tt(l,f)},{i:x-2,x:tt(u,h)})}else(f||h)&&g.push("translate("+f+e+h+n)}function o(l,u,f,h){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),h.push({i:f.push(i(f)+"rotate(",null,r)-2,x:tt(l,u)})):u&&f.push(i(f)+"rotate("+u+r)}function c(l,u,f,h){l!==u?h.push({i:f.push(i(f)+"skewX(",null,r)-2,x:tt(l,u)}):u&&f.push(i(f)+"skewX("+u+r)}function s(l,u,f,h,g,m){if(l!==f||u!==h){var x=g.push(i(g)+"scale(",null,",",null,")");m.push({i:x-4,x:tt(l,f)},{i:x-2,x:tt(u,h)})}else(f!==1||h!==1)&&g.push(i(g)+"scale("+f+","+h+")")}return function(l,u){var f=[],h=[];return l=t(l),u=t(u),a(l.translateX,l.translateY,u.translateX,u.translateY,f,h),o(l.rotate,u.rotate,f,h),c(l.skewX,u.skewX,f,h),s(l.scaleX,l.scaleY,u.scaleX,u.scaleY,f,h),l=u=null,function(g){for(var m=-1,x=h.length,y;++m<x;)f[(y=h[m]).i]=y.x(g);return f.join("")}}}var Ni=Qe(bi,"px, ","px)","deg)"),$i=Qe(Ei,", ",")",")"),Si=1e-12;function Ne(t){return((t=Math.exp(t))+1/t)/2}function ki(t){return((t=Math.exp(t))-1/t)/2}function Ai(t){return((t=Math.exp(2*t))-1)/(t+1)}const Ti=(function t(e,n,r){function i(a,o){var c=a[0],s=a[1],l=a[2],u=o[0],f=o[1],h=o[2],g=u-c,m=f-s,x=g*g+m*m,y,p;if(x<Si)p=Math.log(h/l)/e,y=function(A){return[c+A*g,s+A*m,l*Math.exp(e*A*p)]};else{var w=Math.sqrt(x),b=(h*h-l*l+r*x)/(2*l*n*w),E=(h*h-l*l-r*x)/(2*h*n*w),S=Math.log(Math.sqrt(b*b+1)-b),N=Math.log(Math.sqrt(E*E+1)-E);p=(N-S)/e,y=function(A){var D=A*p,P=Ne(S),C=l/(n*w)*(P*Ai(e*D+S)-ki(S));return[c+C*g,s+C*m,l*P/Ne(e*D+S)]}}return y.duration=p*1e3*e/Math.SQRT2,y}return i.rho=function(a){var o=Math.max(.001,+a),c=o*o,s=c*c;return t(o,c,s)},i})(Math.SQRT2,2,4);var ut=0,dt=0,ft=0,Je=1e3,zt,gt,Yt=0,at=0,Ot=0,_t=typeof performance=="object"&&performance.now?performance:Date,je=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function se(){return at||(je(Mi),at=_t.now()+Ot)}function Mi(){at=0}function Rt(){this._call=this._time=this._next=null}Rt.prototype=tn.prototype={constructor:Rt,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?se():+n)+(e==null?0:+e),!this._next&>!==this&&(gt?gt._next=this:zt=this,gt=this),this._call=t,this._time=n,Qt()},stop:function(){this._call&&(this._call=null,this._time=1/0,Qt())}};function tn(t,e,n){var r=new Rt;return r.restart(t,e,n),r}function Ci(){se(),++ut;for(var t=zt,e;t;)(e=at-t._time)>=0&&t._call.call(void 0,e),t=t._next;--ut}function $e(){at=(Yt=_t.now())+Ot,ut=dt=0;try{Ci()}finally{ut=0,Di(),at=0}}function Ii(){var t=_t.now(),e=t-Yt;e>Je&&(Ot-=e,Yt=t)}function Di(){for(var t,e=zt,n,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:zt=n);gt=t,Qt(r)}function Qt(t){if(!ut){dt&&(dt=clearTimeout(dt));var e=t-at;e>24?(t<1/0&&(dt=setTimeout($e,t-_t.now()-Ot)),ft&&(ft=clearInterval(ft))):(ft||(Yt=_t.now(),ft=setInterval(Ii,Je)),ut=1,je($e))}}function Se(t,e,n){var r=new Rt;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}var Pi=re("start","end","cancel","interrupt"),zi=[],en=0,ke=1,Jt=2,At=3,Ae=4,jt=5,Tt=6;function Bt(t,e,n,r,i,a){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;Yi(t,n,{name:e,index:r,group:i,on:Pi,tween:zi,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:en})}function ce(t,e){var n=X(t,e);if(n.state>en)throw new Error("too late; already scheduled");return n}function U(t,e){var n=X(t,e);if(n.state>At)throw new Error("too late; already running");return n}function X(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Yi(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=tn(a,0,n.time);function a(l){n.state=ke,n.timer.restart(o,n.delay,n.time),n.delay<=l&&o(l-n.delay)}function o(l){var u,f,h,g;if(n.state!==ke)return s();for(u in r)if(g=r[u],g.name===n.name){if(g.state===At)return Se(o);g.state===Ae?(g.state=Tt,g.timer.stop(),g.on.call("interrupt",t,t.__data__,g.index,g.group),delete r[u]):+u<e&&(g.state=Tt,g.timer.stop(),g.on.call("cancel",t,t.__data__,g.index,g.group),delete r[u])}if(Se(function(){n.state===At&&(n.state=Ae,n.timer.restart(c,n.delay,n.time),c(l))}),n.state=Jt,n.on.call("start",t,t.__data__,n.index,n.group),n.state===Jt){for(n.state=At,i=new Array(h=n.tween.length),u=0,f=-1;u<h;++u)(g=n.tween[u].value.call(t,t.__data__,n.index,n.group))&&(i[++f]=g);i.length=f+1}}function c(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(s),n.state=jt,1),f=-1,h=i.length;++f<h;)i[f].call(t,u);n.state===jt&&(n.on.call("end",t,t.__data__,n.index,n.group),s())}function s(){n.state=Tt,n.timer.stop(),delete r[e];for(var l in r)return;delete t.__transition}}function Mt(t,e){var n=t.__transition,r,i,a=!0,o;if(n){e=e==null?null:e+"";for(o in n){if((r=n[o]).name!==e){a=!1;continue}i=r.state>Jt&&r.state<jt,r.state=Tt,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[o]}a&&delete t.__transition}}function Ri(t){return this.each(function(){Mt(this,t)})}function Li(t,e){var n,r;return function(){var i=U(this,t),a=i.tween;if(a!==n){r=n=a;for(var o=0,c=r.length;o<c;++o)if(r[o].name===e){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Oi(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var a=U(this,t),o=a.tween;if(o!==r){i=(r=o).slice();for(var c={name:e,value:n},s=0,l=i.length;s<l;++s)if(i[s].name===e){i[s]=c;break}s===l&&i.push(c)}a.tween=i}}function Bi(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=X(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((e==null?Li:Oi)(n,t,e))}function le(t,e,n){var r=t._id;return t.each(function(){var i=U(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return X(i,r).value[e]}}function nn(t,e){var n;return(typeof e=="number"?tt:e instanceof xt?be:(n=xt(e))?(e=n,be):vi)(t,e)}function Hi(t){return function(){this.removeAttribute(t)}}function Fi(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Wi(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttribute(t);return o===i?null:o===r?a:a=e(r=o,n)}}function Gi(t,e,n){var r,i=n+"",a;return function(){var o=this.getAttributeNS(t.space,t.local);return o===i?null:o===r?a:a=e(r=o,n)}}function Vi(t,e,n){var r,i,a;return function(){var o,c=n(this),s;return c==null?void this.removeAttribute(t):(o=this.getAttribute(t),s=c+"",o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,c)))}}function Xi(t,e,n){var r,i,a;return function(){var o,c=n(this),s;return c==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),s=c+"",o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,c)))}}function qi(t,e){var n=Lt(t),r=n==="transform"?$i:nn;return this.attrTween(t,typeof e=="function"?(n.local?Xi:Vi)(n,r,le(this,"attr."+t,e)):e==null?(n.local?Fi:Hi)(n):(n.local?Gi:Wi)(n,r,e))}function Ui(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function Zi(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function Ki(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&Zi(t,a)),n}return i._value=e,i}function Qi(t,e){var n,r;function i(){var a=e.apply(this,arguments);return a!==r&&(n=(r=a)&&Ui(t,a)),n}return i._value=e,i}function Ji(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=Lt(t);return this.tween(n,(r.local?Ki:Qi)(r,e))}function ji(t,e){return function(){ce(this,t).delay=+e.apply(this,arguments)}}function to(t,e){return e=+e,function(){ce(this,t).delay=e}}function eo(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?ji:to)(e,t)):X(this.node(),e).delay}function no(t,e){return function(){U(this,t).duration=+e.apply(this,arguments)}}function ro(t,e){return e=+e,function(){U(this,t).duration=e}}function io(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?no:ro)(e,t)):X(this.node(),e).duration}function oo(t,e){if(typeof e!="function")throw new Error;return function(){U(this,t).ease=e}}function ao(t){var e=this._id;return arguments.length?this.each(oo(e,t)):X(this.node(),e).ease}function so(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;U(this,t).ease=n}}function co(t){if(typeof t!="function")throw new Error;return this.each(so(this._id,t))}function lo(t){typeof t!="function"&&(t=Ye(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var a=e[i],o=a.length,c=r[i]=[],s,l=0;l<o;++l)(s=a[l])&&t.call(s,s.__data__,l,a)&&c.push(s);return new j(r,this._parents,this._name,this._id)}function uo(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,a=Math.min(r,i),o=new Array(r),c=0;c<a;++c)for(var s=e[c],l=n[c],u=s.length,f=o[c]=new Array(u),h,g=0;g<u;++g)(h=s[g]||l[g])&&(f[g]=h);for(;c<r;++c)o[c]=e[c];return new j(o,this._parents,this._name,this._id)}function fo(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function ho(t,e,n){var r,i,a=fo(e)?ce:U;return function(){var o=a(this,t),c=o.on;c!==r&&(i=(r=c).copy()).on(e,n),o.on=i}}function go(t,e){var n=this._id;return arguments.length<2?X(this.node(),n).on.on(t):this.each(ho(n,t,e))}function po(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function mo(){return this.on("end.remove",po(this._id))}function yo(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ie(t));for(var r=this._groups,i=r.length,a=new Array(i),o=0;o<i;++o)for(var c=r[o],s=c.length,l=a[o]=new Array(s),u,f,h=0;h<s;++h)(u=c[h])&&(f=t.call(u,u.__data__,h,c))&&("__data__"in u&&(f.__data__=u.__data__),l[h]=f,Bt(l[h],e,n,h,l,X(u,n)));return new j(a,this._parents,e,n)}function xo(t){var e=this._name,n=this._id;typeof t!="function"&&(t=ze(t));for(var r=this._groups,i=r.length,a=[],o=[],c=0;c<i;++c)for(var s=r[c],l=s.length,u,f=0;f<l;++f)if(u=s[f]){for(var h=t.call(u,u.__data__,f,s),g,m=X(u,n),x=0,y=h.length;x<y;++x)(g=h[x])&&Bt(g,e,n,x,h,m);a.push(h),o.push(u)}return new j(a,o,e,n)}var _o=wt.prototype.constructor;function wo(){return new _o(this._groups,this._parents)}function vo(t,e){var n,r,i;return function(){var a=lt(this,t),o=(this.style.removeProperty(t),lt(this,t));return a===o?null:a===n&&o===r?i:i=e(n=a,r=o)}}function rn(t){return function(){this.style.removeProperty(t)}}function bo(t,e,n){var r,i=n+"",a;return function(){var o=lt(this,t);return o===i?null:o===r?a:a=e(r=o,n)}}function Eo(t,e,n){var r,i,a;return function(){var o=lt(this,t),c=n(this),s=c+"";return c==null&&(s=c=(this.style.removeProperty(t),lt(this,t))),o===s?null:o===r&&s===i?a:(i=s,a=e(r=o,c))}}function No(t,e){var n,r,i,a="style."+e,o="end."+a,c;return function(){var s=U(this,t),l=s.on,u=s.value[a]==null?c||(c=rn(e)):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),s.on=r}}function $o(t,e,n){var r=(t+="")=="transform"?Ni:nn;return e==null?this.styleTween(t,vo(t,r)).on("end.style."+t,rn(t)):typeof e=="function"?this.styleTween(t,Eo(t,r,le(this,"style."+t,e))).each(No(this._id,t)):this.styleTween(t,bo(t,r,e),n).on("end.style."+t,null)}function So(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function ko(t,e,n){var r,i;function a(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&So(t,o,n)),r}return a._value=e,a}function Ao(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,ko(t,e,n??""))}function To(t){return function(){this.textContent=t}}function Mo(t){return function(){var e=t(this);this.textContent=e??""}}function Co(t){return this.tween("text",typeof t=="function"?Mo(le(this,"text",t)):To(t==null?"":t+""))}function Io(t){return function(e){this.textContent=t.call(this,e)}}function Do(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Io(i)),e}return r._value=t,r}function Po(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,Do(t))}function zo(){for(var t=this._name,e=this._id,n=on(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],c=o.length,s,l=0;l<c;++l)if(s=o[l]){var u=X(s,e);Bt(s,t,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new j(r,this._parents,t,n)}function Yo(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var c={value:o},s={value:function(){--i===0&&a()}};n.each(function(){var l=U(this,r),u=l.on;u!==t&&(e=(t=u).copy(),e._.cancel.push(c),e._.interrupt.push(c),e._.end.push(s)),l.on=e}),i===0&&a()})}var Ro=0;function j(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function on(){return++Ro}var Q=wt.prototype;j.prototype={constructor:j,select:yo,selectAll:xo,selectChild:Q.selectChild,selectChildren:Q.selectChildren,filter:lo,merge:uo,selection:wo,transition:zo,call:Q.call,nodes:Q.nodes,node:Q.node,size:Q.size,empty:Q.empty,each:Q.each,on:go,attr:qi,attrTween:Ji,style:$o,styleTween:Ao,text:Co,textTween:Po,remove:mo,tween:Bi,delay:eo,duration:io,ease:ao,easeVarying:co,end:Yo,[Symbol.iterator]:Q[Symbol.iterator]};function Lo(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Oo={time:null,delay:0,duration:250,ease:Lo};function Bo(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function Ho(t){var e,n;t instanceof j?(e=t._id,t=t._name):(e=on(),(n=Oo).time=se(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],c=o.length,s,l=0;l<c;++l)(s=o[l])&&Bt(s,t,e,l,o,n||Bo(s,e));return new j(r,this._parents,t,e)}wt.prototype.interrupt=Ri;wt.prototype.transition=Ho;const St=t=>()=>t;function Fo(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function J(t,e,n){this.k=t,this.x=e,this.y=n}J.prototype={constructor:J,scale:function(t){return t===1?this:new J(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new J(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 bt=new J(1,0,0);an.prototype=J.prototype;function an(t){for(;!t.__zoom;)if(!(t=t.parentNode))return bt;return t.__zoom}function Gt(t){t.stopImmediatePropagation()}function ht(t){t.preventDefault(),t.stopImmediatePropagation()}function Wo(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Go(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.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 Te(){return this.__zoom||bt}function Vo(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Xo(){return navigator.maxTouchPoints||"ontouchstart"in this}function qo(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],a=t.invertY(e[0][1])-n[0][1],o=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function sn(){var t=Wo,e=Go,n=qo,r=Vo,i=Xo,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],c=250,s=Ti,l=re("start","zoom","end"),u,f,h,g=500,m=150,x=0,y=10;function p(d){d.property("__zoom",Te).on("wheel.zoom",D,{passive:!1}).on("mousedown.zoom",P).on("dblclick.zoom",C).filter(i).on("touchstart.zoom",R).on("touchmove.zoom",O).on("touchend.zoom touchcancel.zoom",st).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(d,v,_,$){var k=d.selection?d.selection():d;k.property("__zoom",Te),d!==k?S(d,v,_,$):k.interrupt().each(function(){N(this,arguments).event($).start().zoom(null,typeof v=="function"?v.apply(this,arguments):v).end()})},p.scaleBy=function(d,v,_,$){p.scaleTo(d,function(){var k=this.__zoom.k,M=typeof v=="function"?v.apply(this,arguments):v;return k*M},_,$)},p.scaleTo=function(d,v,_,$){p.transform(d,function(){var k=e.apply(this,arguments),M=this.__zoom,I=_==null?E(k):typeof _=="function"?_.apply(this,arguments):_,T=M.invert(I),Y=typeof v=="function"?v.apply(this,arguments):v;return n(b(w(M,Y),I,T),k,o)},_,$)},p.translateBy=function(d,v,_,$){p.transform(d,function(){return n(this.__zoom.translate(typeof v=="function"?v.apply(this,arguments):v,typeof _=="function"?_.apply(this,arguments):_),e.apply(this,arguments),o)},null,$)},p.translateTo=function(d,v,_,$,k){p.transform(d,function(){var M=e.apply(this,arguments),I=this.__zoom,T=$==null?E(M):typeof $=="function"?$.apply(this,arguments):$;return n(bt.translate(T[0],T[1]).scale(I.k).translate(typeof v=="function"?-v.apply(this,arguments):-v,typeof _=="function"?-_.apply(this,arguments):-_),M,o)},$,k)};function w(d,v){return v=Math.max(a[0],Math.min(a[1],v)),v===d.k?d:new J(v,d.x,d.y)}function b(d,v,_){var $=v[0]-_[0]*d.k,k=v[1]-_[1]*d.k;return $===d.x&&k===d.y?d:new J(d.k,$,k)}function E(d){return[(+d[0][0]+ +d[1][0])/2,(+d[0][1]+ +d[1][1])/2]}function S(d,v,_,$){d.on("start.zoom",function(){N(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event($).end()}).tween("zoom",function(){var k=this,M=arguments,I=N(k,M).event($),T=e.apply(k,M),Y=_==null?E(T):typeof _=="function"?_.apply(k,M):_,H=Math.max(T[1][0]-T[0][0],T[1][1]-T[0][1]),L=k.__zoom,W=typeof v=="function"?v.apply(k,M):v,Z=s(L.invert(Y).concat(H/L.k),W.invert(Y).concat(H/W.k));return function(G){if(G===1)G=W;else{var K=Z(G),Ht=H/K[2];G=new J(Ht,Y[0]-K[0]*Ht,Y[1]-K[1]*Ht)}I.zoom(null,G)}})}function N(d,v,_){return!_&&d.__zooming||new A(d,v)}function A(d,v){this.that=d,this.args=v,this.active=0,this.sourceEvent=null,this.extent=e.apply(d,v),this.taps=0}A.prototype={event:function(d){return d&&(this.sourceEvent=d),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(d,v){return this.mouse&&d!=="mouse"&&(this.mouse[1]=v.invert(this.mouse[0])),this.touch0&&d!=="touch"&&(this.touch0[1]=v.invert(this.touch0[0])),this.touch1&&d!=="touch"&&(this.touch1[1]=v.invert(this.touch1[0])),this.that.__zoom=v,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(d){var v=z(this.that).datum();l.call(d,this.that,new Fo(d,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:l}),v)}};function D(d,...v){if(!t.apply(this,arguments))return;var _=N(this,v).event(d),$=this.__zoom,k=Math.max(a[0],Math.min(a[1],$.k*Math.pow(2,r.apply(this,arguments)))),M=nt(d);if(_.wheel)(_.mouse[0][0]!==M[0]||_.mouse[0][1]!==M[1])&&(_.mouse[1]=$.invert(_.mouse[0]=M)),clearTimeout(_.wheel);else{if($.k===k)return;_.mouse=[M,$.invert(M)],Mt(this),_.start()}ht(d),_.wheel=setTimeout(I,m),_.zoom("mouse",n(b(w($,k),_.mouse[0],_.mouse[1]),_.extent,o));function I(){_.wheel=null,_.end()}}function P(d,...v){if(h||!t.apply(this,arguments))return;var _=d.currentTarget,$=N(this,v,!0).event(d),k=z(d.view).on("mousemove.zoom",Y,!0).on("mouseup.zoom",H,!0),M=nt(d,_),I=d.clientX,T=d.clientY;ni(d.view),Gt(d),$.mouse=[M,this.__zoom.invert(M)],Mt(this),$.start();function Y(L){if(ht(L),!$.moved){var W=L.clientX-I,Z=L.clientY-T;$.moved=W*W+Z*Z>x}$.event(L).zoom("mouse",n(b($.that.__zoom,$.mouse[0]=nt(L,_),$.mouse[1]),$.extent,o))}function H(L){k.on("mousemove.zoom mouseup.zoom",null),ri(L.view,$.moved),ht(L),$.event(L).end()}}function C(d,...v){if(t.apply(this,arguments)){var _=this.__zoom,$=nt(d.changedTouches?d.changedTouches[0]:d,this),k=_.invert($),M=_.k*(d.shiftKey?.5:2),I=n(b(w(_,M),$,k),e.apply(this,v),o);ht(d),c>0?z(this).transition().duration(c).call(S,I,$,d):z(this).call(p.transform,I,$,d)}}function R(d,...v){if(t.apply(this,arguments)){var _=d.touches,$=_.length,k=N(this,v,d.changedTouches.length===$).event(d),M,I,T,Y;for(Gt(d),I=0;I<$;++I)T=_[I],Y=nt(T,this),Y=[Y,this.__zoom.invert(Y),T.identifier],k.touch0?!k.touch1&&k.touch0[2]!==Y[2]&&(k.touch1=Y,k.taps=0):(k.touch0=Y,M=!0,k.taps=1+!!u);u&&(u=clearTimeout(u)),M&&(k.taps<2&&(f=Y[0],u=setTimeout(function(){u=null},g)),Mt(this),k.start())}}function O(d,...v){if(this.__zooming){var _=N(this,v).event(d),$=d.changedTouches,k=$.length,M,I,T,Y;for(ht(d),M=0;M<k;++M)I=$[M],T=nt(I,this),_.touch0&&_.touch0[2]===I.identifier?_.touch0[0]=T:_.touch1&&_.touch1[2]===I.identifier&&(_.touch1[0]=T);if(I=_.that.__zoom,_.touch1){var H=_.touch0[0],L=_.touch0[1],W=_.touch1[0],Z=_.touch1[1],G=(G=W[0]-H[0])*G+(G=W[1]-H[1])*G,K=(K=Z[0]-L[0])*K+(K=Z[1]-L[1])*K;I=w(I,Math.sqrt(G/K)),T=[(H[0]+W[0])/2,(H[1]+W[1])/2],Y=[(L[0]+Z[0])/2,(L[1]+Z[1])/2]}else if(_.touch0)T=_.touch0[0],Y=_.touch0[1];else return;_.zoom("touch",n(b(I,T,Y),_.extent,o))}}function st(d,...v){if(this.__zooming){var _=N(this,v).event(d),$=d.changedTouches,k=$.length,M,I;for(Gt(d),h&&clearTimeout(h),h=setTimeout(function(){h=null},g),M=0;M<k;++M)I=$[M],_.touch0&&_.touch0[2]===I.identifier?delete _.touch0:_.touch1&&_.touch1[2]===I.identifier&&delete _.touch1;if(_.touch1&&!_.touch0&&(_.touch0=_.touch1,delete _.touch1),_.touch0)_.touch0[1]=this.__zoom.invert(_.touch0[0]);else if(_.end(),_.taps===2&&(I=nt(I,this),Math.hypot(f[0]-I[0],f[1]-I[1])<y)){var T=z(this).on("dblclick.zoom");T&&T.apply(this,arguments)}}}return p.wheelDelta=function(d){return arguments.length?(r=typeof d=="function"?d:St(+d),p):r},p.filter=function(d){return arguments.length?(t=typeof d=="function"?d:St(!!d),p):t},p.touchable=function(d){return arguments.length?(i=typeof d=="function"?d:St(!!d),p):i},p.extent=function(d){return arguments.length?(e=typeof d=="function"?d:St([[+d[0][0],+d[0][1]],[+d[1][0],+d[1][1]]]),p):e},p.scaleExtent=function(d){return arguments.length?(a[0]=+d[0],a[1]=+d[1],p):[a[0],a[1]]},p.translateExtent=function(d){return arguments.length?(o[0][0]=+d[0][0],o[1][0]=+d[1][0],o[0][1]=+d[0][1],o[1][1]=+d[1][1],p):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},p.constrain=function(d){return arguments.length?(n=d,p):n},p.duration=function(d){return arguments.length?(c=+d,p):c},p.interpolate=function(d){return arguments.length?(s=d,p):s},p.on=function(){var d=l.on.apply(l,arguments);return d===l?p:d},p.clickDistance=function(d){return arguments.length?(x=(d=+d)*d,p):Math.sqrt(x)},p.tapDistance=function(d){return arguments.length?(y=+d,p):y},p}const et=72,cn=240,ln=64,un=50,Uo=80,Zo=20,Ko=20,te=.9,Qo=16,Jo=32,jo=3,fn=800,hn=[0,0,1e3,800],ue=40;class dn{constructor(e,n,r,i,a){this.type=e,this._gvid=n,this.name=r,this._draw_=i,this._ldraw_=a}}class gn extends dn{constructor({_gvid:e,name:n,_draw_:r,_ldraw_:i,bb:a,pos:o,width:c,height:s,label:l}){super("node",e,n,r,i),this.virtualNode=!1,this.bb=a,this.pos=o,this.width=c,this.height=s,this.label=l}getPosition(){if(!this.pos)return null;const[e,n]=this.pos.split(",").map(Number);return[e,n]}getWidthPoints(){return parseFloat(this.width||"1")*et}getHeightPoints(){return parseFloat(this.height||"0.5")*et}getBounds(){const e=this.getPosition();if(!e)return null;const[n,r]=e,i=this.getWidthPoints(),a=this.getHeightPoints();return{x:n-i/2,y:r-a/2,width:i,height:a}}leftIn(){const e=this.getBounds();return e?{x:e.x,y:Math.trunc(e.y+e.height/4)}:null}leftOut(){const e=this.getBounds();return e?{x:e.x,y:Math.trunc(e.y+e.height/4*3)}:null}rightOut(){const e=this.getBounds();return e?{x:e.x+e.width,y:Math.trunc(e.y+e.height/4)}:null}rightIn(){const e=this.getBounds();return e?{x:e.x+e.width,y:Math.trunc(e.y+e.height/4*3)}:null}}class ta extends dn{constructor({_gvid:e,name:n,_draw_:r,_ldraw_:i,_hdraw_:a,_tdraw_:o,head:c,tail:s,label:l}){if(super("edge",e,n,r,i),this.isBaseEdge=!1,this.depth=0,this.baseOffset=0,this.midY=0,this._hdraw_=a,this._tdraw_=o,this.head=c,this.tail=s,this.label=l,l)try{this.edgeContent=pt(l),this.edgeIndex=this.edgeContent.index,this.edgeColor=this.edgeContent.color}catch(u){/^\s*</.test(l)||console.warn(`Failed to decode edge label for ${n}:`,u)}}setNodes(e,n){this.sourceNode=e,this.targetNode=n}getDirection(){if(!this.sourceNode||!this.targetNode)return null;const e=this.sourceNode.getPosition(),n=this.targetNode.getPosition();return!e||!n?null:this.sourceNode._gvid===this.targetNode._gvid?"self":e[0]<n[0]?"right":"left"}getStartPoint(){if(!this.sourceNode)return null;const e=this.getDirection();if(!e)return null;switch(e){case"right":return this.sourceNode.rightOut();case"left":return this.sourceNode.leftOut();case"self":return this.sourceNode.leftOut()}}getEndPoint(){if(!this.targetNode)return null;const e=this.getDirection();if(!e)return null;switch(e){case"right":return this.targetNode.leftIn();case"left":return this.targetNode.rightIn();case"self":return this.targetNode.rightIn()}}getLabelText(){var e;if((e=this.edgeContent)!=null&&e.elems&&this.edgeContent.elems.length>0)return this.edgeContent.elems.map(n=>n.text).join(" ");if(this.label)return this.label.replace(/<[^>]*>/g," ").replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/ /g," ").replace(/\s+/g," ").trim()||null;if(this._ldraw_){const n=[];if(this._ldraw_.forEach(r=>{r.op==="T"&&r.text&&n.push(r.text)}),n.length>0)return n.join(" ")}return null}getColor(){const e="#9AA4B2";if(this.edgeColor)return this.edgeColor;if(this._draw_){for(const n of this._draw_)if(n.op==="c"&&n.color)return n.color}if(this._hdraw_){for(const n of this._hdraw_)if(n.op==="c"&&n.color)return n.color}return e}}class pn{constructor(e,n=0){this.index=e,this.aboveY=n,this.belowY=n}allocateAbove(e){return this.aboveY-=e,this.aboveY}allocateBelow(e){const n=this.belowY;return this.belowY+=e,n}getRange(){return{above:this.aboveY,below:this.belowY}}}class ea extends pn{constructor(e,n=0){super(e,n),this.nodes=[]}addNode(e,n=!0){if(this.nodes.push(e),!n)return;const r=e.getPosition();if(r){const i=e.height?parseFloat(e.height)*et:ue,a=r[1]-i/2,o=r[1]+i/2;this.aboveY=Math.min(this.aboveY,a),this.belowY=Math.max(this.belowY,o)}}}class na extends pn{constructor(e,n,r=0){super(Math.min(e,n),r),this.edges=[],this.baseEdgeIndex=-1,this.sourceColIndex=e,this.targetColIndex=n}addEdge(e){this.edges.push(e)}setBaseEdge(e,n){this.baseEdge=e,this.baseEdgeIndex=n??this.edges.indexOf(e)}getKey(){const e=Math.min(this.sourceColIndex,this.targetColIndex),n=Math.max(this.sourceColIndex,this.targetColIndex);return`${e}-${n}`}}const ra=.6,ia=/mono|fira|consolas|courier|menlo|roboto mono|ui-monospace/i,Me={i:.27,l:.27,j:.27,I:.29,".":.28,",":.28,":":.28,";":.28,"'":.2,"|":.26,"!":.3,f:.32,t:.34,r:.38,"(":.34,")":.34,"[":.34,"]":.34," ":.28},Ce={m:.85,w:.74,M:.83,W:.86,"@":.92};function oa(t){if(t in Me)return Me[t];if(t in Ce)return Ce[t];const e=t.charCodeAt(0);return e>=48&&e<=57?.57:e>=65&&e<=90?.66:e>=97&&e<=122?.53:e>=33&&e<=126?.5:e>11904?1:.55}function aa(t){return!!t&&ia.test(t)}function sa(t,e,n){if(!t)return 0;if(aa(e))return t.length*n*ra;let r=0;for(const i of t)r+=oa(i);return r*n}function ee(t,e,n){const r=t.attr("font-family")||void 0,i=parseFloat(t.attr("font-size")||"12")||12,a=l=>sa(l,r,i);if(t.text(n),a(n)<=e)return;const o="...";let c=0,s=n.length;for(;c<s;){const l=Math.floor((c+s+1)/2);a(n.slice(0,l)+o)<=e?c=l:s=l-1}c>0?t.text(n.slice(0,c)+o):t.text(o)}function ca(t){if(!t)return[];const e=[],n=/<TD[^>]*>(.*?)<\/TD>/gi;let r;for(;(r=n.exec(t))!==null;){let i=r[1];i=i.replace(/<[^>]+>/g,"").trim(),i&&e.push(i)}if(e.length===0){const i=t.replace(/<[^>]+>/g,"").trim();i&&e.push(i)}return e}function la(t){var a;if(!t||!/<TABLE/i.test(t))return null;const e=/<B>([\s\S]*?)<\/B>/i.exec(t),n=e?e[1].replace(/<[^>]+>/g,"").trim():"",r=t.replace(/<[^>]+>/g," "),i=((a=/0x[0-9a-fA-F]{8,}/.exec(r))==null?void 0:a[0])??"";return!n&&!i?null:{tags:[],label:n,text:i}}function mn(t,e){const n=/^\[(\d+)\]$/.exec(t);return n?`[${n[1]}/${e}]`:t}function ua(t,e){return!t||t.length===0?t:t.map((n,r)=>r===0?{...n,text:mn(n.text,e)}:n)}function yn(t,e,n){var l;const r=ua((l=t.edgeContent)==null?void 0:l.elems,n);let i="";r&&r.length>0&&(i=r.map(u=>u.text).join(" ")),i||(i=ca(t.label??"").map((f,h)=>h===0?mn(f,n):f).map(f=>f.length>20?f.slice(0,20)+"...":f).join(" "));const a=i.length>60?i.slice(0,60)+"...":i,o=e.labelFontSize,c=o*.6,s=e.labelPadding;return{displayElems:r,finalText:a,boxWidth:a.length*c+s*2,boxHeight:o+s*2}}const fe={horizontalExtension:50,minEdgeDistance:50,minVerticalSegment:20,loopRadius:40,edgeSpacing:80,cornerRadius:4,arrowWidth:10,arrowHeight:6,labelHeight:15,labelFontSize:10,labelPadding:6,labelCornerRadius:4,nodeSpacing:50,nearlyHorizontalThreshold:5,nearlyAlignedThreshold:30};function xn(t){return{...fe,...t}}function fa(t){if(t.length<2)return t;const e=[t[0]];for(let n=1;n<t.length;n++){const r=e[e.length-1];(Math.abs(t[n].x-r.x)>.1||Math.abs(t[n].y-r.y)>.1)&&e.push(t[n])}return e}function Ie(t,e,n){const{start:r,pathEnd:i,isNearlyHorizontal:a,startExtensionX:o,endExtensionX:c}=n,s=n.minVerticalSegment,l=Math.abs(r.y-e),u=Math.abs(e-i.y);let f=[],h=e;switch(t){case"straight":if(a){const m=(r.y+i.y)/2;Math.abs(e-m)<s?(f=[r,i],h=m):(f=[r,{x:o,y:r.y},{x:o,y:e},{x:c,y:e},{x:c,y:i.y},i],h=e)}else return null;break;case"2seg":l<u?Math.abs(e-r.y)<s?(f=[r,{x:i.x,y:r.y},i],h=r.y):(f=[r,{x:o,y:r.y},{x:o,y:e},{x:c,y:e},{x:c,y:i.y},i],h=e):Math.abs(e-i.y)<s?(f=[r,{x:o,y:r.y},{x:o,y:i.y},i],h=i.y):(f=[r,{x:o,y:r.y},{x:o,y:e},{x:c,y:e},{x:c,y:i.y},i],h=e);break;case"3seg":{const m=e;f=[r,{x:o,y:r.y},{x:o,y:m},{x:c,y:m},{x:c,y:i.y},i],h=m;break}case"4seg":f=[r,{x:o,y:r.y},{x:o,y:e},{x:c,y:e},i],h=e;break;case"5seg":if(l<s)f=[r,{x:o,y:r.y},{x:c,y:e},{x:c,y:i.y},i],h=e;else if(u<s)f=[r,{x:o,y:r.y},{x:o,y:e},{x:c,y:e},i],h=e;else return null;break;case"6seg":f=[r,{x:o,y:r.y},{x:o,y:e},{x:c,y:e},{x:c,y:i.y},i],h=e;break}const g=fa(f);return g.length>0?{points:g,actualMidY:h}:null}function Ct(t,e,n,r=fe){const i=t.getStartPoint(),a=t.getEndPoint(),o=t.getDirection();if(!i||!a||!o||o==="self")return;const c={x:i.x,y:e-i.y},s={x:a.x,y:e-a.y};let l={x:s.x,y:s.y};o==="right"?l={x:s.x-r.arrowWidth,y:s.y}:o==="left"&&(l={x:s.x+r.arrowWidth,y:s.y});const u=r.minEdgeDistance,f=t.baseDirection===void 0;let g=(c.y+l.y)/2;if(!f&&n&&n.midY!==void 0){if(t.baseDirection==="above"){const w=n.midY-u;g>w&&(g=w)}else if(t.baseDirection==="below"){const w=n.midY+u;g<w&&(g=w)}}const m=r.horizontalExtension-r.arrowWidth,x={start:c,pathEnd:l,isNearlyHorizontal:Math.abs(c.y-l.y)<5,startExtensionX:o==="right"?c.x+r.horizontalExtension:c.x-r.horizontalExtension,endExtensionX:o==="right"?l.x-m:l.x+m,minVerticalSegment:r.minVerticalSegment};let y;f?y=x.isNearlyHorizontal?["straight","3seg"]:["3seg"]:y=x.isNearlyHorizontal?["straight","3seg","4seg","5seg","6seg"]:["3seg","4seg","5seg","6seg"];for(const w of y){const b=Ie(w,g,x);if(b)return{midY:b.actualMidY,points:b.points}}const p=Ie("6seg",g,x);return p?{midY:p.actualMidY,points:p.points}:void 0}function De(t,e){if(t.length<2)return"";if(e===0||t.length===2)return`M${t[0].x},${t[0].y} ${t.slice(1).map(i=>`L${i.x},${i.y}`).join(" ")}`;const n=[];n.push(`M${t[0].x},${t[0].y}`);for(let i=1;i<t.length-1;i++){const a=t[i-1],o=t[i],c=t[i+1],s=Math.sqrt((o.x-a.x)**2+(o.y-a.y)**2),l=Math.sqrt((c.x-o.x)**2+(c.y-o.y)**2),u=Math.min(s,l)/2,f=Math.min(e,u);if(f>0){const h=f/s,g=f/l,m={x:o.x-(o.x-a.x)*h,y:o.y-(o.y-a.y)*h},x={x:o.x+(c.x-o.x)*g,y:o.y+(c.y-o.y)*g};n.push(`L${m.x},${m.y}`),n.push(`Q${o.x},${o.y} ${x.x},${x.y}`)}else n.push(`L${o.x},${o.y}`)}const r=t[t.length-1];return n.push(`L${r.x},${r.y}`),n.join(" ")}function ne(t,e,n,r,i){const a=i.topLeft||0,o=i.topRight||0,c=i.bottomRight||0,s=i.bottomLeft||0;return`
|
|
2
|
-
M ${t+a} ${e}
|
|
3
|
-
L ${t+n-o} ${e}
|
|
4
|
-
${o?`Q ${t+n} ${e} ${t+n} ${e+o}`:""}
|
|
5
|
-
L ${t+n} ${e+r-c}
|
|
6
|
-
${c?`Q ${t+n} ${e+r} ${t+n-c} ${e+r}`:""}
|
|
7
|
-
L ${t+s} ${e+r}
|
|
8
|
-
${s?`Q ${t} ${e+r} ${t} ${e+r-s}`:""}
|
|
9
|
-
L ${t} ${e+a}
|
|
10
|
-
${a?`Q ${t} ${e} ${t+a} ${e}`:""}
|
|
11
|
-
Z
|
|
12
|
-
`.trim().replace(/\s+/g," ")}function ha(t,e,n,r,i,a,o){const c=a.loopRadius,s=a.horizontalExtension,l=a.cornerRadius,u=()=>{const g=n.x-c,m=n.y-c,x=r.x+c,y=r.y-c;return`M${n.x},${n.y} C${g},${m} ${x},${y} ${r.x},${r.y}`};if(!o){if(e==="self")return u();const g=r.x-n.x,m=.4,x=n.x+g*m,y=n.y,p=r.x-g*m,w=r.y;return`M${n.x},${n.y} C${x},${y} ${p},${w} ${r.x},${r.y}`}const f=s-a.arrowWidth;if(e==="self"){if(t.virtualNode){const g=t.virtualNode.getPosition();if(g){const m=i-g[1];t.midY=m;const x=[n,{x:n.x-s,y:n.y},{x:n.x-s,y:m},{x:r.x+f,y:m},{x:r.x+f,y:r.y},r];return De(x,l)}return u()}return u()}let h;if(t.orthogonalPathPoints&&t.orthogonalPathPoints.length>0)h=t.orthogonalPathPoints;else{const g=Math.abs(n.y-t.midY),m=Math.abs(t.midY-r.y),x=20,y=g>=x,p=m>=x,w=e==="right"?n.x+s:n.x-s,b=e==="right"?r.x-f:r.x+f;if(h=[],!y&&!p){const E=(n.y+r.y)/2;h.push(n,{x:w,y:E},{x:b,y:E},r)}else y?p?h.push(n,{x:w,y:n.y},{x:w,y:t.midY},{x:b,y:t.midY},{x:b,y:r.y},r):h.push(n,{x:w,y:n.y},{x:w,y:t.midY},{x:b,y:t.midY},r):h.push(n,{x:w,y:t.midY},{x:b,y:t.midY},{x:b,y:r.y},r)}return De(h,l)}function da(t,e,n,r,i){ga(t,r,i),pa(t,e,n,r,i)}function ga(t,e,n){const r=n.loopRadius,i=n.edgeSpacing,a=n.labelHeight;t.forEach(o=>{const c=o.edges;if(c.length===0)return;const s=o.baseEdge,l=o.baseEdgeIndex;if(!s||l<0)return;const u=s.getStartPoint(),f=s.getEndPoint();if(!u||!f)return;const h=e-u.y,g=e-f.y;s.midY=(h+g)/2;const m=Ct(s,e,void 0,n);m&&(s.midY=m.midY,s.orthogonalPathPoints=m.points),o.aboveY=s.midY,o.belowY=s.midY;for(let x=l-1;x>=0;x--){const y=c[x];if(y.depth!==0)continue;if(y.getDirection()==="self"){const S=y.getStartPoint();S&&(y.midY=e-S.y-r);continue}const w=y.label?i+a:i;y.midY=o.aboveY-w,o.aboveY=y.midY,y.baseDirection="above",y.baseOffset=-(l-x);const b=x<c.length-1?c[x+1]:void 0,E=Ct(y,e,b,n);E&&(y.midY=E.midY,y.orthogonalPathPoints=E.points,o.aboveY=y.midY)}for(let x=l+1;x<c.length;x++){const y=c[x];if(y.depth!==0)continue;if(y.getDirection()==="self"){const S=y.getStartPoint();S&&(y.midY=e-S.y-r);continue}const w=y.label?i+a:i;y.midY=o.belowY+w,o.belowY=y.midY,y.baseDirection="below",y.baseOffset=x-l;const b=x>0?c[x-1]:void 0,E=Ct(y,e,b,n);E&&(y.midY=E.midY,y.orthogonalPathPoints=E.points,o.belowY=y.midY)}})}function pa(t,e,n,r,i){const a=i.loopRadius,o=i.edgeSpacing,c=i.labelHeight,s=[];t.forEach(f=>{const h=f.edges;h.length===0||f.baseEdge||!h.every(m=>m.depth>0)||h.forEach(m=>{if(m.getDirection()!=="self")s.push(m);else{const x=m.getStartPoint();x&&(m.midY=r-x.y-a)}})}),s.sort((f,h)=>f.depth-h.depth);let l=1/0,u=-1/0;t.forEach(f=>{f.aboveY!==0&&(l=Math.min(l,f.aboveY)),f.belowY!==0&&(u=Math.max(u,f.belowY))}),e.forEach(f=>{f.aboveY!==0&&(l=Math.min(l,f.aboveY)),f.belowY!==0&&(u=Math.max(u,f.belowY))}),s.forEach(f=>{if(!f.sourceNode||!f.targetNode)return;const h=n.get(f.sourceNode._gvid),g=n.get(f.targetNode._gvid);if(h===void 0||g===void 0)return;const m=Math.min(h,g),x=Math.max(h,g),y=[];for(let C=m;C<=x;C++){const R=e.get(C);R&&y.push(...R.nodes)}const p=y.map(C=>{const R=C.getPosition();if(!R)return null;const O=r-R[1],st=C.height?parseFloat(C.height)*et:ue;return{y:O,height:st,bottomY:O+st/2}}).filter(C=>C!==null).sort((C,R)=>C.y-R.y);let w;if(p.length===0)w=(l+u)/2;else if(p.length%2===1)w=p[Math.floor(p.length/2)].bottomY;else{const C=p.length/2;w=(p[C-1].bottomY+p[C].bottomY)/2}const b=f.getStartPoint(),E=f.getEndPoint(),N=(b&&E?r-(b.y+E.y)/2:w)<w?"above":"below";f.baseDirection=N;const A=f.label?o+c:o;let D;N==="above"?(f.midY=l-A,D=l,l=f.midY):(f.midY=u+A,D=u,u=f.midY);const P=Ct(f,r,{midY:D},i);P&&(f.midY=P.midY,f.orthogonalPathPoints=P.points,N==="above"?l=Math.min(l,P.midY):u=Math.max(u,P.midY))})}function ma(t){if(!t.sourceNode)return null;const e=t.sourceNode.getPosition();if(!e)return null;const n=un/et,r=new gn({_gvid:-1e3-t._gvid,name:`virtual_edge_${t._gvid}`,label:t.label,pos:`${e[0]},${e[1]}`,width:"0.5",height:n.toString()});return r.virtualNode=!0,r.edge=t,t.virtualNode=r,r}function ya(t,e,n){const r=e.nodes,i=r.findIndex(a=>a._gvid===n._gvid);if(i===-1){r.push(t);return}r.splice(i,0,t)}function xa(t,e){const n=Zo,r=[],i=new Map;t.forEach(l=>{const u=l.getPosition();if(!u)return;const f=u[0];let h=r.findIndex(g=>Math.abs(f-g)<=n);h===-1&&(h=r.length,r.push(f)),i.set(l._gvid,h)});const a=r.map((l,u)=>({x:l,i:u})).sort((l,u)=>l.x-u.x).map((l,u)=>({oldIndex:l.i,newIndex:u})),o=new Map;a.forEach(({oldIndex:l,newIndex:u})=>{o.set(l,u)});for(const[l,u]of i)i.set(l,o.get(u)??u);const c=new Map;t.forEach(l=>{const u=i.get(l._gvid);u!==void 0&&(c.has(u)||c.set(u,new ea(u,0)),c.get(u).addNode(l,!1))}),e.forEach(l=>{if(!l.sourceNode||!l.targetNode||l.sourceNode._gvid!==l.targetNode._gvid)return;const u=i.get(l.sourceNode._gvid);if(u===void 0)return;const f=c.get(u);if(!f)return;const h=ma(l);h&&ya(h,f,l.sourceNode)});const s=new Map;return e.forEach(l=>{if(!l.sourceNode||!l.targetNode)return;const u=i.get(l.sourceNode._gvid),f=i.get(l.targetNode._gvid);if(u===void 0||f===void 0)return;l.depth=Math.abs(f-u)-1,l.depth<0&&(l.depth=0);const h=Math.min(u,f),g=Math.max(u,f),m=`${h}-${g}`;s.has(m)||s.set(m,new na(u,f,0)),s.get(m).addEdge(l)}),s.forEach(l=>{l.edges.sort((u,f)=>{const h=u.getStartPoint(),g=u.getEndPoint(),m=h&&g?(h.y+g.y)/2:0,x=f.getStartPoint(),y=f.getEndPoint();return(x&&y?(x.y+y.y)/2:0)-m})}),{nodeColumnMap:i,nodeColumns:c,edgeColumns:s}}function _a(t,e){t.forEach(n=>{if(n.nodes.length===0)return;let r=!0;n.nodes.forEach(i=>{const a=i.getPosition();if(!a)return;const o=i.height?parseFloat(i.height)*et:ue,c=e-a[1],s=c-o/2,l=c+o/2;r?(n.aboveY=s,n.belowY=l,r=!1):(n.aboveY=Math.min(n.aboveY,s),n.belowY=Math.max(n.belowY,l))})})}function wa(t,e){t.length!==0&&e.forEach(n=>{const r=n.edges;if(r.length===0)return;const i=r.filter(f=>f.depth===0);if(i.length===0)return;const a=Math.floor(i.length/2),o=i[a];o.isBaseEdge=!0,o.baseDirection=void 0;const c=r.indexOf(o);n.setBaseEdge(o,c);const s=o.getStartPoint(),l=o.getEndPoint(),u=s&&l?(s.y+l.y)/2:0;i.forEach(f=>{if(f===o)return;const h=f.getStartPoint(),g=f.getEndPoint();(h&&g?(h.y+g.y)/2:0)>u?f.baseDirection="above":f.baseDirection="below"})})}function va(t,e,n){const i=(t.objects||[]).map(s=>new gn({_gvid:s._gvid,name:s.name,_draw_:s._draw_,_ldraw_:s._ldraw_,bb:s.bb,pos:s.pos,width:e!==null?String(e/et):s.width,height:n!==null?String(n/et):s.height,label:s.label})),a=new Map;i.forEach(s=>{a.set(s._gvid,s)});const c=(t.edges||[]).map(s=>{const l=new ta({_gvid:s._gvid,name:s.name,_draw_:s._draw_,_ldraw_:s._ldraw_,_hdraw_:s._hdraw_,_tdraw_:s._tdraw_,head:s.head,tail:s.tail,label:s.label}),u=s.tail!==void 0?a.get(s.tail):void 0,f=s.head!==void 0?a.get(s.head):void 0;return u&&f&&l.setNodes(u,f),l});return{nodes:i,edges:c}}function ba(t,e,n,r){let i=0;t.forEach(o=>{i=Math.max(i,o.getWidthPoints())});let a=0;return e.forEach(o=>{if(o.depth!==0||!o.label||o.getDirection()==="self")return;const{boxWidth:c}=yn(o,n,r);a=Math.max(a,c)}),i+2*n.horizontalExtension+a+2*Ko}function Ea(t,e,n){const r=Array.from(t.keys()).sort((l,u)=>l-u),i=r.length,a=Uo,o=n,s=(i>1?(i-1)*o:0)+2*a;return r.forEach((l,u)=>{const f=t.get(l);if(!f)return;const h=f.nodes;if(h.length===0)return;const g=i>1?a+u*o:s/2;h.sort((N,A)=>{const D=N.getPosition(),P=A.getPosition();return!D||!P?0:P[1]-D[1]});const m=un,x=h.filter(N=>!N.virtualNode),y=x.length;if(y===0){let N=(e+h.reduce((A,D)=>A+D.getHeightPoints(),0))/2;h.forEach(A=>{const D=A.getHeightPoints();N-=D/2,A.pos=`${g},${N}`,N-=D/2});return}let p,w;if(y%2===1){const N=Math.floor(y/2),A=x[N];w=h.indexOf(A),p=e/2}else{const N=y/2-1,A=x[N];w=h.indexOf(A),p=e/2}const b=h[w],E=b.getHeightPoints();b.pos=`${g},${p}`;let S=p+E/2;for(let N=w-1;N>=0;N--){const A=h[N],D=h[N+1],P=A.getHeightPoints(),C=A.virtualNode||D.virtualNode?0:m;S+=C+P/2,A.pos=`${g},${S}`,S+=P/2}S=p-E/2;for(let N=w+1;N<h.length;N++){const A=h[N],D=h[N-1],P=A.getHeightPoints(),C=A.virtualNode||D.virtualNode?0:m;S-=C+P/2,A.pos=`${g},${S}`,S-=P/2}}),s}function Na(t,e,n){t.style("cursor","pointer").on("mouseenter",function(){if(e.attr("opacity",1),n.select(".edge.selected").size()>0)return;const i=z(this).attr("data-node-id"),a=new Set([i]);n.selectAll(".edge").each(function(){const o=z(this).attr("data-source-node-id"),c=z(this).attr("data-target-node-id");o===i||c===i?o===i?a.add(c):a.add(o):z(this).classed("dimmed",!0)}),n.selectAll(".node").each(function(){const o=z(this).attr("data-node-id");a.has(o)||z(this).classed("dimmed",!0)})}).on("mouseleave",function(){e.attr("opacity",0),n.selectAll(".edge.dimmed").classed("dimmed",!1),n.selectAll(".node.dimmed").classed("dimmed",!1)})}function $a(t){const{nodeGroup:e,g:n,x:r,y:i,w:a,h:o,height:c,badges:s,labelText:l,addressText:u,nodeTextColor:f,nodeBackground:h,hasCustomBackground:g}=t,m=o/2,x=o/2,y=c-i-o/2,p=4,w="var(--border-primary, #CDCFD5)";e.append("path").attr("d",ne(r-a/2,y,a,m,{topLeft:p,topRight:p})).attr("fill",g?h:"var(--bg-quaternary, #E1E2E5)").attr("stroke",w).attr("stroke-width",1),g&&e.append("line").attr("x1",r-a/2).attr("y1",y+m).attr("x2",r+a/2).attr("y2",y+m).attr("stroke",f).attr("stroke-width",1),e.append("path").attr("d",ne(r-a/2,y+m,a,x,{bottomLeft:p,bottomRight:p})).attr("fill",g?h:"var(--bg-primary, #fff)").attr("stroke",w).attr("stroke-width",1);const b=e.append("rect").attr("x",r-a/2-4).attr("y",y-4).attr("width",a+8).attr("height",o+8).attr("rx",5).attr("ry",5).attr("fill","none").attr("stroke","var(--gray-700, #43444C)").attr("stroke-width",2).attr("opacity",0).style("pointer-events","none");Na(e,b,n);let E=r-a/2+8;const S=y+m/2,N=7.2,A=6,D=18,P=4;if(s.forEach(C=>{const O=C.length*N+A*2;e.append("rect").attr("x",E).attr("y",S-D/2).attr("width",O).attr("height",D).attr("rx",5).attr("ry",5).attr("fill","var(--bg-warning-primary, #FFF8E1)").attr("stroke","var(--border-warning-light, #FFD66D)").attr("stroke-width",1),e.append("text").attr("x",E+A).attr("y",S).attr("text-anchor","start").attr("dominant-baseline","middle").attr("font-family","var(--font-inter), Inter, Helvetica, Arial").attr("font-size","12px").attr("font-weight","500").attr("fill","var(--text-warning-primary, #CD7004)").text(C),E+=O+P}),l){const C=r+a/2-8-E,R=e.append("text").attr("x",E).attr("y",S).attr("text-anchor","start").attr("dominant-baseline","middle").attr("font-family","var(--font-inter), Inter, Helvetica, Arial").attr("font-size","12px").attr("font-weight","600").attr("fill",f);ee(R,C,l)}if(u){const C=a-16,R=e.append("text").attr("x",r-a/2+8).attr("y",y+m+x/2).attr("text-anchor","start").attr("dominant-baseline","middle").attr("font-family","var(--font-fira-code), Fira Code, monospace").attr("font-size","12px").attr("font-weight","400").attr("fill",f);ee(R,C,u)}}function Sa(t){const{nodeGroup:e,x:n,y:r,w:i,h:a,height:o,isVirtual:c,showVirtualStyle:s,nodeContent:l,labelText:u,addressText:f,nodeTextColor:h,nodeBackground:g,hasCustomBackground:m}=t,x=4,y=s?"#EF4444":"var(--border-primary, #CDCFD5)",p=e.append("path").attr("d",ne(n-i/2,o-r-a/2,i,a,{topLeft:x,topRight:x,bottomLeft:x,bottomRight:x})).attr("fill",m?g:"var(--bg-primary, #fff)").attr("stroke",y).attr("stroke-width",s?2:1);if(!c){const w=e.append("rect").attr("x",n-i/2-4).attr("y",o-r-a/2-4).attr("width",i+8).attr("height",a+8).attr("rx",5).attr("ry",5).attr("fill","none").attr("stroke","#000000").attr("stroke-width",2).attr("opacity",0).style("pointer-events","none");p.style("cursor","pointer").on("mouseenter",function(){w.attr("opacity",1)}).on("mouseleave",function(){w.attr("opacity",0)})}if(l)if(c){const w=u||f;e.append("text").attr("x",n).attr("y",o-r).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","Inter, Helvetica, Arial").attr("font-size","10px").attr("fill","#991B1B").text(w.length>20?w.slice(0,20)+"...":w)}else{const w=f||u,b=i-16,E=e.append("text").attr("x",n-i/2+8).attr("y",o-r).attr("text-anchor","start").attr("dominant-baseline","middle").attr("font-family","var(--font-fira-code), Fira Code, monospace").attr("font-size","12px").attr("font-weight","400").attr("fill",h);ee(E,b,w)}}function ka(t,e,n,r){const i=t.getPosition();if(!i)return;const[a,o]=i,c=t.getWidthPoints(),s=t.getHeightPoints(),l=t.virtualNode;if(l&&!r)return;const u=e.append("g").attr("class",l?"node virtual-node":"node").attr("id",t.name).attr("data-node-id",t.name);let f=null;try{t.label&&(f=pt(t.label))}catch(S){f=la(t.label),f||console.warn(`Failed to decode node label for ${t.name}:`,S)}f!=null&&f.key&&u.attr("data-key",f.key);const h=r&&l,g=(f==null?void 0:f.tags)||[],m=(f==null?void 0:f.label)||"",x=(f==null?void 0:f.text)||"",y=(f==null?void 0:f.color)||"var(--text-primary, #171921)",p=(f==null?void 0:f.background)||"white",w=p!=="white",b=g.length>0||m.length>0,E={nodeGroup:u,g:e,x:a,y:o,w:c,h:s,height:n,isVirtual:l,showVirtualStyle:h,nodeContent:f,badges:g,labelText:m,addressText:x,nodeTextColor:y,nodeBackground:p,hasCustomBackground:w};b&&!l?$a(E):Sa(E),!t.label&&t._ldraw_&&t._ldraw_.length>0&&!l&&t._ldraw_.forEach(S=>{S.op==="T"&&S.text&&u.append("text").attr("x",a-c/2+8).attr("y",n-o).attr("text-anchor","start").attr("dominant-baseline","middle").attr("font-family",S.face||"Inter, Helvetica, Arial").attr("font-size",`${S.size||11}px`).attr("fill",S.color||"#334155").text(S.text)})}function Aa(t,e,n,r){e.forEach(i=>{i.nodes.forEach(a=>{ka(a,t,n,r)})})}const Ta=`
|
|
13
|
-
<style>
|
|
14
|
-
@keyframes selected-pulse {
|
|
15
|
-
0%, 100% {
|
|
16
|
-
stroke-opacity: 1;
|
|
17
|
-
}
|
|
18
|
-
50% {
|
|
19
|
-
stroke-opacity: 0.7;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
.edge {
|
|
23
|
-
cursor: pointer;
|
|
24
|
-
}
|
|
25
|
-
.edge path {
|
|
26
|
-
/* No transition on dash properties to avoid conflict with animation */
|
|
27
|
-
}
|
|
28
|
-
.edge use {
|
|
29
|
-
transition: transform 0.2s ease;
|
|
30
|
-
}
|
|
31
|
-
.edge text {
|
|
32
|
-
transition: font-weight 0.2s ease;
|
|
33
|
-
}
|
|
34
|
-
/* Marching ants animation keyframe */
|
|
35
|
-
@keyframes marching-ants {
|
|
36
|
-
0% { stroke-dashoffset: 0; }
|
|
37
|
-
100% { stroke-dashoffset: -12; }
|
|
38
|
-
}
|
|
39
|
-
/* Arrow group scaling transition (JS handles actual transform) */
|
|
40
|
-
.edge .arrow-group {
|
|
41
|
-
transition: transform 0.15s ease;
|
|
42
|
-
}
|
|
43
|
-
/* Hover effect: marching ants dashed line */
|
|
44
|
-
.edge:hover:not(.selected) path.edge-path {
|
|
45
|
-
stroke-dasharray: 6 6;
|
|
46
|
-
stroke-width: 4px;
|
|
47
|
-
animation: marching-ants 0.6s linear infinite;
|
|
48
|
-
}
|
|
49
|
-
/* Selected effect: marching ants dashed line */
|
|
50
|
-
.edge.selected path.edge-path {
|
|
51
|
-
stroke-dasharray: 6 6;
|
|
52
|
-
stroke-width: 4px;
|
|
53
|
-
animation: marching-ants 0.6s linear infinite;
|
|
54
|
-
}
|
|
55
|
-
/* Dimmed state for edge hover focus effect */
|
|
56
|
-
.edge.dimmed,
|
|
57
|
-
.node.dimmed {
|
|
58
|
-
opacity: 0.3;
|
|
59
|
-
transition: opacity 0.2s ease;
|
|
60
|
-
}
|
|
61
|
-
.edge:not(.dimmed),
|
|
62
|
-
.node:not(.dimmed) {
|
|
63
|
-
transition: opacity 0.2s ease;
|
|
64
|
-
}
|
|
65
|
-
/* Selection-based dimming - unrelated elements when edge is selected */
|
|
66
|
-
.edge.selection-dimmed,
|
|
67
|
-
.node.selection-dimmed {
|
|
68
|
-
opacity: 0.3;
|
|
69
|
-
transition: opacity 0.2s ease;
|
|
70
|
-
}
|
|
71
|
-
/* Hover highlight overrides selection-dimmed to restore visibility */
|
|
72
|
-
.edge.hover-highlight,
|
|
73
|
-
.node.hover-highlight {
|
|
74
|
-
opacity: 1 !important;
|
|
75
|
-
transition: opacity 0.2s ease;
|
|
76
|
-
}
|
|
77
|
-
/* Selected edge should always be at full opacity */
|
|
78
|
-
.edge.selected {
|
|
79
|
-
opacity: 1 !important;
|
|
80
|
-
}
|
|
81
|
-
</style>
|
|
82
|
-
<symbol id="arrow-right" viewBox="0 0 12 12">
|
|
83
|
-
<path d="M11.53 5.46967C11.8229 5.76256 11.8229 6.23744 11.53 6.53033L6.75736 11.303C6.46447 11.5959 5.98959 11.5959 5.6967 11.303C5.40381 11.0101 5.40381 10.5352 5.6967 10.2423L9.93934 6L5.6967 1.75736C5.40381 1.46447 5.40381 0.989593 5.6967 0.696699C5.98959 0.403806 6.46447 0.403806 6.75736 0.696699L11.53 5.46967ZM0 5.25H11V6.75H0V5.25Z"/>
|
|
84
|
-
</symbol>
|
|
85
|
-
`,Ma=`
|
|
86
|
-
<style>
|
|
87
|
-
.node rect, .node ellipse, .node polygon {
|
|
88
|
-
cursor: pointer;
|
|
89
|
-
}
|
|
90
|
-
.edge {
|
|
91
|
-
cursor: pointer;
|
|
92
|
-
}
|
|
93
|
-
</style>
|
|
94
|
-
`;function rt(t,e,n){let r="#000000",i="#000000",a="#000000";e.forEach(o=>{switch(o.op){case"c":o.color&&(r=o.color);break;case"C":o.color&&(i=o.color);break;case"F":o.color&&(a=o.color);break;case"T":o.pt&&o.text&&t.append("text").attr("x",o.pt[0]).attr("y",n-o.pt[1]).attr("text-anchor",o.align==="l"?"start":o.align==="r"?"end":"middle").attr("font-family",o.face||"Inter, Helvetica, Arial").attr("font-size",`${o.size||12}px`).attr("fill",o.color||a).text(o.text);break;case"p":if(o.points){const c=o.points.map(([s,l])=>[s,n-l]);t.append("polygon").attr("points",c.map(s=>s.join(",")).join(" ")).attr("fill",i).attr("stroke",r)}break;case"P":if(o.points){const c=o.points.map(([s,l])=>[s,n-l]);t.append("polygon").attr("points",c.map(s=>s.join(",")).join(" ")).attr("fill","none").attr("stroke",r)}break;case"e":if(o.rect){const[c,s,l,u]=o.rect;t.append("ellipse").attr("cx",c).attr("cy",n-s).attr("rx",l).attr("ry",u).attr("fill",i).attr("stroke",r)}break;case"E":if(o.rect){const[c,s,l,u]=o.rect;t.append("ellipse").attr("cx",c).attr("cy",n-s).attr("rx",l).attr("ry",u).attr("fill","none").attr("stroke",r)}break;case"b":if(o.points){const c=o.points.map(([l,u])=>[l,n-u]),s=`M${c[0][0]},${c[0][1]} C${c.slice(1).map(l=>`${l[0]},${l[1]}`).join(" ")}`;t.append("path").attr("d",s).attr("fill","none").attr("stroke",r).attr("stroke-width",1)}break;case"B":if(o.points){const c=o.points.map(([l,u])=>[l,n-u]),s=`M${c[0][0]},${c[0][1]} C${c.slice(1).map(l=>`${l[0]},${l[1]}`).join(" ")}`;t.append("path").attr("d",s).attr("fill",i).attr("stroke",r).attr("stroke-width",1)}break;case"L":if(o.points){const s=`M${o.points.map(([l,u])=>[l,n-u]).map(l=>`${l[0]},${l[1]}`).join(" L")}`;t.append("path").attr("d",s).attr("fill","none").attr("stroke",r).attr("stroke-width",1)}break}})}function Ca(t,e,n=14){var y;t.innerHTML="";const r=((y=e.bb)==null?void 0:y.split(",").map(Number))||hn,[,,i,a]=r,o=z(t).append("svg").attr("width","100%").attr("height","100%").attr("viewBox",`0 0 ${i} ${a}`);o.append("defs").html(Ma);const c=o.append("g").attr("id","graph0");(e.objects||[]).forEach(p=>{const w=c.append("g").attr("class","node").attr("id",p.name);p._draw_&&rt(w,p._draw_,a),p._ldraw_&&rt(w,p._ldraw_,a)});const l=e.edges||[];l.forEach(p=>{const w=c.append("g").attr("class","edge").attr("id",`edge_${p._gvid}`);p._draw_&&rt(w,p._draw_,a),p._hdraw_&&rt(w,p._hdraw_,a),p._tdraw_&&rt(w,p._tdraw_,a),p._ldraw_&&rt(w,p._ldraw_,a)});const u=sn().scaleExtent([.1,10]).on("zoom",p=>{c.attr("transform",p.transform.toString())});o.call(u);const f=t.clientWidth||fn,h=n*(f/i),g=l.filter(p=>{if(!p.label)return!1;try{const w=pt(p.label);return(w==null?void 0:w.index)!==void 0}catch{return!1}}).map(p=>{var b;const w=pt(p.label);return{id:p._gvid,index:w.index,sourceNodeId:String(p.tail??""),targetNodeId:String(p.head??""),label:((b=w.elems)==null?void 0:b.map(E=>E.text).join(" "))||null}}).sort((p,w)=>p.index-w.index),m=o.node(),x=c.node();if(!m||!x)throw new Error("Failed to construct SVG elements");return{zoomBehavior:u,svgElement:m,gElement:x,baseFontSize:h,viewBoxWidth:i,edges:g}}const Ia="data-label-center-x",Da="data-label-center-y";function Pa(t,e,n){const i=(t.clientWidth||fn)/e,a=Jo/(n*i);return Math.max(jo,a)}function za(t,e,n,r){if(e.initialTransform)return e.initialTransform;if(e.headless){const l=te;return{x:n/2-n/2*l,y:r/2-r/2*l,k:l}}const i=t.node(),a=i?i.getBBox():{x:0,y:0,width:n,height:r},o=te*n/a.width,c=a.x+a.width/2,s=a.y+a.height/2;return{x:n/2-c*o,y:r/2-s*o,k:o}}function Ya(t,e){return te*t/e}function Ra(t,e,n){const r=e/n;return Qo/(t*r)}function La(t,e,n,r){return sn().scaleExtent([.1,Pa(e,n,r)]).on("zoom",i=>{const a=i.transform;!isNaN(a.x)&&!isNaN(a.y)&&!isNaN(a.k)&&t.attr("transform",a.toString())})}function Oa(t,e){t.on("mouseenter",function(){z(this).raise();const n=z(this).select(".arrow-group");if(!n.empty()){const s=n.attr("data-base-transform")||"";n.attr("transform",s+" scale(1.3)")}const r=e.select(".edge.selected").size()>0,i=z(this).classed("selected"),a=z(this).attr("data-source-node-id"),o=z(this).attr("data-target-node-id"),c=z(this).attr("id");r&&!i?(z(this).classed("hover-highlight",!0),e.selectAll(".node").each(function(){const s=z(this).attr("data-node-id");(s===a||s===o)&&z(this).classed("hover-highlight",!0)})):(e.selectAll(".edge").each(function(){z(this).attr("id")!==c&&z(this).classed("dimmed",!0)}),e.selectAll(".node").each(function(){const s=z(this).attr("data-node-id");s!==a&&s!==o&&z(this).classed("dimmed",!0)}))}).on("mouseleave",function(){const n=z(this).select(".arrow-group");if(!n.empty()){const r=n.attr("data-base-transform")||"";n.attr("transform",r)}e.selectAll(".edge.hover-highlight").classed("hover-highlight",!1),e.selectAll(".node.hover-highlight").classed("hover-highlight",!1),e.selectAll(".edge.dimmed").classed("dimmed",!1),e.selectAll(".node.dimmed").classed("dimmed",!1)})}function Ba(t,e,n,r,i,a){if(e&&e.length>0){const f=e.map(m=>{const x=m.text.length*6.2,y=m.background&&m.background!=="transparent",p=x+2;return{textWidth:x,hasBackground:y,totalWidth:p}}),h=f.reduce((m,x,y)=>m+x.totalWidth+(y>0,0),0);let g=n-h/2;e.forEach((m,x)=>{const y=f[x];x>0&&(g+=0),y.hasBackground&&t.append("rect").attr("x",g).attr("y",r-10/2-2).attr("width",y.totalWidth).attr("height",14).attr("rx",2).attr("ry",2).attr("fill",m.background).style("pointer-events","none"),t.append("text").attr("class","label-text-elem").attr("x",g+1).attr("y",r).attr("text-anchor","start").attr("dominant-baseline","middle").attr("font-family","Inter, Helvetica, Arial").attr("font-size","10px").attr("font-weight","500").attr("fill",m.color&&m.color.length>0?m.color:i).style("pointer-events","none").text(m.text),g+=y.totalWidth})}else t.append("text").attr("class","label-text").attr("x",n).attr("y",r).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","Inter, Helvetica, Arial").attr("font-size","10px").attr("fill",i).style("pointer-events","none").text(a)}function Ha(t){const{edge:e,edgeGroup:n,labelMidpoint:r,edgeColor:i,isSelected:a,ctx:o}=t,{config:c,onEdgeSelect:s,debug:l}=o,{displayElems:u,finalText:f,boxWidth:h,boxHeight:g}=yn(e,c,o.edgeCount),m=e.edgeIndex!==void 0,x=h,y=g,p=r.y,w=r.x,b=n.append("g").attr("class","label-area");b.append("rect").attr("class","label-bg").attr("x",w-x/2).attr("y",p-y/2).attr("width",x).attr("height",y).attr("rx",5).attr("ry",5).attr("fill","var(--bg-primary, #fff)").attr("stroke","var(--border-primary, #CDCFD5)").attr("stroke-width",1.5);const E=w;m&&s&&n.style("cursor","pointer").on("click",function(S){S.stopPropagation(),!a&&s(e.edgeIndex)}),Ba(b,u,E,p,i,f),l&&n.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",4).attr("fill","blue").attr("opacity",.8).style("pointer-events","none").attr("class","debug-label-center")}function Fa(t,e,n){e._ldraw_.forEach(r=>{if(r.op==="T"&&r.text){const i=r.size||10,a=i*.6,o=r.text.length*a,c=i,s=6,l=o+s*2,u=c+s*2,f=4,h=n.y;t.append("rect").attr("x",n.x-l/2).attr("y",h-u/2).attr("width",l).attr("height",u).attr("rx",f).attr("ry",f).attr("fill","white").attr("stroke","#d0d0d0").attr("stroke-width",.5),t.append("text").attr("x",n.x).attr("y",h).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family",r.face||"Inter, Helvetica, Arial").attr("font-size",`${i}px`).attr("fill",r.color||"#666").text(r.text)}})}function Wa(t,e,n){e._draw_&&e._draw_.forEach(r=>{if(r.op==="b"&&r.points){const i=r.points.map(([o,c])=>[o,n-c]),a=`M${i[0][0]},${i[0][1]} C${i.slice(1).map(o=>`${o[0]},${o[1]}`).join(" ")}`;t.append("path").attr("d",a).attr("fill","none").attr("stroke",r.color||"#9AA4B2").attr("stroke-width",2)}}),e._hdraw_&&e._hdraw_.forEach(r=>{if(r.op==="P"&&r.points){const i=r.points.map(([a,o])=>[a,n-o]);t.append("polygon").attr("points",i.map(a=>a.join(",")).join(" ")).attr("fill",r.color||"#9AA4B2")}}),e._ldraw_&&rt(t,e._ldraw_,n)}function Ga(t,e){var C,R;const{g:n,height:r,config:i,useOrthogonalRendering:a,selectedEdgeId:o,debug:c}=e,s=o!=null&&t.edgeIndex===o,l=t.getColor(),u=n.append("g").attr("class",s?"edge selected":"edge").attr("id",`edge_${t._gvid}`).attr("data-edge-id",t.edgeIndex!==void 0?String(t.edgeIndex):"").attr("data-is-base",t.isBaseEdge?"true":"false").attr("data-color",l).attr("data-source-node-id",((C=t.sourceNode)==null?void 0:C.name)||"").attr("data-target-node-id",((R=t.targetNode)==null?void 0:R.name)||""),f=t.getStartPoint(),h=t.getEndPoint(),g=t.getDirection(),m=i.arrowWidth;if(!(f&&h&&g)){Wa(u,t,r);return}const x={x:f.x,y:r-f.y},y={x:h.x,y:r-h.y},p={x:y.x,y:y.y};let w={x:y.x,y:y.y};g==="right"?w={x:y.x-m,y:y.y}:g==="left"?w={x:y.x+m,y:y.y}:g==="self"&&(w={x:y.x+m,y:y.y});const b=ha(t,g,x,w,r,i,a),E=c&&t.isBaseEdge?"#000000":t.getColor(),S=c&&t.isBaseEdge?4:1.5;u.append("path").attr("d",b).attr("fill","none").attr("stroke","transparent").attr("stroke-width",10).attr("class","edge-hit-area").style("cursor","pointer"),u.append("path").attr("d",b).attr("fill","none").attr("stroke",E).attr("stroke-width",S).attr("class","edge-path").style("pointer-events","none"),Oa(u,n);const N=12;let A="";g==="right"?A=`translate(${p.x-N/2}, ${p.y})`:g==="left"?A=`translate(${p.x+N/2}, ${p.y}) rotate(180)`:g==="self"&&(A=`translate(${p.x+N/2}, ${p.y}) rotate(180)`),u.append("g").attr("class","arrow-group").attr("transform",A).attr("data-base-transform",A).append("use").attr("class","edge-arrow").attr("href","#arrow-right").attr("width",N).attr("height",N).attr("x",-N/2).attr("y",-N/2).attr("fill",E).attr("stroke",E).style("stroke-width",0);const P={x:(x.x+y.x)/2,y:t.midY};if(u.attr(Ia,P.x).attr(Da,P.y),t.label?Ha({edge:t,edgeGroup:u,labelMidpoint:P,edgeColor:E,isSelected:s,ctx:e}):t._ldraw_&&Fa(u,t,P),c){let O;t.depth===0?O=`d:0 dir:${t.baseDirection||"base"} off:${t.baseOffset} id:${t._gvid}`:O=`d:${t.depth} dir:${t.baseDirection||"?"} midY:${Math.round(t.midY)} id:${t._gvid}`,u.append("text").attr("x",P.x).attr("y",P.y+15).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","monospace").attr("font-size","9px").attr("fill","#999").text(O)}}function Va(t){const e=t.node();if(!e)return;const n=e.getBBox(),r=n.x+n.width/2,i=n.y+n.height/2;t.append("rect").attr("x",n.x).attr("y",n.y).attr("width",n.width).attr("height",n.height).attr("fill","none").attr("stroke","yellow").attr("stroke-width",3).attr("opacity",.8).style("pointer-events","none").attr("class","debug-root-border"),t.append("circle").attr("cx",r).attr("cy",i).attr("r",10).attr("fill","yellow").attr("stroke","orange").attr("stroke-width",2).attr("opacity",.9).style("pointer-events","none").attr("class","debug-geometric-center")}function Xa(t,e,n){const r=Math.max(e,n)*.003;t.append("circle").attr("cx",e/2).attr("cy",n/2).attr("r",r).attr("fill","red").attr("opacity",.9).style("pointer-events","none").attr("class","debug-center-marker")}function qa(t={}){return{nodeMapping:{},maxDepth:null,includeLesserDepths:!0,config:xn(),useOrthogonalRendering:!0,svgFontSize:14,debug:!1,selectedEdgeId:null,onEdgeSelect:void 0,nodeWidth:cn,nodeHeight:ln,nodeColumnSpacing:null,enableWheelZoom:!0,headless:!1,initialTransform:void 0,...t}}function Ua(t,e,n){var I;const{maxDepth:r,includeLesserDepths:i,config:a,useOrthogonalRendering:o,svgFontSize:c,debug:s,selectedEdgeId:l,onEdgeSelect:u,nodeWidth:f,nodeHeight:h,nodeColumnSpacing:g,enableWheelZoom:m,headless:x}=n;t.innerHTML="";const y=((I=e.bb)==null?void 0:I.split(",").map(Number))||hn,[,,p,w]=y;let b=p;const E=w,S=z(t).append("svg").attr("width","100%").attr("height","100%").attr("viewBox",`0 0 ${b} ${E}`);S.append("defs").html(Ta);const N=S.append("g").attr("id","graph0"),{nodes:A,edges:D}=va(e,f,h),{nodeColumnMap:P,nodeColumns:C,edgeColumns:R}=xa(A,D),O=D.length,st=g??ba(A,D,a,O);b=Ea(C,E,st),S.attr("viewBox",`0 0 ${b} ${E}`),Aa(N,C,E,s),o&&(_a(C,E),wa(D,R),da(R,C,P,E,a));const d=La(N,t,b,c);x||S.call(d),!x&&!m&&(S.on("wheel.zoom",null),S.on("dblclick.zoom",null)),D.forEach(T=>{if(r!==null){if(i){if(T.depth>r)return}else if(T.depth!==r)return}Ga(T,{g:N,height:E,config:a,useOrthogonalRendering:o,zoomBehavior:d,svgSelection:S,container:t,svgWidth:b,svgHeight:E,selectedEdgeId:l,onEdgeSelect:u,debug:s,edgeCount:O})}),s&&Va(N);const v=za(N,n,b,E),_=`translate(${v.x},${v.y}) scale(${v.k})`;x?N.attr("transform",_):S.call(d.transform,bt.translate(v.x,v.y).scale(v.k)),s&&Xa(S,b,E);const $=D.filter(T=>T.edgeIndex!==void 0).map(T=>{var Y,H;return{id:T._gvid,index:T.edgeIndex,sourceNodeId:((Y=T.sourceNode)==null?void 0:Y.name)||"",targetNodeId:((H=T.targetNode)==null?void 0:H.name)||"",label:T.getLabelText()}}).sort((T,Y)=>T.index-Y.index),k=S.node(),M=N.node();if(!k||!M)throw new Error("Failed to construct SVG elements");return{zoomBehavior:d,svgElement:k,gElement:M,baseFontSize:c,viewBoxWidth:b,edges:$,initialTransform:v}}exports.DEFAULT_LAYOUT_CONFIG=fe;exports.DEFAULT_NODE_HEIGHT=ln;exports.DEFAULT_NODE_WIDTH=cn;exports.computeDetailScale=Ra;exports.computeOverviewScale=Ya;exports.createLayoutConfig=xn;exports.createRenderOptions=qa;exports.decodeDotString=pt;exports.encodeDotString=_n;exports.identity=bt;exports.renderCustomGraph=Ua;exports.renderNativeGraph=Ca;exports.select=z;exports.transform=an;
|