@mcp-graph-workflow/mcp-graph 4.1.0 → 4.3.0
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/api/router.d.ts.map +1 -1
- package/dist/api/router.js +24 -0
- package/dist/api/router.js.map +1 -1
- package/dist/api/routes/logs.d.ts +3 -0
- package/dist/api/routes/logs.d.ts.map +1 -0
- package/dist/api/routes/logs.js +38 -0
- package/dist/api/routes/logs.js.map +1 -0
- package/dist/core/events/event-types.d.ts +10 -1
- package/dist/core/events/event-types.d.ts.map +1 -1
- package/dist/core/planner/lifecycle-phase.d.ts +27 -8
- package/dist/core/planner/lifecycle-phase.d.ts.map +1 -1
- package/dist/core/planner/lifecycle-phase.js +89 -14
- package/dist/core/planner/lifecycle-phase.js.map +1 -1
- package/dist/core/store/migrations.d.ts.map +1 -1
- package/dist/core/store/migrations.js +13 -0
- package/dist/core/store/migrations.js.map +1 -1
- package/dist/core/store/sqlite-store.d.ts +2 -0
- package/dist/core/store/sqlite-store.d.ts.map +1 -1
- package/dist/core/store/sqlite-store.js +17 -0
- package/dist/core/store/sqlite-store.js.map +1 -1
- package/dist/core/utils/logger.d.ts +4 -0
- package/dist/core/utils/logger.d.ts.map +1 -1
- package/dist/core/utils/logger.js +34 -0
- package/dist/core/utils/logger.js.map +1 -1
- package/dist/mcp/lifecycle-wrapper.d.ts +8 -2
- package/dist/mcp/lifecycle-wrapper.d.ts.map +1 -1
- package/dist/mcp/lifecycle-wrapper.js +17 -4
- package/dist/mcp/lifecycle-wrapper.js.map +1 -1
- package/dist/mcp/tools/index.d.ts.map +1 -1
- package/dist/mcp/tools/index.js +2 -0
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/set-phase.d.ts +4 -0
- package/dist/mcp/tools/set-phase.d.ts.map +1 -0
- package/dist/mcp/tools/set-phase.js +48 -0
- package/dist/mcp/tools/set-phase.js.map +1 -0
- package/dist/schemas/log.schema.d.ts +24 -0
- package/dist/schemas/log.schema.d.ts.map +1 -0
- package/dist/schemas/log.schema.js +10 -0
- package/dist/schemas/log.schema.js.map +1 -0
- package/dist/web/dashboard/dist/assets/{benchmark-tab-CESZcCtO.js → benchmark-tab-5xQOEgKI.js} +1 -1
- package/dist/web/dashboard/dist/assets/{gitnexus-tab-ClNGphK5.js → gitnexus-tab-DiextoFD.js} +1 -1
- package/dist/web/dashboard/dist/assets/{graph-tab-BUAkTto0.js → graph-tab-BWyH2uGm.js} +1 -1
- package/dist/web/dashboard/dist/assets/{graph-utils-M7iOhRI-.js → graph-utils-CwfVyQ0x.js} +1 -1
- package/dist/web/dashboard/dist/assets/index-BYepgmDE.css +1 -0
- package/dist/web/dashboard/dist/assets/{index-D9i2aVjo.js → index-DSExqypu.js} +15 -15
- package/dist/web/dashboard/dist/assets/{insights-tab-CWUU6eDi.js → insights-tab-CncahgJb.js} +1 -1
- package/dist/web/dashboard/dist/assets/logs-tab-sUqUxW7O.js +2 -0
- package/dist/web/dashboard/dist/assets/{prd-backlog-tab-DAHBiRO-.js → prd-backlog-tab-wbCrJ8KJ.js} +1 -1
- package/dist/web/dashboard/dist/assets/{serena-tab-DwiZ6Jm3.js → serena-tab-C5Gk0M6t.js} +1 -1
- package/dist/web/dashboard/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/dashboard/dist/assets/index-BnLPCC8R.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var gl=Object.defineProperty;var ml=(e,t,n)=>t in e?gl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oe=(e,t,n)=>ml(e,typeof t!="symbol"?t+"":t,n);import{b as xs,g as ws,t as yl,c as xl,r as V,j as I}from"./index-D9i2aVjo.js";import{N as Vr,S as vs,E as Te}from"./constants-BIEJOBya.js";function ae(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=ae(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var wl={value:()=>{}};function on(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ht(n)}function Ht(e){this._=e}function vl(e,t){return e.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&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ht.prototype=on.prototype={constructor:Ht,on:function(e,t){var n=this._,r=vl(e+"",n),i,s=-1,o=r.length;if(arguments.length<2){for(;++s<o;)if((i=(e=r[s]).type)&&(i=bl(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<o;)if(i=(e=r[s]).type)n[i]=gi(n[i],e.name,t);else if(t==null)for(i in n)n[i]=gi(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ht(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function bl(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function gi(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=wl,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Sr="http://www.w3.org/1999/xhtml";const mi={svg:"http://www.w3.org/2000/svg",xhtml:Sr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function sn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),mi.hasOwnProperty(t)?{space:mi[t],local:e}:e}function _l(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Sr&&t.documentElement.namespaceURI===Sr?t.createElement(e):t.createElementNS(n,e)}}function El(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function bs(e){var t=sn(e);return(t.local?El:_l)(t)}function Nl(){}function Hr(e){return e==null?Nl:function(){return this.querySelector(e)}}function Sl(e){typeof e!="function"&&(e=Hr(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],o=s.length,a=r[i]=new Array(o),l,d,u=0;u<o;++u)(l=s[u])&&(d=e.call(l,l.__data__,u,s))&&("__data__"in l&&(d.__data__=l.__data__),a[u]=d);return new de(r,this._parents)}function kl(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Cl(){return[]}function _s(e){return e==null?Cl:function(){return this.querySelectorAll(e)}}function Ml(e){return function(){return kl(e.apply(this,arguments))}}function Il(e){typeof e=="function"?e=Ml(e):e=_s(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var o=t[s],a=o.length,l,d=0;d<a;++d)(l=o[d])&&(r.push(e.call(l,l.__data__,d,o)),i.push(l));return new de(r,i)}function Es(e){return function(){return this.matches(e)}}function Ns(e){return function(t){return t.matches(e)}}var Al=Array.prototype.find;function Tl(e){return function(){return Al.call(this.children,e)}}function Ll(){return this.firstElementChild}function Pl(e){return this.select(e==null?Ll:Tl(typeof e=="function"?e:Ns(e)))}var Rl=Array.prototype.filter;function $l(){return Array.from(this.children)}function Ol(e){return function(){return Rl.call(this.children,e)}}function jl(e){return this.selectAll(e==null?$l:Ol(typeof e=="function"?e:Ns(e)))}function Dl(e){typeof e!="function"&&(e=Es(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],o=s.length,a=r[i]=[],l,d=0;d<o;++d)(l=s[d])&&e.call(l,l.__data__,d,s)&&a.push(l);return new de(r,this._parents)}function Ss(e){return new Array(e.length)}function zl(){return new de(this._enter||this._groups.map(Ss),this._parents)}function Gt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Gt.prototype={constructor:Gt,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Vl(e){return function(){return e}}function Hl(e,t,n,r,i,s){for(var o=0,a,l=t.length,d=s.length;o<d;++o)(a=t[o])?(a.__data__=s[o],r[o]=a):n[o]=new Gt(e,s[o]);for(;o<l;++o)(a=t[o])&&(i[o]=a)}function Fl(e,t,n,r,i,s,o){var a,l,d=new Map,u=t.length,c=s.length,f=new Array(u),h;for(a=0;a<u;++a)(l=t[a])&&(f[a]=h=o.call(l,l.__data__,a,t)+"",d.has(h)?i[a]=l:d.set(h,l));for(a=0;a<c;++a)h=o.call(e,s[a],a,s)+"",(l=d.get(h))?(r[a]=l,l.__data__=s[a],d.delete(h)):n[a]=new Gt(e,s[a]);for(a=0;a<u;++a)(l=t[a])&&d.get(f[a])===l&&(i[a]=l)}function Bl(e){return e.__data__}function ql(e,t){if(!arguments.length)return Array.from(this,Bl);var n=t?Fl:Hl,r=this._parents,i=this._groups;typeof e!="function"&&(e=Vl(e));for(var s=i.length,o=new Array(s),a=new Array(s),l=new Array(s),d=0;d<s;++d){var u=r[d],c=i[d],f=c.length,h=Yl(e.call(u,u&&u.__data__,d,r)),p=h.length,x=a[d]=new Array(p),m=o[d]=new Array(p),y=l[d]=new Array(f);n(u,c,x,m,y,h,t);for(var v=0,g=0,w,k;v<p;++v)if(w=x[v]){for(v>=g&&(g=v+1);!(k=m[g])&&++g<p;);w._next=k||null}}return o=new de(o,r),o._enter=a,o._exit=l,o}function Yl(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Gl(){return new de(this._exit||this._groups.map(Ss),this._parents)}function Wl(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function Xl(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,o=Math.min(i,s),a=new Array(i),l=0;l<o;++l)for(var d=n[l],u=r[l],c=d.length,f=a[l]=new Array(c),h,p=0;p<c;++p)(h=d[p]||u[p])&&(f[p]=h);for(;l<i;++l)a[l]=n[l];return new de(a,this._parents)}function Ul(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],o;--i>=0;)(o=r[i])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function Kl(e){e||(e=Zl);function t(c,f){return c&&f?e(c.__data__,f.__data__):!c-!f}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var o=n[s],a=o.length,l=i[s]=new Array(a),d,u=0;u<a;++u)(d=o[u])&&(l[u]=d);l.sort(t)}return new de(i,this._parents).order()}function Zl(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ql(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Jl(){return Array.from(this)}function eu(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var o=r[i];if(o)return o}return null}function tu(){let e=0;for(const t of this)++e;return e}function nu(){return!this.node()}function ru(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,o=i.length,a;s<o;++s)(a=i[s])&&e.call(a,a.__data__,s,i);return this}function iu(e){return function(){this.removeAttribute(e)}}function ou(e){return function(){this.removeAttributeNS(e.space,e.local)}}function su(e,t){return function(){this.setAttribute(e,t)}}function au(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function cu(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function lu(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function uu(e,t){var n=sn(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?ou:iu:typeof t=="function"?n.local?lu:cu:n.local?au:su)(n,t))}function ks(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function du(e){return function(){this.style.removeProperty(e)}}function fu(e,t,n){return function(){this.style.setProperty(e,t,n)}}function hu(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function pu(e,t,n){return arguments.length>1?this.each((t==null?du:typeof t=="function"?hu:fu)(e,t,n??"")):Ue(this.node(),e)}function Ue(e,t){return e.style.getPropertyValue(t)||ks(e).getComputedStyle(e,null).getPropertyValue(t)}function gu(e){return function(){delete this[e]}}function mu(e,t){return function(){this[e]=t}}function yu(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function xu(e,t){return arguments.length>1?this.each((t==null?gu:typeof t=="function"?yu:mu)(e,t)):this.node()[e]}function Cs(e){return e.trim().split(/^|\s+/)}function Fr(e){return e.classList||new Ms(e)}function Ms(e){this._node=e,this._names=Cs(e.getAttribute("class")||"")}Ms.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Is(e,t){for(var n=Fr(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function As(e,t){for(var n=Fr(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function wu(e){return function(){Is(this,e)}}function vu(e){return function(){As(this,e)}}function bu(e,t){return function(){(t.apply(this,arguments)?Is:As)(this,e)}}function _u(e,t){var n=Cs(e+"");if(arguments.length<2){for(var r=Fr(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?bu:t?wu:vu)(n,t))}function Eu(){this.textContent=""}function Nu(e){return function(){this.textContent=e}}function Su(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function ku(e){return arguments.length?this.each(e==null?Eu:(typeof e=="function"?Su:Nu)(e)):this.node().textContent}function Cu(){this.innerHTML=""}function Mu(e){return function(){this.innerHTML=e}}function Iu(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Au(e){return arguments.length?this.each(e==null?Cu:(typeof e=="function"?Iu:Mu)(e)):this.node().innerHTML}function Tu(){this.nextSibling&&this.parentNode.appendChild(this)}function Lu(){return this.each(Tu)}function Pu(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ru(){return this.each(Pu)}function $u(e){var t=typeof e=="function"?e:bs(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ou(){return null}function ju(e,t){var n=typeof e=="function"?e:bs(e),r=t==null?Ou:typeof t=="function"?t:Hr(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Du(){var e=this.parentNode;e&&e.removeChild(this)}function zu(){return this.each(Du)}function Vu(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Hu(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Fu(e){return this.select(e?Hu:Vu)}function Bu(e){return arguments.length?this.property("__data__",e):this.node().__data__}function qu(e){return function(t){e.call(this,t,this.__data__)}}function Yu(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Gu(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function Wu(e,t,n){return function(){var r=this.__on,i,s=qu(t);if(r){for(var o=0,a=r.length;o<a;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function Xu(e,t,n){var r=Yu(e+""),i,s=r.length,o;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,d=a.length,u;l<d;++l)for(i=0,u=a[l];i<s;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(a=t?Wu:Gu,i=0;i<s;++i)this.each(a(r[i],t,n));return this}function Ts(e,t,n){var r=ks(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Uu(e,t){return function(){return Ts(this,e,t)}}function Ku(e,t){return function(){return Ts(this,e,t.apply(this,arguments))}}function Zu(e,t){return this.each((typeof t=="function"?Ku:Uu)(e,t))}function*Qu(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,o;i<s;++i)(o=r[i])&&(yield o)}var Ls=[null];function de(e,t){this._groups=e,this._parents=t}function _t(){return new de([[document.documentElement]],Ls)}function Ju(){return this}de.prototype=_t.prototype={constructor:de,select:Sl,selectAll:Il,selectChild:Pl,selectChildren:jl,filter:Dl,data:ql,enter:zl,exit:Gl,join:Wl,merge:Xl,selection:Ju,order:Ul,sort:Kl,call:Ql,nodes:Jl,node:eu,size:tu,empty:nu,each:ru,attr:uu,style:pu,property:xu,classed:_u,text:ku,html:Au,raise:Lu,lower:Ru,append:$u,insert:ju,remove:zu,clone:Fu,datum:Bu,on:Xu,dispatch:Zu,[Symbol.iterator]:Qu};function ue(e){return typeof e=="string"?new de([[document.querySelector(e)]],[document.documentElement]):new de([[e]],Ls)}function ed(e){let t;for(;t=e.sourceEvent;)e=t;return e}function fe(e,t){if(e=ed(e),t===void 0&&(t=e.currentTarget),t){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()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const td={passive:!1},ht={capture:!0,passive:!1};function wn(e){e.stopImmediatePropagation()}function We(e){e.preventDefault(),e.stopImmediatePropagation()}function Ps(e){var t=e.document.documentElement,n=ue(e).on("dragstart.drag",We,ht);"onselectstart"in t?n.on("selectstart.drag",We,ht):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Rs(e,t){var n=e.document.documentElement,r=ue(e).on("dragstart.drag",null);t&&(r.on("click.drag",We,ht),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Tt=e=>()=>e;function kr(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:s,x:o,y:a,dx:l,dy:d,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:u}})}kr.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function nd(e){return!e.ctrlKey&&!e.button}function rd(){return this.parentNode}function id(e,t){return t??{x:e.x,y:e.y}}function od(){return navigator.maxTouchPoints||"ontouchstart"in this}function $s(){var e=nd,t=rd,n=id,r=od,i={},s=on("start","drag","end"),o=0,a,l,d,u,c=0;function f(w){w.on("mousedown.drag",h).filter(r).on("touchstart.drag",m).on("touchmove.drag",y,td).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(w,k){if(!(u||!e.call(this,w,k))){var _=g(this,t.call(this,w,k),w,k,"mouse");_&&(ue(w.view).on("mousemove.drag",p,ht).on("mouseup.drag",x,ht),Ps(w.view),wn(w),d=!1,a=w.clientX,l=w.clientY,_("start",w))}}function p(w){if(We(w),!d){var k=w.clientX-a,_=w.clientY-l;d=k*k+_*_>c}i.mouse("drag",w)}function x(w){ue(w.view).on("mousemove.drag mouseup.drag",null),Rs(w.view,d),We(w),i.mouse("end",w)}function m(w,k){if(e.call(this,w,k)){var _=w.changedTouches,M=t.call(this,w,k),b=_.length,N,A;for(N=0;N<b;++N)(A=g(this,M,w,k,_[N].identifier,_[N]))&&(wn(w),A("start",w,_[N]))}}function y(w){var k=w.changedTouches,_=k.length,M,b;for(M=0;M<_;++M)(b=i[k[M].identifier])&&(We(w),b("drag",w,k[M]))}function v(w){var k=w.changedTouches,_=k.length,M,b;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),M=0;M<_;++M)(b=i[k[M].identifier])&&(wn(w),b("end",w,k[M]))}function g(w,k,_,M,b,N){var A=s.copy(),S=fe(N||_,k),C,j,E;if((E=n.call(w,new kr("beforestart",{sourceEvent:_,target:f,identifier:b,active:o,x:S[0],y:S[1],dx:0,dy:0,dispatch:A}),M))!=null)return C=E.x-S[0]||0,j=E.y-S[1]||0,function P(L,D,O){var R=S,H;switch(L){case"start":i[b]=P,H=o++;break;case"end":delete i[b],--o;case"drag":S=fe(O||D,k),H=o;break}A.call(L,w,new kr(L,{sourceEvent:D,subject:E,target:f,identifier:b,active:H,x:S[0]+C,y:S[1]+j,dx:S[0]-R[0],dy:S[1]-R[1],dispatch:A}),M)}}return f.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Tt(!!w),f):e},f.container=function(w){return arguments.length?(t=typeof w=="function"?w:Tt(w),f):t},f.subject=function(w){return arguments.length?(n=typeof w=="function"?w:Tt(w),f):n},f.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:Tt(!!w),f):r},f.on=function(){var w=s.on.apply(s,arguments);return w===s?f:w},f.clickDistance=function(w){return arguments.length?(c=(w=+w)*w,f):Math.sqrt(c)},f}function Br(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Os(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Et(){}var pt=.7,Wt=1/pt,Xe="\\s*([+-]?\\d+)\\s*",gt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",we="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sd=/^#([0-9a-f]{3,8})$/,ad=new RegExp(`^rgb\\(${Xe},${Xe},${Xe}\\)$`),cd=new RegExp(`^rgb\\(${we},${we},${we}\\)$`),ld=new RegExp(`^rgba\\(${Xe},${Xe},${Xe},${gt}\\)$`),ud=new RegExp(`^rgba\\(${we},${we},${we},${gt}\\)$`),dd=new RegExp(`^hsl\\(${gt},${we},${we}\\)$`),fd=new RegExp(`^hsla\\(${gt},${we},${we},${gt}\\)$`),yi={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};Br(Et,ze,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xi,formatHex:xi,formatHex8:hd,formatHsl:pd,formatRgb:wi,toString:wi});function xi(){return this.rgb().formatHex()}function hd(){return this.rgb().formatHex8()}function pd(){return js(this).formatHsl()}function wi(){return this.rgb().formatRgb()}function ze(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=sd.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?vi(t):n===3?new le(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Lt(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Lt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ad.exec(e))?new le(t[1],t[2],t[3],1):(t=cd.exec(e))?new le(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ld.exec(e))?Lt(t[1],t[2],t[3],t[4]):(t=ud.exec(e))?Lt(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=dd.exec(e))?Ei(t[1],t[2]/100,t[3]/100,1):(t=fd.exec(e))?Ei(t[1],t[2]/100,t[3]/100,t[4]):yi.hasOwnProperty(e)?vi(yi[e]):e==="transparent"?new le(NaN,NaN,NaN,0):null}function vi(e){return new le(e>>16&255,e>>8&255,e&255,1)}function Lt(e,t,n,r){return r<=0&&(e=t=n=NaN),new le(e,t,n,r)}function gd(e){return e instanceof Et||(e=ze(e)),e?(e=e.rgb(),new le(e.r,e.g,e.b,e.opacity)):new le}function Cr(e,t,n,r){return arguments.length===1?gd(e):new le(e,t,n,r??1)}function le(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Br(le,Cr,Os(Et,{brighter(e){return e=e==null?Wt:Math.pow(Wt,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?pt:Math.pow(pt,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new le(je(this.r),je(this.g),je(this.b),Xt(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:bi,formatHex:bi,formatHex8:md,formatRgb:_i,toString:_i}));function bi(){return`#${Oe(this.r)}${Oe(this.g)}${Oe(this.b)}`}function md(){return`#${Oe(this.r)}${Oe(this.g)}${Oe(this.b)}${Oe((isNaN(this.opacity)?1:this.opacity)*255)}`}function _i(){const e=Xt(this.opacity);return`${e===1?"rgb(":"rgba("}${je(this.r)}, ${je(this.g)}, ${je(this.b)}${e===1?")":`, ${e})`}`}function Xt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function je(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Oe(e){return e=je(e),(e<16?"0":"")+e.toString(16)}function Ei(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new he(e,t,n,r)}function js(e){if(e instanceof he)return new he(e.h,e.s,e.l,e.opacity);if(e instanceof Et||(e=ze(e)),!e)return new he;if(e instanceof he)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=NaN,a=s-i,l=(s+i)/2;return a?(t===s?o=(n-r)/a+(n<r)*6:n===s?o=(r-t)/a+2:o=(t-n)/a+4,a/=l<.5?s+i:2-s-i,o*=60):a=l>0&&l<1?0:o,new he(o,a,l,e.opacity)}function yd(e,t,n,r){return arguments.length===1?js(e):new he(e,t,n,r??1)}function he(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Br(he,yd,Os(Et,{brighter(e){return e=e==null?Wt:Math.pow(Wt,e),new he(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?pt:Math.pow(pt,e),new he(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new le(vn(e>=240?e-240:e+120,i,r),vn(e,i,r),vn(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new he(Ni(this.h),Pt(this.s),Pt(this.l),Xt(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 e=Xt(this.opacity);return`${e===1?"hsl(":"hsla("}${Ni(this.h)}, ${Pt(this.s)*100}%, ${Pt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ni(e){return e=(e||0)%360,e<0?e+360:e}function Pt(e){return Math.max(0,Math.min(1,e||0))}function vn(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const qr=e=>()=>e;function xd(e,t){return function(n){return e+n*t}}function wd(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function vd(e){return(e=+e)==1?Ds:function(t,n){return n-t?wd(t,n,e):qr(isNaN(t)?n:t)}}function Ds(e,t){var n=t-e;return n?xd(e,n):qr(isNaN(e)?t:e)}const Ut=(function e(t){var n=vd(t);function r(i,s){var o=n((i=Cr(i)).r,(s=Cr(s)).r),a=n(i.g,s.g),l=n(i.b,s.b),d=Ds(i.opacity,s.opacity);return function(u){return i.r=o(u),i.g=a(u),i.b=l(u),i.opacity=d(u),i+""}}return r.gamma=e,r})(1);function bd(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function _d(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ed(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),o;for(o=0;o<r;++o)i[o]=dt(e[o],t[o]);for(;o<n;++o)s[o]=t[o];return function(a){for(o=0;o<r;++o)s[o]=i[o](a);return s}}function Nd(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function xe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Sd(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=dt(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var Mr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bn=new RegExp(Mr.source,"g");function kd(e){return function(){return e}}function Cd(e){return function(t){return e(t)+""}}function zs(e,t){var n=Mr.lastIndex=bn.lastIndex=0,r,i,s,o=-1,a=[],l=[];for(e=e+"",t=t+"";(r=Mr.exec(e))&&(i=bn.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),a[o]?a[o]+=s:a[++o]=s),(r=r[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,l.push({i:o,x:xe(r,i)})),n=bn.lastIndex;return n<t.length&&(s=t.slice(n),a[o]?a[o]+=s:a[++o]=s),a.length<2?l[0]?Cd(l[0].x):kd(t):(t=l.length,function(d){for(var u=0,c;u<t;++u)a[(c=l[u]).i]=c.x(d);return a.join("")})}function dt(e,t){var n=typeof t,r;return t==null||n==="boolean"?qr(t):(n==="number"?xe:n==="string"?(r=ze(t))?(t=r,Ut):zs:t instanceof ze?Ut:t instanceof Date?Nd:_d(t)?bd:Array.isArray(t)?Ed:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Sd:xe)(e,t)}var Si=180/Math.PI,Ir={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Vs(e,t,n,r,i,s){var o,a,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),e*r<t*n&&(e=-e,t=-t,l=-l,o=-o),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*Si,skewX:Math.atan(l)*Si,scaleX:o,scaleY:a}}var Rt;function Md(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ir:Vs(t.a,t.b,t.c,t.d,t.e,t.f)}function Id(e){return e==null||(Rt||(Rt=document.createElementNS("http://www.w3.org/2000/svg","g")),Rt.setAttribute("transform",e),!(e=Rt.transform.baseVal.consolidate()))?Ir:(e=e.matrix,Vs(e.a,e.b,e.c,e.d,e.e,e.f))}function Hs(e,t,n,r){function i(d){return d.length?d.pop()+" ":""}function s(d,u,c,f,h,p){if(d!==c||u!==f){var x=h.push("translate(",null,t,null,n);p.push({i:x-4,x:xe(d,c)},{i:x-2,x:xe(u,f)})}else(c||f)&&h.push("translate("+c+t+f+n)}function o(d,u,c,f){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),f.push({i:c.push(i(c)+"rotate(",null,r)-2,x:xe(d,u)})):u&&c.push(i(c)+"rotate("+u+r)}function a(d,u,c,f){d!==u?f.push({i:c.push(i(c)+"skewX(",null,r)-2,x:xe(d,u)}):u&&c.push(i(c)+"skewX("+u+r)}function l(d,u,c,f,h,p){if(d!==c||u!==f){var x=h.push(i(h)+"scale(",null,",",null,")");p.push({i:x-4,x:xe(d,c)},{i:x-2,x:xe(u,f)})}else(c!==1||f!==1)&&h.push(i(h)+"scale("+c+","+f+")")}return function(d,u){var c=[],f=[];return d=e(d),u=e(u),s(d.translateX,d.translateY,u.translateX,u.translateY,c,f),o(d.rotate,u.rotate,c,f),a(d.skewX,u.skewX,c,f),l(d.scaleX,d.scaleY,u.scaleX,u.scaleY,c,f),d=u=null,function(h){for(var p=-1,x=f.length,m;++p<x;)c[(m=f[p]).i]=m.x(h);return c.join("")}}}var Ad=Hs(Md,"px, ","px)","deg)"),Td=Hs(Id,", ",")",")"),Ld=1e-12;function ki(e){return((e=Math.exp(e))+1/e)/2}function Pd(e){return((e=Math.exp(e))-1/e)/2}function Rd(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ft=(function e(t,n,r){function i(s,o){var a=s[0],l=s[1],d=s[2],u=o[0],c=o[1],f=o[2],h=u-a,p=c-l,x=h*h+p*p,m,y;if(x<Ld)y=Math.log(f/d)/t,m=function(M){return[a+M*h,l+M*p,d*Math.exp(t*M*y)]};else{var v=Math.sqrt(x),g=(f*f-d*d+r*x)/(2*d*n*v),w=(f*f-d*d-r*x)/(2*f*n*v),k=Math.log(Math.sqrt(g*g+1)-g),_=Math.log(Math.sqrt(w*w+1)-w);y=(_-k)/t,m=function(M){var b=M*y,N=ki(k),A=d/(n*v)*(N*Rd(t*b+k)-Pd(k));return[a+A*h,l+A*p,d*N/ki(t*b+k)]}}return m.duration=y*1e3*t/Math.SQRT2,m}return i.rho=function(s){var o=Math.max(.001,+s),a=o*o,l=a*a;return e(o,a,l)},i})(Math.SQRT2,2,4);var Ke=0,lt=0,at=0,Fs=1e3,Kt,ut,Zt=0,Ve=0,an=0,mt=typeof performance=="object"&&performance.now?performance:Date,Bs=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Yr(){return Ve||(Bs($d),Ve=mt.now()+an)}function $d(){Ve=0}function Qt(){this._call=this._time=this._next=null}Qt.prototype=qs.prototype={constructor:Qt,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Yr():+n)+(t==null?0:+t),!this._next&&ut!==this&&(ut?ut._next=this:Kt=this,ut=this),this._call=e,this._time=n,Ar()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ar())}};function qs(e,t,n){var r=new Qt;return r.restart(e,t,n),r}function Od(){Yr(),++Ke;for(var e=Kt,t;e;)(t=Ve-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ke}function Ci(){Ve=(Zt=mt.now())+an,Ke=lt=0;try{Od()}finally{Ke=0,Dd(),Ve=0}}function jd(){var e=mt.now(),t=e-Zt;t>Fs&&(an-=t,Zt=e)}function Dd(){for(var e,t=Kt,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Kt=n);ut=e,Ar(r)}function Ar(e){if(!Ke){lt&&(lt=clearTimeout(lt));var t=e-Ve;t>24?(e<1/0&&(lt=setTimeout(Ci,e-mt.now()-an)),at&&(at=clearInterval(at))):(at||(Zt=mt.now(),at=setInterval(jd,Fs)),Ke=1,Bs(Ci))}}function Mi(e,t,n){var r=new Qt;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var zd=on("start","end","cancel","interrupt"),Vd=[],Ys=0,Ii=1,Tr=2,Bt=3,Ai=4,Lr=5,qt=6;function cn(e,t,n,r,i,s){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Hd(e,n,{name:t,index:r,group:i,on:zd,tween:Vd,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Ys})}function Gr(e,t){var n=ye(e,t);if(n.state>Ys)throw new Error("too late; already scheduled");return n}function be(e,t){var n=ye(e,t);if(n.state>Bt)throw new Error("too late; already running");return n}function ye(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Hd(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=qs(s,0,n.time);function s(d){n.state=Ii,n.timer.restart(o,n.delay,n.time),n.delay<=d&&o(d-n.delay)}function o(d){var u,c,f,h;if(n.state!==Ii)return l();for(u in r)if(h=r[u],h.name===n.name){if(h.state===Bt)return Mi(o);h.state===Ai?(h.state=qt,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[u]):+u<t&&(h.state=qt,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[u])}if(Mi(function(){n.state===Bt&&(n.state=Ai,n.timer.restart(a,n.delay,n.time),a(d))}),n.state=Tr,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Tr){for(n.state=Bt,i=new Array(f=n.tween.length),u=0,c=-1;u<f;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++c]=h);i.length=c+1}}function a(d){for(var u=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(l),n.state=Lr,1),c=-1,f=i.length;++c<f;)i[c].call(e,u);n.state===Lr&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=qt,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function Yt(e,t){var n=e.__transition,r,i,s=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){s=!1;continue}i=r.state>Tr&&r.state<Lr,r.state=qt,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}s&&delete e.__transition}}function Fd(e){return this.each(function(){Yt(this,e)})}function Bd(e,t){var n,r;return function(){var i=be(this,e),s=i.tween;if(s!==n){r=n=s;for(var o=0,a=r.length;o<a;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function qd(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=be(this,e),o=s.tween;if(o!==r){i=(r=o).slice();for(var a={name:t,value:n},l=0,d=i.length;l<d;++l)if(i[l].name===t){i[l]=a;break}l===d&&i.push(a)}s.tween=i}}function Yd(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ye(this.node(),n).tween,i=0,s=r.length,o;i<s;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Bd:qd)(n,e,t))}function Wr(e,t,n){var r=e._id;return e.each(function(){var i=be(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return ye(i,r).value[t]}}function Gs(e,t){var n;return(typeof t=="number"?xe:t instanceof ze?Ut:(n=ze(t))?(t=n,Ut):zs)(e,t)}function Gd(e){return function(){this.removeAttribute(e)}}function Wd(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Xd(e,t,n){var r,i=n+"",s;return function(){var o=this.getAttribute(e);return o===i?null:o===r?s:s=t(r=o,n)}}function Ud(e,t,n){var r,i=n+"",s;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?s:s=t(r=o,n)}}function Kd(e,t,n){var r,i,s;return function(){var o,a=n(this),l;return a==null?void this.removeAttribute(e):(o=this.getAttribute(e),l=a+"",o===l?null:o===r&&l===i?s:(i=l,s=t(r=o,a)))}}function Zd(e,t,n){var r,i,s;return function(){var o,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),l=a+"",o===l?null:o===r&&l===i?s:(i=l,s=t(r=o,a)))}}function Qd(e,t){var n=sn(e),r=n==="transform"?Td:Gs;return this.attrTween(e,typeof t=="function"?(n.local?Zd:Kd)(n,r,Wr(this,"attr."+e,t)):t==null?(n.local?Wd:Gd)(n):(n.local?Ud:Xd)(n,r,t))}function Jd(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ef(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function tf(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&ef(e,s)),n}return i._value=t,i}function nf(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&Jd(e,s)),n}return i._value=t,i}function rf(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=sn(e);return this.tween(n,(r.local?tf:nf)(r,t))}function of(e,t){return function(){Gr(this,e).delay=+t.apply(this,arguments)}}function sf(e,t){return t=+t,function(){Gr(this,e).delay=t}}function af(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?of:sf)(t,e)):ye(this.node(),t).delay}function cf(e,t){return function(){be(this,e).duration=+t.apply(this,arguments)}}function lf(e,t){return t=+t,function(){be(this,e).duration=t}}function uf(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?cf:lf)(t,e)):ye(this.node(),t).duration}function df(e,t){if(typeof t!="function")throw new Error;return function(){be(this,e).ease=t}}function ff(e){var t=this._id;return arguments.length?this.each(df(t,e)):ye(this.node(),t).ease}function hf(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;be(this,e).ease=n}}function pf(e){if(typeof e!="function")throw new Error;return this.each(hf(this._id,e))}function gf(e){typeof e!="function"&&(e=Es(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],o=s.length,a=r[i]=[],l,d=0;d<o;++d)(l=s[d])&&e.call(l,l.__data__,d,s)&&a.push(l);return new Se(r,this._parents,this._name,this._id)}function mf(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),o=new Array(r),a=0;a<s;++a)for(var l=t[a],d=n[a],u=l.length,c=o[a]=new Array(u),f,h=0;h<u;++h)(f=l[h]||d[h])&&(c[h]=f);for(;a<r;++a)o[a]=t[a];return new Se(o,this._parents,this._name,this._id)}function yf(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function xf(e,t,n){var r,i,s=yf(t)?Gr:be;return function(){var o=s(this,e),a=o.on;a!==r&&(i=(r=a).copy()).on(t,n),o.on=i}}function wf(e,t){var n=this._id;return arguments.length<2?ye(this.node(),n).on.on(e):this.each(xf(n,e,t))}function vf(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function bf(){return this.on("end.remove",vf(this._id))}function _f(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Hr(e));for(var r=this._groups,i=r.length,s=new Array(i),o=0;o<i;++o)for(var a=r[o],l=a.length,d=s[o]=new Array(l),u,c,f=0;f<l;++f)(u=a[f])&&(c=e.call(u,u.__data__,f,a))&&("__data__"in u&&(c.__data__=u.__data__),d[f]=c,cn(d[f],t,n,f,d,ye(u,n)));return new Se(s,this._parents,t,n)}function Ef(e){var t=this._name,n=this._id;typeof e!="function"&&(e=_s(e));for(var r=this._groups,i=r.length,s=[],o=[],a=0;a<i;++a)for(var l=r[a],d=l.length,u,c=0;c<d;++c)if(u=l[c]){for(var f=e.call(u,u.__data__,c,l),h,p=ye(u,n),x=0,m=f.length;x<m;++x)(h=f[x])&&cn(h,t,n,x,f,p);s.push(f),o.push(u)}return new Se(s,o,t,n)}var Nf=_t.prototype.constructor;function Sf(){return new Nf(this._groups,this._parents)}function kf(e,t){var n,r,i;return function(){var s=Ue(this,e),o=(this.style.removeProperty(e),Ue(this,e));return s===o?null:s===n&&o===r?i:i=t(n=s,r=o)}}function Ws(e){return function(){this.style.removeProperty(e)}}function Cf(e,t,n){var r,i=n+"",s;return function(){var o=Ue(this,e);return o===i?null:o===r?s:s=t(r=o,n)}}function Mf(e,t,n){var r,i,s;return function(){var o=Ue(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Ue(this,e))),o===l?null:o===r&&l===i?s:(i=l,s=t(r=o,a))}}function If(e,t){var n,r,i,s="style."+t,o="end."+s,a;return function(){var l=be(this,e),d=l.on,u=l.value[s]==null?a||(a=Ws(t)):void 0;(d!==n||i!==u)&&(r=(n=d).copy()).on(o,i=u),l.on=r}}function Af(e,t,n){var r=(e+="")=="transform"?Ad:Gs;return t==null?this.styleTween(e,kf(e,r)).on("end.style."+e,Ws(e)):typeof t=="function"?this.styleTween(e,Mf(e,r,Wr(this,"style."+e,t))).each(If(this._id,e)):this.styleTween(e,Cf(e,r,t),n).on("end.style."+e,null)}function Tf(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Lf(e,t,n){var r,i;function s(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&Tf(e,o,n)),r}return s._value=t,s}function Pf(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Lf(e,t,n??""))}function Rf(e){return function(){this.textContent=e}}function $f(e){return function(){var t=e(this);this.textContent=t??""}}function Of(e){return this.tween("text",typeof e=="function"?$f(Wr(this,"text",e)):Rf(e==null?"":e+""))}function jf(e){return function(t){this.textContent=e.call(this,t)}}function Df(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&jf(i)),t}return r._value=e,r}function zf(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Df(e))}function Vf(){for(var e=this._name,t=this._id,n=Xs(),r=this._groups,i=r.length,s=0;s<i;++s)for(var o=r[s],a=o.length,l,d=0;d<a;++d)if(l=o[d]){var u=ye(l,t);cn(l,e,n,d,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Se(r,this._parents,e,n)}function Hf(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,o){var a={value:o},l={value:function(){--i===0&&s()}};n.each(function(){var d=be(this,r),u=d.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),d.on=t}),i===0&&s()})}var Ff=0;function Se(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Xs(){return++Ff}var Ee=_t.prototype;Se.prototype={constructor:Se,select:_f,selectAll:Ef,selectChild:Ee.selectChild,selectChildren:Ee.selectChildren,filter:gf,merge:mf,selection:Sf,transition:Vf,call:Ee.call,nodes:Ee.nodes,node:Ee.node,size:Ee.size,empty:Ee.empty,each:Ee.each,on:wf,attr:Qd,attrTween:rf,style:Af,styleTween:Pf,text:Of,textTween:zf,remove:bf,tween:Yd,delay:af,duration:uf,ease:ff,easeVarying:pf,end:Hf,[Symbol.iterator]:Ee[Symbol.iterator]};function Bf(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var qf={time:null,delay:0,duration:250,ease:Bf};function Yf(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Gf(e){var t,n;e instanceof Se?(t=e._id,e=e._name):(t=Xs(),(n=qf).time=Yr(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var o=r[s],a=o.length,l,d=0;d<a;++d)(l=o[d])&&cn(l,e,t,d,o,n||Yf(l,t));return new Se(r,this._parents,e,t)}_t.prototype.interrupt=Fd;_t.prototype.transition=Gf;const $t=e=>()=>e;function Wf(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Ne(e,t,n){this.k=e,this.x=t,this.y=n}Ne.prototype={constructor:Ne,scale:function(e){return e===1?this:new Ne(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ne(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ln=new Ne(1,0,0);Us.prototype=Ne.prototype;function Us(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ln;return e.__zoom}function _n(e){e.stopImmediatePropagation()}function ct(e){e.preventDefault(),e.stopImmediatePropagation()}function Xf(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Uf(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Ti(){return this.__zoom||ln}function Kf(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Zf(){return navigator.maxTouchPoints||"ontouchstart"in this}function Qf(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function Ks(){var e=Xf,t=Uf,n=Qf,r=Kf,i=Zf,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Ft,d=on("start","zoom","end"),u,c,f,h=500,p=150,x=0,m=10;function y(E){E.property("__zoom",Ti).on("wheel.zoom",b,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",A).filter(i).on("touchstart.zoom",S).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",j).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(E,P,L,D){var O=E.selection?E.selection():E;O.property("__zoom",Ti),E!==O?k(E,P,L,D):O.interrupt().each(function(){_(this,arguments).event(D).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},y.scaleBy=function(E,P,L,D){y.scaleTo(E,function(){var O=this.__zoom.k,R=typeof P=="function"?P.apply(this,arguments):P;return O*R},L,D)},y.scaleTo=function(E,P,L,D){y.transform(E,function(){var O=t.apply(this,arguments),R=this.__zoom,H=L==null?w(O):typeof L=="function"?L.apply(this,arguments):L,q=R.invert(H),F=typeof P=="function"?P.apply(this,arguments):P;return n(g(v(R,F),H,q),O,o)},L,D)},y.translateBy=function(E,P,L,D){y.transform(E,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof L=="function"?L.apply(this,arguments):L),t.apply(this,arguments),o)},null,D)},y.translateTo=function(E,P,L,D,O){y.transform(E,function(){var R=t.apply(this,arguments),H=this.__zoom,q=D==null?w(R):typeof D=="function"?D.apply(this,arguments):D;return n(ln.translate(q[0],q[1]).scale(H.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof L=="function"?-L.apply(this,arguments):-L),R,o)},D,O)};function v(E,P){return P=Math.max(s[0],Math.min(s[1],P)),P===E.k?E:new Ne(P,E.x,E.y)}function g(E,P,L){var D=P[0]-L[0]*E.k,O=P[1]-L[1]*E.k;return D===E.x&&O===E.y?E:new Ne(E.k,D,O)}function w(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function k(E,P,L,D){E.on("start.zoom",function(){_(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(D).end()}).tween("zoom",function(){var O=this,R=arguments,H=_(O,R).event(D),q=t.apply(O,R),F=L==null?w(q):typeof L=="function"?L.apply(O,R):L,T=Math.max(q[1][0]-q[0][0],q[1][1]-q[0][1]),$=O.__zoom,z=typeof P=="function"?P.apply(O,R):P,B=l($.invert(F).concat(T/$.k),z.invert(F).concat(T/z.k));return function(G){if(G===1)G=z;else{var Y=B(G),W=T/Y[2];G=new Ne(W,F[0]-Y[0]*W,F[1]-Y[1]*W)}H.zoom(null,G)}})}function _(E,P,L){return!L&&E.__zooming||new M(E,P)}function M(E,P){this.that=E,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,P),this.taps=0}M.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,P){return this.mouse&&E!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var P=ue(this.that).datum();d.call(E,this.that,new Wf(E,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:d}),P)}};function b(E,...P){if(!e.apply(this,arguments))return;var L=_(this,P).event(E),D=this.__zoom,O=Math.max(s[0],Math.min(s[1],D.k*Math.pow(2,r.apply(this,arguments)))),R=fe(E);if(L.wheel)(L.mouse[0][0]!==R[0]||L.mouse[0][1]!==R[1])&&(L.mouse[1]=D.invert(L.mouse[0]=R)),clearTimeout(L.wheel);else{if(D.k===O)return;L.mouse=[R,D.invert(R)],Yt(this),L.start()}ct(E),L.wheel=setTimeout(H,p),L.zoom("mouse",n(g(v(D,O),L.mouse[0],L.mouse[1]),L.extent,o));function H(){L.wheel=null,L.end()}}function N(E,...P){if(f||!e.apply(this,arguments))return;var L=E.currentTarget,D=_(this,P,!0).event(E),O=ue(E.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",T,!0),R=fe(E,L),H=E.clientX,q=E.clientY;Ps(E.view),_n(E),D.mouse=[R,this.__zoom.invert(R)],Yt(this),D.start();function F($){if(ct($),!D.moved){var z=$.clientX-H,B=$.clientY-q;D.moved=z*z+B*B>x}D.event($).zoom("mouse",n(g(D.that.__zoom,D.mouse[0]=fe($,L),D.mouse[1]),D.extent,o))}function T($){O.on("mousemove.zoom mouseup.zoom",null),Rs($.view,D.moved),ct($),D.event($).end()}}function A(E,...P){if(e.apply(this,arguments)){var L=this.__zoom,D=fe(E.changedTouches?E.changedTouches[0]:E,this),O=L.invert(D),R=L.k*(E.shiftKey?.5:2),H=n(g(v(L,R),D,O),t.apply(this,P),o);ct(E),a>0?ue(this).transition().duration(a).call(k,H,D,E):ue(this).call(y.transform,H,D,E)}}function S(E,...P){if(e.apply(this,arguments)){var L=E.touches,D=L.length,O=_(this,P,E.changedTouches.length===D).event(E),R,H,q,F;for(_n(E),H=0;H<D;++H)q=L[H],F=fe(q,this),F=[F,this.__zoom.invert(F),q.identifier],O.touch0?!O.touch1&&O.touch0[2]!==F[2]&&(O.touch1=F,O.taps=0):(O.touch0=F,R=!0,O.taps=1+!!u);u&&(u=clearTimeout(u)),R&&(O.taps<2&&(c=F[0],u=setTimeout(function(){u=null},h)),Yt(this),O.start())}}function C(E,...P){if(this.__zooming){var L=_(this,P).event(E),D=E.changedTouches,O=D.length,R,H,q,F;for(ct(E),R=0;R<O;++R)H=D[R],q=fe(H,this),L.touch0&&L.touch0[2]===H.identifier?L.touch0[0]=q:L.touch1&&L.touch1[2]===H.identifier&&(L.touch1[0]=q);if(H=L.that.__zoom,L.touch1){var T=L.touch0[0],$=L.touch0[1],z=L.touch1[0],B=L.touch1[1],G=(G=z[0]-T[0])*G+(G=z[1]-T[1])*G,Y=(Y=B[0]-$[0])*Y+(Y=B[1]-$[1])*Y;H=v(H,Math.sqrt(G/Y)),q=[(T[0]+z[0])/2,(T[1]+z[1])/2],F=[($[0]+B[0])/2,($[1]+B[1])/2]}else if(L.touch0)q=L.touch0[0],F=L.touch0[1];else return;L.zoom("touch",n(g(H,q,F),L.extent,o))}}function j(E,...P){if(this.__zooming){var L=_(this,P).event(E),D=E.changedTouches,O=D.length,R,H;for(_n(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),R=0;R<O;++R)H=D[R],L.touch0&&L.touch0[2]===H.identifier?delete L.touch0:L.touch1&&L.touch1[2]===H.identifier&&delete L.touch1;if(L.touch1&&!L.touch0&&(L.touch0=L.touch1,delete L.touch1),L.touch0)L.touch0[1]=this.__zoom.invert(L.touch0[0]);else if(L.end(),L.taps===2&&(H=fe(H,this),Math.hypot(c[0]-H[0],c[1]-H[1])<m)){var q=ue(this).on("dblclick.zoom");q&&q.apply(this,arguments)}}}return y.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:$t(+E),y):r},y.filter=function(E){return arguments.length?(e=typeof E=="function"?E:$t(!!E),y):e},y.touchable=function(E){return arguments.length?(i=typeof E=="function"?E:$t(!!E),y):i},y.extent=function(E){return arguments.length?(t=typeof E=="function"?E:$t([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),y):t},y.scaleExtent=function(E){return arguments.length?(s[0]=+E[0],s[1]=+E[1],y):[s[0],s[1]]},y.translateExtent=function(E){return arguments.length?(o[0][0]=+E[0][0],o[1][0]=+E[1][0],o[0][1]=+E[0][1],o[1][1]=+E[1][1],y):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},y.constrain=function(E){return arguments.length?(n=E,y):n},y.duration=function(E){return arguments.length?(a=+E,y):a},y.interpolate=function(E){return arguments.length?(l=E,y):l},y.on=function(){var E=d.on.apply(d,arguments);return E===d?y:E},y.clickDistance=function(E){return arguments.length?(x=(E=+E)*E,y):Math.sqrt(x)},y.tapDistance=function(E){return arguments.length?(m=+E,y):m},y}const ve={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},yt=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Zs=["Enter"," ","Escape"],Qs={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Ze;(function(e){e.Strict="strict",e.Loose="loose"})(Ze||(Ze={}));var De;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(De||(De={}));var xt;(function(e){e.Partial="partial",e.Full="full"})(xt||(xt={}));const Js={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ae;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ae||(Ae={}));var Jt;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Jt||(Jt={}));var K;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(K||(K={}));const Li={[K.Left]:K.Right,[K.Right]:K.Left,[K.Top]:K.Bottom,[K.Bottom]:K.Top};function ea(e){return e===null?null:e?"valid":"invalid"}const ta=e=>"id"in e&&"source"in e&&"target"in e,Jf=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Xr=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Nt=(e,t=[0,0])=>{const{width:n,height:r}=ke(e),i=e.origin??t,s=n*i[0],o=r*i[1];return{x:e.position.x-s,y:e.position.y-o}},eh=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const s=typeof i=="string";let o=!t.nodeLookup&&!s?i:void 0;t.nodeLookup&&(o=s?t.nodeLookup.get(i):Xr(i)?i:t.nodeLookup.get(i.id));const a=o?en(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return un(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return dn(n)},St=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=un(n,en(i)),r=!0)}),r?dn(n):{x:0,y:0,width:0,height:0}},Ur=(e,t,[n,r,i]=[0,0,1],s=!1,o=!1)=>{const a={...Ct(t,[n,r,i]),width:t.width/i,height:t.height/i},l=[];for(const d of e.values()){const{measured:u,selectable:c=!0,hidden:f=!1}=d;if(o&&!c||f)continue;const h=u.width??d.width??d.initialWidth??null,p=u.height??d.height??d.initialHeight??null,x=wt(a,Je(d)),m=(h??0)*(p??0),y=s&&x>0;(!d.internals.handleBounds||y||x>=m||d.dragging)&&l.push(d)}return l},th=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function nh(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function rh({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:s},o){if(e.size===0)return Promise.resolve(!0);const a=nh(e,o),l=St(a),d=Kr(l,t,n,(o==null?void 0:o.minZoom)??i,(o==null?void 0:o.maxZoom)??s,(o==null?void 0:o.padding)??.1);return await r.setViewport(d,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),Promise.resolve(!0)}function na({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){const o=n.get(e),a=o.parentId?n.get(o.parentId):void 0,{x:l,y:d}=a?a.internals.positionAbsolute:{x:0,y:0},u=o.origin??r;let c=o.extent||i;if(o.extent==="parent"&&!o.expandParent)if(!a)s==null||s("005",ve.error005());else{const h=a.measured.width,p=a.measured.height;h&&p&&(c=[[l,d],[l+h,d+p]])}else a&&et(o.extent)&&(c=[[o.extent[0][0]+l,o.extent[0][1]+d],[o.extent[1][0]+l,o.extent[1][1]+d]]);const f=et(c)?He(t,c,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(s==null||s("015",ve.error015())),{position:{x:f.x-l+(o.measured.width??0)*u[0],y:f.y-d+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function ih({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const s=new Set(e.map(f=>f.id)),o=[];for(const f of n){if(f.deletable===!1)continue;const h=s.has(f.id),p=!h&&f.parentId&&o.find(x=>x.id===f.parentId);(h||p)&&o.push(f)}const a=new Set(t.map(f=>f.id)),l=r.filter(f=>f.deletable!==!1),u=th(o,l);for(const f of l)a.has(f.id)&&!u.find(p=>p.id===f.id)&&u.push(f);if(!i)return{edges:u,nodes:o};const c=await i({nodes:o,edges:u});return typeof c=="boolean"?c?{edges:u,nodes:o}:{edges:[],nodes:[]}:c}const Qe=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),He=(e={x:0,y:0},t,n)=>({x:Qe(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Qe(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function ra(e,t,n){const{width:r,height:i}=ke(n),{x:s,y:o}=n.internals.positionAbsolute;return He(e,[[s,o],[s+r,o+i]],t)}const Pi=(e,t,n)=>e<t?Qe(Math.abs(e-t),1,t)/t:e>n?-Qe(Math.abs(e-n),1,t)/t:0,ia=(e,t,n=15,r=40)=>{const i=Pi(e.x,r,t.width-r)*n,s=Pi(e.y,r,t.height-r)*n;return[i,s]},un=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Pr=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),dn=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Je=(e,t=[0,0])=>{var i,s;const{x:n,y:r}=Xr(e)?e.internals.positionAbsolute:Nt(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},en=(e,t=[0,0])=>{var i,s;const{x:n,y:r}=Xr(e)?e.internals.positionAbsolute:Nt(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},oa=(e,t)=>dn(un(Pr(e),Pr(t))),wt=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Ri=e=>pe(e.width)&&pe(e.height)&&pe(e.x)&&pe(e.y),pe=e=>!isNaN(e)&&isFinite(e),oh=(e,t)=>{},kt=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Ct=({x:e,y:t},[n,r,i],s=!1,o=[1,1])=>{const a={x:(e-n)/i,y:(t-r)/i};return s?kt(a,o):a},tn=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function qe(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function sh(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=qe(e,n),i=qe(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=qe(e.top??e.y??0,n),i=qe(e.bottom??e.y??0,n),s=qe(e.left??e.x??0,t),o=qe(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:s,x:s+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function ah(e,t,n,r,i,s){const{x:o,y:a}=tn(e,[t,n,r]),{x:l,y:d}=tn({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-l,c=s-d;return{left:Math.floor(o),top:Math.floor(a),right:Math.floor(u),bottom:Math.floor(c)}}const Kr=(e,t,n,r,i,s)=>{const o=sh(s,t,n),a=(t-o.x)/e.width,l=(n-o.y)/e.height,d=Math.min(a,l),u=Qe(d,r,i),c=e.x+e.width/2,f=e.y+e.height/2,h=t/2-c*u,p=n/2-f*u,x=ah(e,h,p,u,t,n),m={left:Math.min(x.left-o.left,0),top:Math.min(x.top-o.top,0),right:Math.min(x.right-o.right,0),bottom:Math.min(x.bottom-o.bottom,0)};return{x:h-m.left+m.right,y:p-m.top+m.bottom,zoom:u}},vt=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function et(e){return e!=null&&e!=="parent"}function ke(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function sa(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function aa(e,t={width:0,height:0},n,r,i){const s={...e},o=r.get(n);if(o){const a=o.origin||i;s.x+=o.internals.positionAbsolute.x-(t.width??0)*a[0],s.y+=o.internals.positionAbsolute.y-(t.height??0)*a[1]}return s}function $i(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function ch(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function lh(e){return{...Qs,...e||{}}}function ft(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:s,y:o}=ge(e),a=Ct({x:s-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:l,y:d}=n?kt(a,t):a;return{xSnapped:l,ySnapped:d,...a}}const Zr=e=>({width:e.offsetWidth,height:e.offsetHeight}),ca=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},uh=["INPUT","SELECT","TEXTAREA"];function la(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:uh.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const ua=e=>"clientX"in e,ge=(e,t)=>{var s,o;const n=ua(e),r=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,i=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},Oi=(e,t,n,r,i)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(o=>{const a=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:i,position:o.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...Zr(o)}})};function da({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:o,targetControlY:a}){const l=e*.125+i*.375+o*.375+n*.125,d=t*.125+s*.375+a*.375+r*.125,u=Math.abs(l-e),c=Math.abs(d-t);return[l,d,u,c]}function Ot(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ji({pos:e,x1:t,y1:n,x2:r,y2:i,c:s}){switch(e){case K.Left:return[t-Ot(t-r,s),n];case K.Right:return[t+Ot(r-t,s),n];case K.Top:return[t,n-Ot(n-i,s)];case K.Bottom:return[t,n+Ot(i-n,s)]}}function Qr({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:i,targetPosition:s=K.Top,curvature:o=.25}){const[a,l]=ji({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[d,u]=ji({pos:s,x1:r,y1:i,x2:e,y2:t,c:o}),[c,f,h,p]=da({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:d,targetControlY:u});return[`M${e},${t} C${a},${l} ${d},${u} ${r},${i}`,c,f,h,p]}function fa({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,s=n<e?n+i:n-i,o=Math.abs(r-t)/2,a=r<t?r+o:r-o;return[s,a,i,o]}function dh({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:s="basic"}){if(s==="manual")return r;const o=i&&n?r+1e3:r,a=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return o+a}function fh({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const s=un(en(e),en(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const o={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return wt(o,dn(s))>0}const hh=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,ph=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),gh=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||hh;let i;return ta(e)?i={...e}:i={...e,id:r(e)},ph(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function ha({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,s,o,a]=fa({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,s,o,a]}const Di={[K.Left]:{x:-1,y:0},[K.Right]:{x:1,y:0},[K.Top]:{x:0,y:-1},[K.Bottom]:{x:0,y:1}},mh=({source:e,sourcePosition:t=K.Bottom,target:n})=>t===K.Left||t===K.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},zi=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function yh({source:e,sourcePosition:t=K.Bottom,target:n,targetPosition:r=K.Top,center:i,offset:s,stepPosition:o}){const a=Di[t],l=Di[r],d={x:e.x+a.x*s,y:e.y+a.y*s},u={x:n.x+l.x*s,y:n.y+l.y*s},c=mh({source:d,sourcePosition:t,target:u}),f=c.x!==0?"x":"y",h=c[f];let p=[],x,m;const y={x:0,y:0},v={x:0,y:0},[,,g,w]=fa({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*l[f]===-1){f==="x"?(x=i.x??d.x+(u.x-d.x)*o,m=i.y??(d.y+u.y)/2):(x=i.x??(d.x+u.x)/2,m=i.y??d.y+(u.y-d.y)*o);const _=[{x,y:d.y},{x,y:u.y}],M=[{x:d.x,y:m},{x:u.x,y:m}];a[f]===h?p=f==="x"?_:M:p=f==="x"?M:_}else{const _=[{x:d.x,y:u.y}],M=[{x:u.x,y:d.y}];if(f==="x"?p=a.x===h?M:_:p=a.y===h?_:M,t===r){const C=Math.abs(e[f]-n[f]);if(C<=s){const j=Math.min(s-1,s-C);a[f]===h?y[f]=(d[f]>e[f]?-1:1)*j:v[f]=(u[f]>n[f]?-1:1)*j}}if(t!==r){const C=f==="x"?"y":"x",j=a[f]===l[C],E=d[C]>u[C],P=d[C]<u[C];(a[f]===1&&(!j&&E||j&&P)||a[f]!==1&&(!j&&P||j&&E))&&(p=f==="x"?_:M)}const b={x:d.x+y.x,y:d.y+y.y},N={x:u.x+v.x,y:u.y+v.y},A=Math.max(Math.abs(b.x-p[0].x),Math.abs(N.x-p[0].x)),S=Math.max(Math.abs(b.y-p[0].y),Math.abs(N.y-p[0].y));A>=S?(x=(b.x+N.x)/2,m=p[0].y):(x=p[0].x,m=(b.y+N.y)/2)}return[[e,{x:d.x+y.x,y:d.y+y.y},...p,{x:u.x+v.x,y:u.y+v.y},n],x,m,g,w]}function xh(e,t,n,r){const i=Math.min(zi(e,t)/2,zi(t,n)/2,r),{x:s,y:o}=t;if(e.x===s&&s===n.x||e.y===o&&o===n.y)return`L${s} ${o}`;if(e.y===o){const d=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${s+i*d},${o}Q ${s},${o} ${s},${o+i*u}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${s},${o+i*l}Q ${s},${o} ${s+i*a},${o}`}function Rr({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:i,targetPosition:s=K.Top,borderRadius:o=5,centerX:a,centerY:l,offset:d=20,stepPosition:u=.5}){const[c,f,h,p,x]=yh({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:a,y:l},offset:d,stepPosition:u});return[c.reduce((y,v,g)=>{let w="";return g>0&&g<c.length-1?w=xh(c[g-1],v,c[g+1],o):w=`${g===0?"M":"L"}${v.x} ${v.y}`,y+=w,y},""),f,h,p,x]}function Vi(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function wh(e){var c;const{sourceNode:t,targetNode:n}=e;if(!Vi(t)||!Vi(n))return null;const r=t.internals.handleBounds||Hi(t.handles),i=n.internals.handleBounds||Hi(n.handles),s=Fi((r==null?void 0:r.source)??[],e.sourceHandle),o=Fi(e.connectionMode===Ze.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!s||!o)return(c=e.onError)==null||c.call(e,"008",ve.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(s==null?void 0:s.position)||K.Bottom,l=(o==null?void 0:o.position)||K.Top,d=Fe(t,s,a),u=Fe(n,o,l);return{sourceX:d.x,sourceY:d.y,targetX:u.x,targetY:u.y,sourcePosition:a,targetPosition:l}}function Hi(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Fe(e,t,n=K.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,s=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:a}=t??ke(e);if(r)return{x:i+o/2,y:s+a/2};switch((t==null?void 0:t.position)??n){case K.Top:return{x:i+o/2,y:s};case K.Right:return{x:i+o,y:s+a/2};case K.Bottom:return{x:i+o/2,y:s+a};case K.Left:return{x:i,y:s+a/2}}}function Fi(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function $r(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function vh(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const s=new Set;return e.reduce((o,a)=>([a.markerStart||r,a.markerEnd||i].forEach(l=>{if(l&&typeof l=="object"){const d=$r(l,t);s.has(d)||(o.push({id:d,color:l.color||n,...l}),s.add(d))}}),o),[]).sort((o,a)=>o.id.localeCompare(a.id))}const pa=1e3,bh=10,Jr={nodeOrigin:[0,0],nodeExtent:yt,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_h={...Jr,checkEquality:!0};function ei(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Eh(e,t,n){const r=ei(Jr,n);for(const i of e.values())if(i.parentId)ni(i,e,t,r);else{const s=Nt(i,r.nodeOrigin),o=et(i.extent)?i.extent:r.nodeExtent,a=He(s,o,ke(i));i.internals.positionAbsolute=a}}function Nh(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const i of e.handles){const s={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(s):i.type==="target"&&r.push(s)}return{source:n,target:r}}function ti(e){return e==="manual"}function Or(e,t,n,r={}){var d,u;const i=ei(_h,r),s={i:0},o=new Map(t),a=i!=null&&i.elevateNodesOnSelect&&!ti(i.zIndexMode)?pa:0;let l=e.length>0;t.clear(),n.clear();for(const c of e){let f=o.get(c.id);if(i.checkEquality&&c===(f==null?void 0:f.internals.userNode))t.set(c.id,f);else{const h=Nt(c,i.nodeOrigin),p=et(c.extent)?c.extent:i.nodeExtent,x=He(h,p,ke(c));f={...i.defaults,...c,measured:{width:(d=c.measured)==null?void 0:d.width,height:(u=c.measured)==null?void 0:u.height},internals:{positionAbsolute:x,handleBounds:Nh(c,f),z:ga(c,a,i.zIndexMode),userNode:c}},t.set(c.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(l=!1),c.parentId&&ni(f,t,n,r,s)}return l}function Sh(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function ni(e,t,n,r,i){const{elevateNodesOnSelect:s,nodeOrigin:o,nodeExtent:a,zIndexMode:l}=ei(Jr,r),d=e.parentId,u=t.get(d);if(!u){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Sh(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&l==="auto"&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*bh),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);const c=s&&!ti(l)?pa:0,{x:f,y:h,z:p}=kh(e,u,o,a,c,l),{positionAbsolute:x}=e.internals,m=f!==x.x||h!==x.y;(m||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:m?{x:f,y:h}:x,z:p}})}function ga(e,t,n){const r=pe(e.zIndex)?e.zIndex:0;return ti(n)?r:r+(e.selected?t:0)}function kh(e,t,n,r,i,s){const{x:o,y:a}=t.internals.positionAbsolute,l=ke(e),d=Nt(e,n),u=et(e.extent)?He(d,e.extent,l):d;let c=He({x:o+u.x,y:a+u.y},r,l);e.extent==="parent"&&(c=ra(c,l,t));const f=ga(e,i,s),h=t.internals.z??0;return{x:c.x,y:c.y,z:h>=f?h+1:f}}function ri(e,t,n,r=[0,0]){var o;const i=[],s=new Map;for(const a of e){const l=t.get(a.parentId);if(!l)continue;const d=((o=s.get(a.parentId))==null?void 0:o.expandedRect)??Je(l),u=oa(d,a.rect);s.set(a.parentId,{expandedRect:u,parent:l})}return s.size>0&&s.forEach(({expandedRect:a,parent:l},d)=>{var g;const u=l.internals.positionAbsolute,c=ke(l),f=l.origin??r,h=a.x<u.x?Math.round(Math.abs(u.x-a.x)):0,p=a.y<u.y?Math.round(Math.abs(u.y-a.y)):0,x=Math.max(c.width,Math.round(a.width)),m=Math.max(c.height,Math.round(a.height)),y=(x-c.width)*f[0],v=(m-c.height)*f[1];(h>0||p>0||y||v)&&(i.push({id:d,type:"position",position:{x:l.position.x-h+y,y:l.position.y-p+v}}),(g=n.get(d))==null||g.forEach(w=>{e.some(k=>k.id===w.id)||i.push({id:w.id,type:"position",position:{x:w.position.x+h,y:w.position.y+p}})})),(c.width<a.width||c.height<a.height||h||p)&&i.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:x+(h?f[0]*h-y:0),height:m+(p?f[1]*p-v:0)}})}),i}function Ch(e,t,n,r,i,s,o){const a=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const d=[],u=window.getComputedStyle(a),{m22:c}=new window.DOMMatrixReadOnly(u.transform),f=[];for(const h of e.values()){const p=t.get(h.id);if(!p)continue;if(p.hidden){t.set(p.id,{...p,internals:{...p.internals,handleBounds:void 0}}),l=!0;continue}const x=Zr(h.nodeElement),m=p.measured.width!==x.width||p.measured.height!==x.height;if(!!(x.width&&x.height&&(m||!p.internals.handleBounds||h.force))){const v=h.nodeElement.getBoundingClientRect(),g=et(p.extent)?p.extent:s;let{positionAbsolute:w}=p.internals;p.parentId&&p.extent==="parent"?w=ra(w,x,t.get(p.parentId)):g&&(w=He(w,g,x));const k={...p,measured:x,internals:{...p.internals,positionAbsolute:w,handleBounds:{source:Oi("source",h.nodeElement,v,c,p.id),target:Oi("target",h.nodeElement,v,c,p.id)}}};t.set(p.id,k),p.parentId&&ni(k,t,n,{nodeOrigin:i,zIndexMode:o}),l=!0,m&&(d.push({id:p.id,type:"dimensions",dimensions:x}),p.expandParent&&p.parentId&&f.push({id:p.id,parentId:p.parentId,rect:Je(k,i)}))}}if(f.length>0){const h=ri(f,t,n,i);d.push(...h)}return{changes:d,updatedInternals:l}}async function Mh({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:s}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,s]],r),a=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(a)}function Bi(e,t,n,r,i,s){let o=i;const a=r.get(o)||new Map;r.set(o,a.set(n,t)),o=`${i}-${e}`;const l=r.get(o)||new Map;if(r.set(o,l.set(n,t)),s){o=`${i}-${e}-${s}`;const d=r.get(o)||new Map;r.set(o,d.set(n,t))}}function ma(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:s,sourceHandle:o=null,targetHandle:a=null}=r,l={edgeId:r.id,source:i,target:s,sourceHandle:o,targetHandle:a},d=`${i}-${o}--${s}-${a}`,u=`${s}-${a}--${i}-${o}`;Bi("source",l,u,e,i,o),Bi("target",l,d,e,s,a),t.set(r.id,r)}}function ya(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:ya(n,t):!1}function qi(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Ih(e,t,n,r){const i=new Map;for(const[s,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!ya(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const a=e.get(s);a&&i.set(s,{id:s,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return i}function En({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,a,l;const i=[];for(const[d,u]of t){const c=(o=n.get(d))==null?void 0:o.internals.userNode;c&&i.push({...c,position:u.position,dragging:r})}if(!e)return[i[0],i];const s=(a=n.get(e))==null?void 0:a.internals.userNode;return[s?{...s,position:((l=t.get(e))==null?void 0:l.position)||s.position,dragging:r}:i[0],i]}function Ah({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const s={x:n-i.distance.x,y:r-i.distance.y},o=kt(s,t);return{x:o.x-s.x,y:o.y-s.y}}function Th({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},o=0,a=new Map,l=!1,d={x:0,y:0},u=null,c=!1,f=null,h=!1,p=!1,x=null;function m({noDragClassName:v,handleSelector:g,domNode:w,isSelectable:k,nodeId:_,nodeClickDistance:M=0}){f=ue(w);function b({x:C,y:j}){const{nodeLookup:E,nodeExtent:P,snapGrid:L,snapToGrid:D,nodeOrigin:O,onNodeDrag:R,onSelectionDrag:H,onError:q,updateNodePositions:F}=t();s={x:C,y:j};let T=!1;const $=a.size>1,z=$&&P?Pr(St(a)):null,B=$&&D?Ah({dragItems:a,snapGrid:L,x:C,y:j}):null;for(const[G,Y]of a){if(!E.has(G))continue;let W={x:C-Y.distance.x,y:j-Y.distance.y};D&&(W=B?{x:Math.round(W.x+B.x),y:Math.round(W.y+B.y)}:kt(W,L));let Z=null;if($&&P&&!Y.extent&&z){const{positionAbsolute:X}=Y.internals,J=X.x-z.x+P[0][0],ne=X.x+Y.measured.width-z.x2+P[1][0],ee=X.y-z.y+P[0][1],ce=X.y+Y.measured.height-z.y2+P[1][1];Z=[[J,ee],[ne,ce]]}const{position:Q,positionAbsolute:U}=na({nodeId:G,nextPosition:W,nodeLookup:E,nodeExtent:Z||P,nodeOrigin:O,onError:q});T=T||Y.position.x!==Q.x||Y.position.y!==Q.y,Y.position=Q,Y.internals.positionAbsolute=U}if(p=p||T,!!T&&(F(a,!0),x&&(r||R||!_&&H))){const[G,Y]=En({nodeId:_,dragItems:a,nodeLookup:E});r==null||r(x,a,G,Y),R==null||R(x,G,Y),_||H==null||H(x,Y)}}async function N(){if(!u)return;const{transform:C,panBy:j,autoPanSpeed:E,autoPanOnNodeDrag:P}=t();if(!P){l=!1,cancelAnimationFrame(o);return}const[L,D]=ia(d,u,E);(L!==0||D!==0)&&(s.x=(s.x??0)-L/C[2],s.y=(s.y??0)-D/C[2],await j({x:L,y:D})&&b(s)),o=requestAnimationFrame(N)}function A(C){var $;const{nodeLookup:j,multiSelectionActive:E,nodesDraggable:P,transform:L,snapGrid:D,snapToGrid:O,selectNodesOnDrag:R,onNodeDragStart:H,onSelectionDragStart:q,unselectNodesAndEdges:F}=t();c=!0,(!R||!k)&&!E&&_&&(($=j.get(_))!=null&&$.selected||F()),k&&R&&_&&(e==null||e(_));const T=ft(C.sourceEvent,{transform:L,snapGrid:D,snapToGrid:O,containerBounds:u});if(s=T,a=Ih(j,P,T,_),a.size>0&&(n||H||!_&&q)){const[z,B]=En({nodeId:_,dragItems:a,nodeLookup:j});n==null||n(C.sourceEvent,a,z,B),H==null||H(C.sourceEvent,z,B),_||q==null||q(C.sourceEvent,B)}}const S=$s().clickDistance(M).on("start",C=>{const{domNode:j,nodeDragThreshold:E,transform:P,snapGrid:L,snapToGrid:D}=t();u=(j==null?void 0:j.getBoundingClientRect())||null,h=!1,p=!1,x=C.sourceEvent,E===0&&A(C),s=ft(C.sourceEvent,{transform:P,snapGrid:L,snapToGrid:D,containerBounds:u}),d=ge(C.sourceEvent,u)}).on("drag",C=>{const{autoPanOnNodeDrag:j,transform:E,snapGrid:P,snapToGrid:L,nodeDragThreshold:D,nodeLookup:O}=t(),R=ft(C.sourceEvent,{transform:E,snapGrid:P,snapToGrid:L,containerBounds:u});if(x=C.sourceEvent,(C.sourceEvent.type==="touchmove"&&C.sourceEvent.touches.length>1||_&&!O.has(_))&&(h=!0),!h){if(!l&&j&&c&&(l=!0,N()),!c){const H=ge(C.sourceEvent,u),q=H.x-d.x,F=H.y-d.y;Math.sqrt(q*q+F*F)>D&&A(C)}(s.x!==R.xSnapped||s.y!==R.ySnapped)&&a&&c&&(d=ge(C.sourceEvent,u),b(R))}}).on("end",C=>{if(!(!c||h)&&(l=!1,c=!1,cancelAnimationFrame(o),a.size>0)){const{nodeLookup:j,updateNodePositions:E,onNodeDragStop:P,onSelectionDragStop:L}=t();if(p&&(E(a,!1),p=!1),i||P||!_&&L){const[D,O]=En({nodeId:_,dragItems:a,nodeLookup:j,dragging:!1});i==null||i(C.sourceEvent,a,D,O),P==null||P(C.sourceEvent,D,O),_||L==null||L(C.sourceEvent,O)}}}).filter(C=>{const j=C.target;return!C.button&&(!v||!qi(j,`.${v}`,w))&&(!g||qi(j,g,w))});f.call(S)}function y(){f==null||f.on(".drag",null)}return{update:m,destroy:y}}function Lh(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())wt(i,Je(s))>0&&r.push(s);return r}const Ph=250;function Rh(e,t,n,r){var a,l;let i=[],s=1/0;const o=Lh(e,n,t+Ph);for(const d of o){const u=[...((a=d.internals.handleBounds)==null?void 0:a.source)??[],...((l=d.internals.handleBounds)==null?void 0:l.target)??[]];for(const c of u){if(r.nodeId===c.nodeId&&r.type===c.type&&r.id===c.id)continue;const{x:f,y:h}=Fe(d,c,c.position,!0),p=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(h-e.y,2));p>t||(p<s?(i=[{...c,x:f,y:h}],s=p):p===s&&i.push({...c,x:f,y:h}))}}if(!i.length)return null;if(i.length>1){const d=r.type==="source"?"target":"source";return i.find(u=>u.type===d)??i[0]}return i[0]}function xa(e,t,n,r,i,s=!1){var d,u,c;const o=r.get(e);if(!o)return null;const a=i==="strict"?(d=o.internals.handleBounds)==null?void 0:d[t]:[...((u=o.internals.handleBounds)==null?void 0:u.source)??[],...((c=o.internals.handleBounds)==null?void 0:c.target)??[]],l=(n?a==null?void 0:a.find(f=>f.id===n):a==null?void 0:a[0])??null;return l&&s?{...l,...Fe(o,l,l.position,!0)}:l}function wa(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function $h(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const va=()=>!0;function Oh(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:o,domNode:a,nodeLookup:l,lib:d,autoPanOnConnect:u,flowId:c,panBy:f,cancelConnection:h,onConnectStart:p,onConnect:x,onConnectEnd:m,isValidConnection:y=va,onReconnectEnd:v,updateConnection:g,getTransform:w,getFromHandle:k,autoPanSpeed:_,dragThreshold:M=1,handleDomNode:b}){const N=ca(e.target);let A=0,S;const{x:C,y:j}=ge(e),E=wa(s,b),P=a==null?void 0:a.getBoundingClientRect();let L=!1;if(!P||!E)return;const D=xa(i,E,r,l,t);if(!D)return;let O=ge(e,P),R=!1,H=null,q=!1,F=null;function T(){if(!u||!P)return;const[Q,U]=ia(O,P,_);f({x:Q,y:U}),A=requestAnimationFrame(T)}const $={...D,nodeId:i,type:E,position:D.position},z=l.get(i);let G={inProgress:!0,isValid:null,from:Fe(z,$,K.Left,!0),fromHandle:$,fromPosition:$.position,fromNode:z,to:O,toHandle:null,toPosition:Li[$.position],toNode:null,pointer:O};function Y(){L=!0,g(G),p==null||p(e,{nodeId:i,handleId:r,handleType:E})}M===0&&Y();function W(Q){if(!L){const{x:ce,y:Ce}=ge(Q),_e=ce-C,Pe=Ce-j;if(!(_e*_e+Pe*Pe>M*M))return;Y()}if(!k()||!$){Z(Q);return}const U=w();O=ge(Q,P),S=Rh(Ct(O,U,!1,[1,1]),n,l,$),R||(T(),R=!0);const X=ba(Q,{handle:S,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:y,doc:N,lib:d,flowId:c,nodeLookup:l});F=X.handleDomNode,H=X.connection,q=$h(!!S,X.isValid);const J=l.get(i),ne=J?Fe(J,$,K.Left,!0):G.from,ee={...G,from:ne,isValid:q,to:X.toHandle&&q?tn({x:X.toHandle.x,y:X.toHandle.y},U):O,toHandle:X.toHandle,toPosition:q&&X.toHandle?X.toHandle.position:Li[$.position],toNode:X.toHandle?l.get(X.toHandle.nodeId):null,pointer:O};g(ee),G=ee}function Z(Q){if(!("touches"in Q&&Q.touches.length>0)){if(L){(S||F)&&H&&q&&(x==null||x(H));const{inProgress:U,...X}=G,J={...X,toPosition:G.toHandle?G.toPosition:null};m==null||m(Q,J),s&&(v==null||v(Q,J))}h(),cancelAnimationFrame(A),R=!1,q=!1,H=null,F=null,N.removeEventListener("mousemove",W),N.removeEventListener("mouseup",Z),N.removeEventListener("touchmove",W),N.removeEventListener("touchend",Z)}}N.addEventListener("mousemove",W),N.addEventListener("mouseup",Z),N.addEventListener("touchmove",W),N.addEventListener("touchend",Z)}function ba(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:o,lib:a,flowId:l,isValidConnection:d=va,nodeLookup:u}){const c=s==="target",f=t?o.querySelector(`.${a}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:h,y:p}=ge(e),x=o.elementFromPoint(h,p),m=x!=null&&x.classList.contains(`${a}-flow__handle`)?x:f,y={handleDomNode:m,isValid:!1,connection:null,toHandle:null};if(m){const v=wa(void 0,m),g=m.getAttribute("data-nodeid"),w=m.getAttribute("data-handleid"),k=m.classList.contains("connectable"),_=m.classList.contains("connectableend");if(!g||!v)return y;const M={source:c?g:r,sourceHandle:c?w:i,target:c?r:g,targetHandle:c?i:w};y.connection=M;const N=k&&_&&(n===Ze.Strict?c&&v==="source"||!c&&v==="target":g!==r||w!==i);y.isValid=N&&d(M),y.toHandle=xa(g,v,w,u,n,!0)}return y}const jr={onPointerDown:Oh,isValid:ba};function jh({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=ue(e);function s({translateExtent:a,width:l,height:d,zoomStep:u=1,pannable:c=!0,zoomable:f=!0,inversePan:h=!1}){const p=g=>{if(g.sourceEvent.type!=="wheel"||!t)return;const w=n(),k=g.sourceEvent.ctrlKey&&vt()?10:1,_=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*u,M=w[2]*Math.pow(2,_*k);t.scaleTo(M)};let x=[0,0];const m=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(x=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},y=g=>{const w=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const k=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],_=[k[0]-x[0],k[1]-x[1]];x=k;const M=r()*Math.max(w[2],Math.log(w[2]))*(h?-1:1),b={x:w[0]-_[0]*M,y:w[1]-_[1]*M},N=[[0,0],[l,d]];t.setViewportConstrained({x:b.x,y:b.y,zoom:w[2]},N,a)},v=Ks().on("start",m).on("zoom",c?y:null).on("zoom.wheel",f?p:null);i.call(v,{})}function o(){i.on("zoom",null)}return{update:s,destroy:o,pointer:fe}}const fn=e=>({x:e.x,y:e.y,zoom:e.k}),Nn=({x:e,y:t,zoom:n})=>ln.translate(e,t).scale(n),Ye=(e,t)=>e.target.closest(`.${t}`),_a=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Dh=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Sn=(e,t=0,n=Dh,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},Ea=e=>{const t=e.ctrlKey&&vt()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function zh({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:o,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:d}){return u=>{if(Ye(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const c=n.property("__zoom").k||1;if(u.ctrlKey&&o){const m=fe(u),y=Ea(u),v=c*Math.pow(2,y);r.scaleTo(n,v,m,u);return}const f=u.deltaMode===1?20:1;let h=i===De.Vertical?0:u.deltaX*f,p=i===De.Horizontal?0:u.deltaY*f;!vt()&&u.shiftKey&&i!==De.Vertical&&(h=u.deltaY*f,p=0),r.translateBy(n,-(h/c)*s,-(p/c)*s,{internal:!0});const x=fn(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(u,x),e.panScrollTimeout=setTimeout(()=>{d==null||d(u,x),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a==null||a(u,x))}}function Vh({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const s=r.type==="wheel",o=!t&&s&&!r.ctrlKey,a=Ye(r,e);if(r.ctrlKey&&s&&a&&r.preventDefault(),o||a)return null;r.preventDefault(),n.call(this,r,i)}}function Hh({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var s,o,a;if((s=r.sourceEvent)!=null&&s.internal)return;const i=fn(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((a=r.sourceEvent)==null?void 0:a.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function Fh({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{var o,a;e.usedRightMouseButton=!!(n&&_a(t,e.mouseButton??0)),(o=s.sourceEvent)!=null&&o.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!((a=s.sourceEvent)!=null&&a.internal)&&(i==null||i(s.sourceEvent,fn(s.transform)))}}function Bh({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return o=>{var a;if(!((a=o.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,s&&_a(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&s(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const l=fn(o.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,l)},n?150:0)}}}function qh({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:o,noWheelClassName:a,noPanClassName:l,lib:d,connectionInProgress:u}){return c=>{var m;const f=e||t,h=n&&c.ctrlKey,p=c.type==="wheel";if(c.button===1&&c.type==="mousedown"&&(Ye(c,`${d}-flow__node`)||Ye(c,`${d}-flow__edge`)))return!0;if(!r&&!f&&!i&&!s&&!n||o||u&&!p||Ye(c,a)&&p||Ye(c,l)&&(!p||i&&p&&!e)||!n&&c.ctrlKey&&p)return!1;if(!n&&c.type==="touchstart"&&((m=c.touches)==null?void 0:m.length)>1)return c.preventDefault(),!1;if(!f&&!i&&!h&&p||!r&&(c.type==="mousedown"||c.type==="touchstart")||Array.isArray(r)&&!r.includes(c.button)&&c.type==="mousedown")return!1;const x=Array.isArray(r)&&r.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||p)&&x}}function Yh({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:s,onPanZoomStart:o,onPanZoomEnd:a,onDraggingChange:l}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),c=Ks().scaleExtent([t,n]).translateExtent(r),f=ue(e).call(c);v({x:i.x,y:i.y,zoom:Qe(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);const h=f.on("wheel.zoom"),p=f.on("dblclick.zoom");c.wheelDelta(Ea);function x(S,C){return f?new Promise(j=>{c==null||c.interpolate((C==null?void 0:C.interpolate)==="linear"?dt:Ft).transform(Sn(f,C==null?void 0:C.duration,C==null?void 0:C.ease,()=>j(!0)),S)}):Promise.resolve(!1)}function m({noWheelClassName:S,noPanClassName:C,onPaneContextMenu:j,userSelectionActive:E,panOnScroll:P,panOnDrag:L,panOnScrollMode:D,panOnScrollSpeed:O,preventScrolling:R,zoomOnPinch:H,zoomOnScroll:q,zoomOnDoubleClick:F,zoomActivationKeyPressed:T,lib:$,onTransformChange:z,connectionInProgress:B,paneClickDistance:G,selectionOnDrag:Y}){E&&!d.isZoomingOrPanning&&y();const W=P&&!T&&!E;c.clickDistance(Y?1/0:!pe(G)||G<0?0:G);const Z=W?zh({zoomPanValues:d,noWheelClassName:S,d3Selection:f,d3Zoom:c,panOnScrollMode:D,panOnScrollSpeed:O,zoomOnPinch:H,onPanZoomStart:o,onPanZoom:s,onPanZoomEnd:a}):Vh({noWheelClassName:S,preventScrolling:R,d3ZoomHandler:h});if(f.on("wheel.zoom",Z,{passive:!1}),!E){const U=Hh({zoomPanValues:d,onDraggingChange:l,onPanZoomStart:o});c.on("start",U);const X=Fh({zoomPanValues:d,panOnDrag:L,onPaneContextMenu:!!j,onPanZoom:s,onTransformChange:z});c.on("zoom",X);const J=Bh({zoomPanValues:d,panOnDrag:L,panOnScroll:P,onPaneContextMenu:j,onPanZoomEnd:a,onDraggingChange:l});c.on("end",J)}const Q=qh({zoomActivationKeyPressed:T,panOnDrag:L,zoomOnScroll:q,panOnScroll:P,zoomOnDoubleClick:F,zoomOnPinch:H,userSelectionActive:E,noPanClassName:C,noWheelClassName:S,lib:$,connectionInProgress:B});c.filter(Q),F?f.on("dblclick.zoom",p):f.on("dblclick.zoom",null)}function y(){c.on("zoom",null)}async function v(S,C,j){const E=Nn(S),P=c==null?void 0:c.constrain()(E,C,j);return P&&await x(P),new Promise(L=>L(P))}async function g(S,C){const j=Nn(S);return await x(j,C),new Promise(E=>E(j))}function w(S){if(f){const C=Nn(S),j=f.property("__zoom");(j.k!==S.zoom||j.x!==S.x||j.y!==S.y)&&(c==null||c.transform(f,C,null,{sync:!0}))}}function k(){const S=f?Us(f.node()):{x:0,y:0,k:1};return{x:S.x,y:S.y,zoom:S.k}}function _(S,C){return f?new Promise(j=>{c==null||c.interpolate((C==null?void 0:C.interpolate)==="linear"?dt:Ft).scaleTo(Sn(f,C==null?void 0:C.duration,C==null?void 0:C.ease,()=>j(!0)),S)}):Promise.resolve(!1)}function M(S,C){return f?new Promise(j=>{c==null||c.interpolate((C==null?void 0:C.interpolate)==="linear"?dt:Ft).scaleBy(Sn(f,C==null?void 0:C.duration,C==null?void 0:C.ease,()=>j(!0)),S)}):Promise.resolve(!1)}function b(S){c==null||c.scaleExtent(S)}function N(S){c==null||c.translateExtent(S)}function A(S){const C=!pe(S)||S<0?0:S;c==null||c.clickDistance(C)}return{update:m,destroy:y,setViewport:g,setViewportConstrained:v,getViewport:k,scaleTo:_,scaleBy:M,setScaleExtent:b,setTranslateExtent:N,syncViewport:w,setClickDistance:A}}var tt;(function(e){e.Line="line",e.Handle="handle"})(tt||(tt={}));function Gh({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:s}){const o=e-t,a=n-r,l=[o>0?1:o<0?-1:0,a>0?1:a<0?-1:0];return o&&i&&(l[0]=l[0]*-1),a&&s&&(l[1]=l[1]*-1),l}function Yi(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function Me(e,t){return Math.max(0,t-e)}function Ie(e,t){return Math.max(0,e-t)}function jt(e,t,n){return Math.max(0,t-e,e-n)}function Gi(e,t){return e?!t:t}function Wh(e,t,n,r,i,s,o,a){let{affectsX:l,affectsY:d}=t;const{isHorizontal:u,isVertical:c}=t,f=u&&c,{xSnapped:h,ySnapped:p}=n,{minWidth:x,maxWidth:m,minHeight:y,maxHeight:v}=r,{x:g,y:w,width:k,height:_,aspectRatio:M}=e;let b=Math.floor(u?h-e.pointerX:0),N=Math.floor(c?p-e.pointerY:0);const A=k+(l?-b:b),S=_+(d?-N:N),C=-s[0]*k,j=-s[1]*_;let E=jt(A,x,m),P=jt(S,y,v);if(o){let O=0,R=0;l&&b<0?O=Me(g+b+C,o[0][0]):!l&&b>0&&(O=Ie(g+A+C,o[1][0])),d&&N<0?R=Me(w+N+j,o[0][1]):!d&&N>0&&(R=Ie(w+S+j,o[1][1])),E=Math.max(E,O),P=Math.max(P,R)}if(a){let O=0,R=0;l&&b>0?O=Ie(g+b,a[0][0]):!l&&b<0&&(O=Me(g+A,a[1][0])),d&&N>0?R=Ie(w+N,a[0][1]):!d&&N<0&&(R=Me(w+S,a[1][1])),E=Math.max(E,O),P=Math.max(P,R)}if(i){if(u){const O=jt(A/M,y,v)*M;if(E=Math.max(E,O),o){let R=0;!l&&!d||l&&!d&&f?R=Ie(w+j+A/M,o[1][1])*M:R=Me(w+j+(l?b:-b)/M,o[0][1])*M,E=Math.max(E,R)}if(a){let R=0;!l&&!d||l&&!d&&f?R=Me(w+A/M,a[1][1])*M:R=Ie(w+(l?b:-b)/M,a[0][1])*M,E=Math.max(E,R)}}if(c){const O=jt(S*M,x,m)/M;if(P=Math.max(P,O),o){let R=0;!l&&!d||d&&!l&&f?R=Ie(g+S*M+C,o[1][0])/M:R=Me(g+(d?N:-N)*M+C,o[0][0])/M,P=Math.max(P,R)}if(a){let R=0;!l&&!d||d&&!l&&f?R=Me(g+S*M,a[1][0])/M:R=Ie(g+(d?N:-N)*M,a[0][0])/M,P=Math.max(P,R)}}}N=N+(N<0?P:-P),b=b+(b<0?E:-E),i&&(f?A>S*M?N=(Gi(l,d)?-b:b)/M:b=(Gi(l,d)?-N:N)*M:u?(N=b/M,d=l):(b=N*M,l=d));const L=l?g+b:g,D=d?w+N:w;return{width:k+(l?-b:b),height:_+(d?-N:N),x:s[0]*b*(l?-1:1)+L,y:s[1]*N*(d?-1:1)+D}}const Na={width:0,height:0,x:0,y:0},Xh={...Na,pointerX:0,pointerY:0,aspectRatio:1};function Uh(e){return[[0,0],[e.measured.width,e.measured.height]]}function Kh(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,s=e.measured.width??0,o=e.measured.height??0,a=n[0]*s,l=n[1]*o;return[[r-a,i-l],[r+s-a,i+o-l]]}function Zh({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const s=ue(e);let o={controlDirection:Yi("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:d,boundaries:u,keepAspectRatio:c,resizeDirection:f,onResizeStart:h,onResize:p,onResizeEnd:x,shouldResize:m}){let y={...Na},v={...Xh};o={boundaries:u,resizeDirection:f,keepAspectRatio:c,controlDirection:Yi(d)};let g,w=null,k=[],_,M,b,N=!1;const A=$s().on("start",S=>{const{nodeLookup:C,transform:j,snapGrid:E,snapToGrid:P,nodeOrigin:L,paneDomNode:D}=n();if(g=C.get(t),!g)return;w=(D==null?void 0:D.getBoundingClientRect())??null;const{xSnapped:O,ySnapped:R}=ft(S.sourceEvent,{transform:j,snapGrid:E,snapToGrid:P,containerBounds:w});y={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},v={...y,pointerX:O,pointerY:R,aspectRatio:y.width/y.height},_=void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(_=C.get(g.parentId),M=_&&g.extent==="parent"?Uh(_):void 0),k=[],b=void 0;for(const[H,q]of C)if(q.parentId===t&&(k.push({id:H,position:{...q.position},extent:q.extent}),q.extent==="parent"||q.expandParent)){const F=Kh(q,g,q.origin??L);b?b=[[Math.min(F[0][0],b[0][0]),Math.min(F[0][1],b[0][1])],[Math.max(F[1][0],b[1][0]),Math.max(F[1][1],b[1][1])]]:b=F}h==null||h(S,{...y})}).on("drag",S=>{const{transform:C,snapGrid:j,snapToGrid:E,nodeOrigin:P}=n(),L=ft(S.sourceEvent,{transform:C,snapGrid:j,snapToGrid:E,containerBounds:w}),D=[];if(!g)return;const{x:O,y:R,width:H,height:q}=y,F={},T=g.origin??P,{width:$,height:z,x:B,y:G}=Wh(v,o.controlDirection,L,o.boundaries,o.keepAspectRatio,T,M,b),Y=$!==H,W=z!==q,Z=B!==O&&Y,Q=G!==R&&W;if(!Z&&!Q&&!Y&&!W)return;if((Z||Q||T[0]===1||T[1]===1)&&(F.x=Z?B:y.x,F.y=Q?G:y.y,y.x=F.x,y.y=F.y,k.length>0)){const ne=B-O,ee=G-R;for(const ce of k)ce.position={x:ce.position.x-ne+T[0]*($-H),y:ce.position.y-ee+T[1]*(z-q)},D.push(ce)}if((Y||W)&&(F.width=Y&&(!o.resizeDirection||o.resizeDirection==="horizontal")?$:y.width,F.height=W&&(!o.resizeDirection||o.resizeDirection==="vertical")?z:y.height,y.width=F.width,y.height=F.height),_&&g.expandParent){const ne=T[0]*(F.width??0);F.x&&F.x<ne&&(y.x=ne,v.x=v.x-(F.x-ne));const ee=T[1]*(F.height??0);F.y&&F.y<ee&&(y.y=ee,v.y=v.y-(F.y-ee))}const U=Gh({width:y.width,prevWidth:H,height:y.height,prevHeight:q,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),X={...y,direction:U};(m==null?void 0:m(S,X))!==!1&&(N=!0,p==null||p(S,X),r(F,D))}).on("end",S=>{N&&(x==null||x(S,{...y}),i==null||i({...y}),N=!1)});s.call(A)}function l(){s.on(".drag",null)}return{update:a,destroy:l}}var kn={exports:{}},Cn={},Mn={exports:{}},In={};/**
|
|
1
|
+
var gl=Object.defineProperty;var ml=(e,t,n)=>t in e?gl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oe=(e,t,n)=>ml(e,typeof t!="symbol"?t+"":t,n);import{b as xs,g as ws,t as yl,c as xl,r as V,j as I}from"./index-DSExqypu.js";import{N as Vr,S as vs,E as Te}from"./constants-BIEJOBya.js";function ae(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=ae(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var wl={value:()=>{}};function on(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new Ht(n)}function Ht(e){this._=e}function vl(e,t){return e.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&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}Ht.prototype=on.prototype={constructor:Ht,on:function(e,t){var n=this._,r=vl(e+"",n),i,s=-1,o=r.length;if(arguments.length<2){for(;++s<o;)if((i=(e=r[s]).type)&&(i=bl(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<o;)if(i=(e=r[s]).type)n[i]=gi(n[i],e.name,t);else if(t==null)for(i in n)n[i]=gi(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ht(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function bl(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function gi(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=wl,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Sr="http://www.w3.org/1999/xhtml";const mi={svg:"http://www.w3.org/2000/svg",xhtml:Sr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function sn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),mi.hasOwnProperty(t)?{space:mi[t],local:e}:e}function _l(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Sr&&t.documentElement.namespaceURI===Sr?t.createElement(e):t.createElementNS(n,e)}}function El(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function bs(e){var t=sn(e);return(t.local?El:_l)(t)}function Nl(){}function Hr(e){return e==null?Nl:function(){return this.querySelector(e)}}function Sl(e){typeof e!="function"&&(e=Hr(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],o=s.length,a=r[i]=new Array(o),l,d,u=0;u<o;++u)(l=s[u])&&(d=e.call(l,l.__data__,u,s))&&("__data__"in l&&(d.__data__=l.__data__),a[u]=d);return new de(r,this._parents)}function kl(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Cl(){return[]}function _s(e){return e==null?Cl:function(){return this.querySelectorAll(e)}}function Ml(e){return function(){return kl(e.apply(this,arguments))}}function Il(e){typeof e=="function"?e=Ml(e):e=_s(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var o=t[s],a=o.length,l,d=0;d<a;++d)(l=o[d])&&(r.push(e.call(l,l.__data__,d,o)),i.push(l));return new de(r,i)}function Es(e){return function(){return this.matches(e)}}function Ns(e){return function(t){return t.matches(e)}}var Al=Array.prototype.find;function Tl(e){return function(){return Al.call(this.children,e)}}function Ll(){return this.firstElementChild}function Pl(e){return this.select(e==null?Ll:Tl(typeof e=="function"?e:Ns(e)))}var Rl=Array.prototype.filter;function $l(){return Array.from(this.children)}function Ol(e){return function(){return Rl.call(this.children,e)}}function jl(e){return this.selectAll(e==null?$l:Ol(typeof e=="function"?e:Ns(e)))}function Dl(e){typeof e!="function"&&(e=Es(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],o=s.length,a=r[i]=[],l,d=0;d<o;++d)(l=s[d])&&e.call(l,l.__data__,d,s)&&a.push(l);return new de(r,this._parents)}function Ss(e){return new Array(e.length)}function zl(){return new de(this._enter||this._groups.map(Ss),this._parents)}function Gt(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Gt.prototype={constructor:Gt,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Vl(e){return function(){return e}}function Hl(e,t,n,r,i,s){for(var o=0,a,l=t.length,d=s.length;o<d;++o)(a=t[o])?(a.__data__=s[o],r[o]=a):n[o]=new Gt(e,s[o]);for(;o<l;++o)(a=t[o])&&(i[o]=a)}function Fl(e,t,n,r,i,s,o){var a,l,d=new Map,u=t.length,c=s.length,f=new Array(u),h;for(a=0;a<u;++a)(l=t[a])&&(f[a]=h=o.call(l,l.__data__,a,t)+"",d.has(h)?i[a]=l:d.set(h,l));for(a=0;a<c;++a)h=o.call(e,s[a],a,s)+"",(l=d.get(h))?(r[a]=l,l.__data__=s[a],d.delete(h)):n[a]=new Gt(e,s[a]);for(a=0;a<u;++a)(l=t[a])&&d.get(f[a])===l&&(i[a]=l)}function Bl(e){return e.__data__}function ql(e,t){if(!arguments.length)return Array.from(this,Bl);var n=t?Fl:Hl,r=this._parents,i=this._groups;typeof e!="function"&&(e=Vl(e));for(var s=i.length,o=new Array(s),a=new Array(s),l=new Array(s),d=0;d<s;++d){var u=r[d],c=i[d],f=c.length,h=Yl(e.call(u,u&&u.__data__,d,r)),p=h.length,x=a[d]=new Array(p),m=o[d]=new Array(p),y=l[d]=new Array(f);n(u,c,x,m,y,h,t);for(var v=0,g=0,w,k;v<p;++v)if(w=x[v]){for(v>=g&&(g=v+1);!(k=m[g])&&++g<p;);w._next=k||null}}return o=new de(o,r),o._enter=a,o._exit=l,o}function Yl(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Gl(){return new de(this._exit||this._groups.map(Ss),this._parents)}function Wl(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function Xl(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,o=Math.min(i,s),a=new Array(i),l=0;l<o;++l)for(var d=n[l],u=r[l],c=d.length,f=a[l]=new Array(c),h,p=0;p<c;++p)(h=d[p]||u[p])&&(f[p]=h);for(;l<i;++l)a[l]=n[l];return new de(a,this._parents)}function Ul(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],o;--i>=0;)(o=r[i])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function Kl(e){e||(e=Zl);function t(c,f){return c&&f?e(c.__data__,f.__data__):!c-!f}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var o=n[s],a=o.length,l=i[s]=new Array(a),d,u=0;u<a;++u)(d=o[u])&&(l[u]=d);l.sort(t)}return new de(i,this._parents).order()}function Zl(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Ql(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Jl(){return Array.from(this)}function eu(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var o=r[i];if(o)return o}return null}function tu(){let e=0;for(const t of this)++e;return e}function nu(){return!this.node()}function ru(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,o=i.length,a;s<o;++s)(a=i[s])&&e.call(a,a.__data__,s,i);return this}function iu(e){return function(){this.removeAttribute(e)}}function ou(e){return function(){this.removeAttributeNS(e.space,e.local)}}function su(e,t){return function(){this.setAttribute(e,t)}}function au(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function cu(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function lu(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function uu(e,t){var n=sn(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?ou:iu:typeof t=="function"?n.local?lu:cu:n.local?au:su)(n,t))}function ks(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function du(e){return function(){this.style.removeProperty(e)}}function fu(e,t,n){return function(){this.style.setProperty(e,t,n)}}function hu(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function pu(e,t,n){return arguments.length>1?this.each((t==null?du:typeof t=="function"?hu:fu)(e,t,n??"")):Ue(this.node(),e)}function Ue(e,t){return e.style.getPropertyValue(t)||ks(e).getComputedStyle(e,null).getPropertyValue(t)}function gu(e){return function(){delete this[e]}}function mu(e,t){return function(){this[e]=t}}function yu(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function xu(e,t){return arguments.length>1?this.each((t==null?gu:typeof t=="function"?yu:mu)(e,t)):this.node()[e]}function Cs(e){return e.trim().split(/^|\s+/)}function Fr(e){return e.classList||new Ms(e)}function Ms(e){this._node=e,this._names=Cs(e.getAttribute("class")||"")}Ms.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Is(e,t){for(var n=Fr(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function As(e,t){for(var n=Fr(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function wu(e){return function(){Is(this,e)}}function vu(e){return function(){As(this,e)}}function bu(e,t){return function(){(t.apply(this,arguments)?Is:As)(this,e)}}function _u(e,t){var n=Cs(e+"");if(arguments.length<2){for(var r=Fr(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?bu:t?wu:vu)(n,t))}function Eu(){this.textContent=""}function Nu(e){return function(){this.textContent=e}}function Su(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function ku(e){return arguments.length?this.each(e==null?Eu:(typeof e=="function"?Su:Nu)(e)):this.node().textContent}function Cu(){this.innerHTML=""}function Mu(e){return function(){this.innerHTML=e}}function Iu(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Au(e){return arguments.length?this.each(e==null?Cu:(typeof e=="function"?Iu:Mu)(e)):this.node().innerHTML}function Tu(){this.nextSibling&&this.parentNode.appendChild(this)}function Lu(){return this.each(Tu)}function Pu(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ru(){return this.each(Pu)}function $u(e){var t=typeof e=="function"?e:bs(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Ou(){return null}function ju(e,t){var n=typeof e=="function"?e:bs(e),r=t==null?Ou:typeof t=="function"?t:Hr(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Du(){var e=this.parentNode;e&&e.removeChild(this)}function zu(){return this.each(Du)}function Vu(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Hu(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Fu(e){return this.select(e?Hu:Vu)}function Bu(e){return arguments.length?this.property("__data__",e):this.node().__data__}function qu(e){return function(t){e.call(this,t,this.__data__)}}function Yu(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function Gu(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}function Wu(e,t,n){return function(){var r=this.__on,i,s=qu(t);if(r){for(var o=0,a=r.length;o<a;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}function Xu(e,t,n){var r=Yu(e+""),i,s=r.length,o;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,d=a.length,u;l<d;++l)for(i=0,u=a[l];i<s;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(a=t?Wu:Gu,i=0;i<s;++i)this.each(a(r[i],t,n));return this}function Ts(e,t,n){var r=ks(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function Uu(e,t){return function(){return Ts(this,e,t)}}function Ku(e,t){return function(){return Ts(this,e,t.apply(this,arguments))}}function Zu(e,t){return this.each((typeof t=="function"?Ku:Uu)(e,t))}function*Qu(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,o;i<s;++i)(o=r[i])&&(yield o)}var Ls=[null];function de(e,t){this._groups=e,this._parents=t}function _t(){return new de([[document.documentElement]],Ls)}function Ju(){return this}de.prototype=_t.prototype={constructor:de,select:Sl,selectAll:Il,selectChild:Pl,selectChildren:jl,filter:Dl,data:ql,enter:zl,exit:Gl,join:Wl,merge:Xl,selection:Ju,order:Ul,sort:Kl,call:Ql,nodes:Jl,node:eu,size:tu,empty:nu,each:ru,attr:uu,style:pu,property:xu,classed:_u,text:ku,html:Au,raise:Lu,lower:Ru,append:$u,insert:ju,remove:zu,clone:Fu,datum:Bu,on:Xu,dispatch:Zu,[Symbol.iterator]:Qu};function ue(e){return typeof e=="string"?new de([[document.querySelector(e)]],[document.documentElement]):new de([[e]],Ls)}function ed(e){let t;for(;t=e.sourceEvent;)e=t;return e}function fe(e,t){if(e=ed(e),t===void 0&&(t=e.currentTarget),t){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()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}const td={passive:!1},ht={capture:!0,passive:!1};function wn(e){e.stopImmediatePropagation()}function We(e){e.preventDefault(),e.stopImmediatePropagation()}function Ps(e){var t=e.document.documentElement,n=ue(e).on("dragstart.drag",We,ht);"onselectstart"in t?n.on("selectstart.drag",We,ht):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Rs(e,t){var n=e.document.documentElement,r=ue(e).on("dragstart.drag",null);t&&(r.on("click.drag",We,ht),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Tt=e=>()=>e;function kr(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:s,x:o,y:a,dx:l,dy:d,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:u}})}kr.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function nd(e){return!e.ctrlKey&&!e.button}function rd(){return this.parentNode}function id(e,t){return t??{x:e.x,y:e.y}}function od(){return navigator.maxTouchPoints||"ontouchstart"in this}function $s(){var e=nd,t=rd,n=id,r=od,i={},s=on("start","drag","end"),o=0,a,l,d,u,c=0;function f(w){w.on("mousedown.drag",h).filter(r).on("touchstart.drag",m).on("touchmove.drag",y,td).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(w,k){if(!(u||!e.call(this,w,k))){var _=g(this,t.call(this,w,k),w,k,"mouse");_&&(ue(w.view).on("mousemove.drag",p,ht).on("mouseup.drag",x,ht),Ps(w.view),wn(w),d=!1,a=w.clientX,l=w.clientY,_("start",w))}}function p(w){if(We(w),!d){var k=w.clientX-a,_=w.clientY-l;d=k*k+_*_>c}i.mouse("drag",w)}function x(w){ue(w.view).on("mousemove.drag mouseup.drag",null),Rs(w.view,d),We(w),i.mouse("end",w)}function m(w,k){if(e.call(this,w,k)){var _=w.changedTouches,M=t.call(this,w,k),b=_.length,N,A;for(N=0;N<b;++N)(A=g(this,M,w,k,_[N].identifier,_[N]))&&(wn(w),A("start",w,_[N]))}}function y(w){var k=w.changedTouches,_=k.length,M,b;for(M=0;M<_;++M)(b=i[k[M].identifier])&&(We(w),b("drag",w,k[M]))}function v(w){var k=w.changedTouches,_=k.length,M,b;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),M=0;M<_;++M)(b=i[k[M].identifier])&&(wn(w),b("end",w,k[M]))}function g(w,k,_,M,b,N){var A=s.copy(),S=fe(N||_,k),C,j,E;if((E=n.call(w,new kr("beforestart",{sourceEvent:_,target:f,identifier:b,active:o,x:S[0],y:S[1],dx:0,dy:0,dispatch:A}),M))!=null)return C=E.x-S[0]||0,j=E.y-S[1]||0,function P(L,D,O){var R=S,H;switch(L){case"start":i[b]=P,H=o++;break;case"end":delete i[b],--o;case"drag":S=fe(O||D,k),H=o;break}A.call(L,w,new kr(L,{sourceEvent:D,subject:E,target:f,identifier:b,active:H,x:S[0]+C,y:S[1]+j,dx:S[0]-R[0],dy:S[1]-R[1],dispatch:A}),M)}}return f.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Tt(!!w),f):e},f.container=function(w){return arguments.length?(t=typeof w=="function"?w:Tt(w),f):t},f.subject=function(w){return arguments.length?(n=typeof w=="function"?w:Tt(w),f):n},f.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:Tt(!!w),f):r},f.on=function(){var w=s.on.apply(s,arguments);return w===s?f:w},f.clickDistance=function(w){return arguments.length?(c=(w=+w)*w,f):Math.sqrt(c)},f}function Br(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Os(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Et(){}var pt=.7,Wt=1/pt,Xe="\\s*([+-]?\\d+)\\s*",gt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",we="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",sd=/^#([0-9a-f]{3,8})$/,ad=new RegExp(`^rgb\\(${Xe},${Xe},${Xe}\\)$`),cd=new RegExp(`^rgb\\(${we},${we},${we}\\)$`),ld=new RegExp(`^rgba\\(${Xe},${Xe},${Xe},${gt}\\)$`),ud=new RegExp(`^rgba\\(${we},${we},${we},${gt}\\)$`),dd=new RegExp(`^hsl\\(${gt},${we},${we}\\)$`),fd=new RegExp(`^hsla\\(${gt},${we},${we},${gt}\\)$`),yi={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};Br(Et,ze,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xi,formatHex:xi,formatHex8:hd,formatHsl:pd,formatRgb:wi,toString:wi});function xi(){return this.rgb().formatHex()}function hd(){return this.rgb().formatHex8()}function pd(){return js(this).formatHsl()}function wi(){return this.rgb().formatRgb()}function ze(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=sd.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?vi(t):n===3?new le(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Lt(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Lt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=ad.exec(e))?new le(t[1],t[2],t[3],1):(t=cd.exec(e))?new le(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=ld.exec(e))?Lt(t[1],t[2],t[3],t[4]):(t=ud.exec(e))?Lt(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=dd.exec(e))?Ei(t[1],t[2]/100,t[3]/100,1):(t=fd.exec(e))?Ei(t[1],t[2]/100,t[3]/100,t[4]):yi.hasOwnProperty(e)?vi(yi[e]):e==="transparent"?new le(NaN,NaN,NaN,0):null}function vi(e){return new le(e>>16&255,e>>8&255,e&255,1)}function Lt(e,t,n,r){return r<=0&&(e=t=n=NaN),new le(e,t,n,r)}function gd(e){return e instanceof Et||(e=ze(e)),e?(e=e.rgb(),new le(e.r,e.g,e.b,e.opacity)):new le}function Cr(e,t,n,r){return arguments.length===1?gd(e):new le(e,t,n,r??1)}function le(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Br(le,Cr,Os(Et,{brighter(e){return e=e==null?Wt:Math.pow(Wt,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?pt:Math.pow(pt,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new le(je(this.r),je(this.g),je(this.b),Xt(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:bi,formatHex:bi,formatHex8:md,formatRgb:_i,toString:_i}));function bi(){return`#${Oe(this.r)}${Oe(this.g)}${Oe(this.b)}`}function md(){return`#${Oe(this.r)}${Oe(this.g)}${Oe(this.b)}${Oe((isNaN(this.opacity)?1:this.opacity)*255)}`}function _i(){const e=Xt(this.opacity);return`${e===1?"rgb(":"rgba("}${je(this.r)}, ${je(this.g)}, ${je(this.b)}${e===1?")":`, ${e})`}`}function Xt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function je(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Oe(e){return e=je(e),(e<16?"0":"")+e.toString(16)}function Ei(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new he(e,t,n,r)}function js(e){if(e instanceof he)return new he(e.h,e.s,e.l,e.opacity);if(e instanceof Et||(e=ze(e)),!e)return new he;if(e instanceof he)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),s=Math.max(t,n,r),o=NaN,a=s-i,l=(s+i)/2;return a?(t===s?o=(n-r)/a+(n<r)*6:n===s?o=(r-t)/a+2:o=(t-n)/a+4,a/=l<.5?s+i:2-s-i,o*=60):a=l>0&&l<1?0:o,new he(o,a,l,e.opacity)}function yd(e,t,n,r){return arguments.length===1?js(e):new he(e,t,n,r??1)}function he(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Br(he,yd,Os(Et,{brighter(e){return e=e==null?Wt:Math.pow(Wt,e),new he(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?pt:Math.pow(pt,e),new he(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new le(vn(e>=240?e-240:e+120,i,r),vn(e,i,r),vn(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new he(Ni(this.h),Pt(this.s),Pt(this.l),Xt(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 e=Xt(this.opacity);return`${e===1?"hsl(":"hsla("}${Ni(this.h)}, ${Pt(this.s)*100}%, ${Pt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ni(e){return e=(e||0)%360,e<0?e+360:e}function Pt(e){return Math.max(0,Math.min(1,e||0))}function vn(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const qr=e=>()=>e;function xd(e,t){return function(n){return e+n*t}}function wd(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function vd(e){return(e=+e)==1?Ds:function(t,n){return n-t?wd(t,n,e):qr(isNaN(t)?n:t)}}function Ds(e,t){var n=t-e;return n?xd(e,n):qr(isNaN(e)?t:e)}const Ut=(function e(t){var n=vd(t);function r(i,s){var o=n((i=Cr(i)).r,(s=Cr(s)).r),a=n(i.g,s.g),l=n(i.b,s.b),d=Ds(i.opacity,s.opacity);return function(u){return i.r=o(u),i.g=a(u),i.b=l(u),i.opacity=d(u),i+""}}return r.gamma=e,r})(1);function bd(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(s){for(i=0;i<n;++i)r[i]=e[i]*(1-s)+t[i]*s;return r}}function _d(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Ed(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=new Array(r),s=new Array(n),o;for(o=0;o<r;++o)i[o]=dt(e[o],t[o]);for(;o<n;++o)s[o]=t[o];return function(a){for(o=0;o<r;++o)s[o]=i[o](a);return s}}function Nd(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function xe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Sd(e,t){var n={},r={},i;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(i in t)i in e?n[i]=dt(e[i],t[i]):r[i]=t[i];return function(s){for(i in n)r[i]=n[i](s);return r}}var Mr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bn=new RegExp(Mr.source,"g");function kd(e){return function(){return e}}function Cd(e){return function(t){return e(t)+""}}function zs(e,t){var n=Mr.lastIndex=bn.lastIndex=0,r,i,s,o=-1,a=[],l=[];for(e=e+"",t=t+"";(r=Mr.exec(e))&&(i=bn.exec(t));)(s=i.index)>n&&(s=t.slice(n,s),a[o]?a[o]+=s:a[++o]=s),(r=r[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,l.push({i:o,x:xe(r,i)})),n=bn.lastIndex;return n<t.length&&(s=t.slice(n),a[o]?a[o]+=s:a[++o]=s),a.length<2?l[0]?Cd(l[0].x):kd(t):(t=l.length,function(d){for(var u=0,c;u<t;++u)a[(c=l[u]).i]=c.x(d);return a.join("")})}function dt(e,t){var n=typeof t,r;return t==null||n==="boolean"?qr(t):(n==="number"?xe:n==="string"?(r=ze(t))?(t=r,Ut):zs:t instanceof ze?Ut:t instanceof Date?Nd:_d(t)?bd:Array.isArray(t)?Ed:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Sd:xe)(e,t)}var Si=180/Math.PI,Ir={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Vs(e,t,n,r,i,s){var o,a,l;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),e*r<t*n&&(e=-e,t=-t,l=-l,o=-o),{translateX:i,translateY:s,rotate:Math.atan2(t,e)*Si,skewX:Math.atan(l)*Si,scaleX:o,scaleY:a}}var Rt;function Md(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Ir:Vs(t.a,t.b,t.c,t.d,t.e,t.f)}function Id(e){return e==null||(Rt||(Rt=document.createElementNS("http://www.w3.org/2000/svg","g")),Rt.setAttribute("transform",e),!(e=Rt.transform.baseVal.consolidate()))?Ir:(e=e.matrix,Vs(e.a,e.b,e.c,e.d,e.e,e.f))}function Hs(e,t,n,r){function i(d){return d.length?d.pop()+" ":""}function s(d,u,c,f,h,p){if(d!==c||u!==f){var x=h.push("translate(",null,t,null,n);p.push({i:x-4,x:xe(d,c)},{i:x-2,x:xe(u,f)})}else(c||f)&&h.push("translate("+c+t+f+n)}function o(d,u,c,f){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),f.push({i:c.push(i(c)+"rotate(",null,r)-2,x:xe(d,u)})):u&&c.push(i(c)+"rotate("+u+r)}function a(d,u,c,f){d!==u?f.push({i:c.push(i(c)+"skewX(",null,r)-2,x:xe(d,u)}):u&&c.push(i(c)+"skewX("+u+r)}function l(d,u,c,f,h,p){if(d!==c||u!==f){var x=h.push(i(h)+"scale(",null,",",null,")");p.push({i:x-4,x:xe(d,c)},{i:x-2,x:xe(u,f)})}else(c!==1||f!==1)&&h.push(i(h)+"scale("+c+","+f+")")}return function(d,u){var c=[],f=[];return d=e(d),u=e(u),s(d.translateX,d.translateY,u.translateX,u.translateY,c,f),o(d.rotate,u.rotate,c,f),a(d.skewX,u.skewX,c,f),l(d.scaleX,d.scaleY,u.scaleX,u.scaleY,c,f),d=u=null,function(h){for(var p=-1,x=f.length,m;++p<x;)c[(m=f[p]).i]=m.x(h);return c.join("")}}}var Ad=Hs(Md,"px, ","px)","deg)"),Td=Hs(Id,", ",")",")"),Ld=1e-12;function ki(e){return((e=Math.exp(e))+1/e)/2}function Pd(e){return((e=Math.exp(e))-1/e)/2}function Rd(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ft=(function e(t,n,r){function i(s,o){var a=s[0],l=s[1],d=s[2],u=o[0],c=o[1],f=o[2],h=u-a,p=c-l,x=h*h+p*p,m,y;if(x<Ld)y=Math.log(f/d)/t,m=function(M){return[a+M*h,l+M*p,d*Math.exp(t*M*y)]};else{var v=Math.sqrt(x),g=(f*f-d*d+r*x)/(2*d*n*v),w=(f*f-d*d-r*x)/(2*f*n*v),k=Math.log(Math.sqrt(g*g+1)-g),_=Math.log(Math.sqrt(w*w+1)-w);y=(_-k)/t,m=function(M){var b=M*y,N=ki(k),A=d/(n*v)*(N*Rd(t*b+k)-Pd(k));return[a+A*h,l+A*p,d*N/ki(t*b+k)]}}return m.duration=y*1e3*t/Math.SQRT2,m}return i.rho=function(s){var o=Math.max(.001,+s),a=o*o,l=a*a;return e(o,a,l)},i})(Math.SQRT2,2,4);var Ke=0,lt=0,at=0,Fs=1e3,Kt,ut,Zt=0,Ve=0,an=0,mt=typeof performance=="object"&&performance.now?performance:Date,Bs=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Yr(){return Ve||(Bs($d),Ve=mt.now()+an)}function $d(){Ve=0}function Qt(){this._call=this._time=this._next=null}Qt.prototype=qs.prototype={constructor:Qt,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Yr():+n)+(t==null?0:+t),!this._next&&ut!==this&&(ut?ut._next=this:Kt=this,ut=this),this._call=e,this._time=n,Ar()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ar())}};function qs(e,t,n){var r=new Qt;return r.restart(e,t,n),r}function Od(){Yr(),++Ke;for(var e=Kt,t;e;)(t=Ve-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Ke}function Ci(){Ve=(Zt=mt.now())+an,Ke=lt=0;try{Od()}finally{Ke=0,Dd(),Ve=0}}function jd(){var e=mt.now(),t=e-Zt;t>Fs&&(an-=t,Zt=e)}function Dd(){for(var e,t=Kt,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Kt=n);ut=e,Ar(r)}function Ar(e){if(!Ke){lt&&(lt=clearTimeout(lt));var t=e-Ve;t>24?(e<1/0&&(lt=setTimeout(Ci,e-mt.now()-an)),at&&(at=clearInterval(at))):(at||(Zt=mt.now(),at=setInterval(jd,Fs)),Ke=1,Bs(Ci))}}function Mi(e,t,n){var r=new Qt;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var zd=on("start","end","cancel","interrupt"),Vd=[],Ys=0,Ii=1,Tr=2,Bt=3,Ai=4,Lr=5,qt=6;function cn(e,t,n,r,i,s){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Hd(e,n,{name:t,index:r,group:i,on:zd,tween:Vd,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Ys})}function Gr(e,t){var n=ye(e,t);if(n.state>Ys)throw new Error("too late; already scheduled");return n}function be(e,t){var n=ye(e,t);if(n.state>Bt)throw new Error("too late; already running");return n}function ye(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Hd(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=qs(s,0,n.time);function s(d){n.state=Ii,n.timer.restart(o,n.delay,n.time),n.delay<=d&&o(d-n.delay)}function o(d){var u,c,f,h;if(n.state!==Ii)return l();for(u in r)if(h=r[u],h.name===n.name){if(h.state===Bt)return Mi(o);h.state===Ai?(h.state=qt,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[u]):+u<t&&(h.state=qt,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[u])}if(Mi(function(){n.state===Bt&&(n.state=Ai,n.timer.restart(a,n.delay,n.time),a(d))}),n.state=Tr,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Tr){for(n.state=Bt,i=new Array(f=n.tween.length),u=0,c=-1;u<f;++u)(h=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(i[++c]=h);i.length=c+1}}function a(d){for(var u=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(l),n.state=Lr,1),c=-1,f=i.length;++c<f;)i[c].call(e,u);n.state===Lr&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){n.state=qt,n.timer.stop(),delete r[t];for(var d in r)return;delete e.__transition}}function Yt(e,t){var n=e.__transition,r,i,s=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){s=!1;continue}i=r.state>Tr&&r.state<Lr,r.state=qt,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}s&&delete e.__transition}}function Fd(e){return this.each(function(){Yt(this,e)})}function Bd(e,t){var n,r;return function(){var i=be(this,e),s=i.tween;if(s!==n){r=n=s;for(var o=0,a=r.length;o<a;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function qd(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=be(this,e),o=s.tween;if(o!==r){i=(r=o).slice();for(var a={name:t,value:n},l=0,d=i.length;l<d;++l)if(i[l].name===t){i[l]=a;break}l===d&&i.push(a)}s.tween=i}}function Yd(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=ye(this.node(),n).tween,i=0,s=r.length,o;i<s;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Bd:qd)(n,e,t))}function Wr(e,t,n){var r=e._id;return e.each(function(){var i=be(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return ye(i,r).value[t]}}function Gs(e,t){var n;return(typeof t=="number"?xe:t instanceof ze?Ut:(n=ze(t))?(t=n,Ut):zs)(e,t)}function Gd(e){return function(){this.removeAttribute(e)}}function Wd(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Xd(e,t,n){var r,i=n+"",s;return function(){var o=this.getAttribute(e);return o===i?null:o===r?s:s=t(r=o,n)}}function Ud(e,t,n){var r,i=n+"",s;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?s:s=t(r=o,n)}}function Kd(e,t,n){var r,i,s;return function(){var o,a=n(this),l;return a==null?void this.removeAttribute(e):(o=this.getAttribute(e),l=a+"",o===l?null:o===r&&l===i?s:(i=l,s=t(r=o,a)))}}function Zd(e,t,n){var r,i,s;return function(){var o,a=n(this),l;return a==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),l=a+"",o===l?null:o===r&&l===i?s:(i=l,s=t(r=o,a)))}}function Qd(e,t){var n=sn(e),r=n==="transform"?Td:Gs;return this.attrTween(e,typeof t=="function"?(n.local?Zd:Kd)(n,r,Wr(this,"attr."+e,t)):t==null?(n.local?Wd:Gd)(n):(n.local?Ud:Xd)(n,r,t))}function Jd(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ef(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function tf(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&ef(e,s)),n}return i._value=t,i}function nf(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&Jd(e,s)),n}return i._value=t,i}function rf(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=sn(e);return this.tween(n,(r.local?tf:nf)(r,t))}function of(e,t){return function(){Gr(this,e).delay=+t.apply(this,arguments)}}function sf(e,t){return t=+t,function(){Gr(this,e).delay=t}}function af(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?of:sf)(t,e)):ye(this.node(),t).delay}function cf(e,t){return function(){be(this,e).duration=+t.apply(this,arguments)}}function lf(e,t){return t=+t,function(){be(this,e).duration=t}}function uf(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?cf:lf)(t,e)):ye(this.node(),t).duration}function df(e,t){if(typeof t!="function")throw new Error;return function(){be(this,e).ease=t}}function ff(e){var t=this._id;return arguments.length?this.each(df(t,e)):ye(this.node(),t).ease}function hf(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;be(this,e).ease=n}}function pf(e){if(typeof e!="function")throw new Error;return this.each(hf(this._id,e))}function gf(e){typeof e!="function"&&(e=Es(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],o=s.length,a=r[i]=[],l,d=0;d<o;++d)(l=s[d])&&e.call(l,l.__data__,d,s)&&a.push(l);return new Se(r,this._parents,this._name,this._id)}function mf(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),o=new Array(r),a=0;a<s;++a)for(var l=t[a],d=n[a],u=l.length,c=o[a]=new Array(u),f,h=0;h<u;++h)(f=l[h]||d[h])&&(c[h]=f);for(;a<r;++a)o[a]=t[a];return new Se(o,this._parents,this._name,this._id)}function yf(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function xf(e,t,n){var r,i,s=yf(t)?Gr:be;return function(){var o=s(this,e),a=o.on;a!==r&&(i=(r=a).copy()).on(t,n),o.on=i}}function wf(e,t){var n=this._id;return arguments.length<2?ye(this.node(),n).on.on(e):this.each(xf(n,e,t))}function vf(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function bf(){return this.on("end.remove",vf(this._id))}function _f(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Hr(e));for(var r=this._groups,i=r.length,s=new Array(i),o=0;o<i;++o)for(var a=r[o],l=a.length,d=s[o]=new Array(l),u,c,f=0;f<l;++f)(u=a[f])&&(c=e.call(u,u.__data__,f,a))&&("__data__"in u&&(c.__data__=u.__data__),d[f]=c,cn(d[f],t,n,f,d,ye(u,n)));return new Se(s,this._parents,t,n)}function Ef(e){var t=this._name,n=this._id;typeof e!="function"&&(e=_s(e));for(var r=this._groups,i=r.length,s=[],o=[],a=0;a<i;++a)for(var l=r[a],d=l.length,u,c=0;c<d;++c)if(u=l[c]){for(var f=e.call(u,u.__data__,c,l),h,p=ye(u,n),x=0,m=f.length;x<m;++x)(h=f[x])&&cn(h,t,n,x,f,p);s.push(f),o.push(u)}return new Se(s,o,t,n)}var Nf=_t.prototype.constructor;function Sf(){return new Nf(this._groups,this._parents)}function kf(e,t){var n,r,i;return function(){var s=Ue(this,e),o=(this.style.removeProperty(e),Ue(this,e));return s===o?null:s===n&&o===r?i:i=t(n=s,r=o)}}function Ws(e){return function(){this.style.removeProperty(e)}}function Cf(e,t,n){var r,i=n+"",s;return function(){var o=Ue(this,e);return o===i?null:o===r?s:s=t(r=o,n)}}function Mf(e,t,n){var r,i,s;return function(){var o=Ue(this,e),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(e),Ue(this,e))),o===l?null:o===r&&l===i?s:(i=l,s=t(r=o,a))}}function If(e,t){var n,r,i,s="style."+t,o="end."+s,a;return function(){var l=be(this,e),d=l.on,u=l.value[s]==null?a||(a=Ws(t)):void 0;(d!==n||i!==u)&&(r=(n=d).copy()).on(o,i=u),l.on=r}}function Af(e,t,n){var r=(e+="")=="transform"?Ad:Gs;return t==null?this.styleTween(e,kf(e,r)).on("end.style."+e,Ws(e)):typeof t=="function"?this.styleTween(e,Mf(e,r,Wr(this,"style."+e,t))).each(If(this._id,e)):this.styleTween(e,Cf(e,r,t),n).on("end.style."+e,null)}function Tf(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Lf(e,t,n){var r,i;function s(){var o=t.apply(this,arguments);return o!==i&&(r=(i=o)&&Tf(e,o,n)),r}return s._value=t,s}function Pf(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,Lf(e,t,n??""))}function Rf(e){return function(){this.textContent=e}}function $f(e){return function(){var t=e(this);this.textContent=t??""}}function Of(e){return this.tween("text",typeof e=="function"?$f(Wr(this,"text",e)):Rf(e==null?"":e+""))}function jf(e){return function(t){this.textContent=e.call(this,t)}}function Df(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&jf(i)),t}return r._value=e,r}function zf(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Df(e))}function Vf(){for(var e=this._name,t=this._id,n=Xs(),r=this._groups,i=r.length,s=0;s<i;++s)for(var o=r[s],a=o.length,l,d=0;d<a;++d)if(l=o[d]){var u=ye(l,t);cn(l,e,n,d,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Se(r,this._parents,e,n)}function Hf(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,o){var a={value:o},l={value:function(){--i===0&&s()}};n.each(function(){var d=be(this,r),u=d.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(l)),d.on=t}),i===0&&s()})}var Ff=0;function Se(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Xs(){return++Ff}var Ee=_t.prototype;Se.prototype={constructor:Se,select:_f,selectAll:Ef,selectChild:Ee.selectChild,selectChildren:Ee.selectChildren,filter:gf,merge:mf,selection:Sf,transition:Vf,call:Ee.call,nodes:Ee.nodes,node:Ee.node,size:Ee.size,empty:Ee.empty,each:Ee.each,on:wf,attr:Qd,attrTween:rf,style:Af,styleTween:Pf,text:Of,textTween:zf,remove:bf,tween:Yd,delay:af,duration:uf,ease:ff,easeVarying:pf,end:Hf,[Symbol.iterator]:Ee[Symbol.iterator]};function Bf(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var qf={time:null,delay:0,duration:250,ease:Bf};function Yf(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Gf(e){var t,n;e instanceof Se?(t=e._id,e=e._name):(t=Xs(),(n=qf).time=Yr(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var o=r[s],a=o.length,l,d=0;d<a;++d)(l=o[d])&&cn(l,e,t,d,o,n||Yf(l,t));return new Se(r,this._parents,e,t)}_t.prototype.interrupt=Fd;_t.prototype.transition=Gf;const $t=e=>()=>e;function Wf(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function Ne(e,t,n){this.k=e,this.x=t,this.y=n}Ne.prototype={constructor:Ne,scale:function(e){return e===1?this:new Ne(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ne(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ln=new Ne(1,0,0);Us.prototype=Ne.prototype;function Us(e){for(;!e.__zoom;)if(!(e=e.parentNode))return ln;return e.__zoom}function _n(e){e.stopImmediatePropagation()}function ct(e){e.preventDefault(),e.stopImmediatePropagation()}function Xf(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Uf(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Ti(){return this.__zoom||ln}function Kf(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Zf(){return navigator.maxTouchPoints||"ontouchstart"in this}function Qf(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function Ks(){var e=Xf,t=Uf,n=Qf,r=Kf,i=Zf,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Ft,d=on("start","zoom","end"),u,c,f,h=500,p=150,x=0,m=10;function y(E){E.property("__zoom",Ti).on("wheel.zoom",b,{passive:!1}).on("mousedown.zoom",N).on("dblclick.zoom",A).filter(i).on("touchstart.zoom",S).on("touchmove.zoom",C).on("touchend.zoom touchcancel.zoom",j).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(E,P,L,D){var O=E.selection?E.selection():E;O.property("__zoom",Ti),E!==O?k(E,P,L,D):O.interrupt().each(function(){_(this,arguments).event(D).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},y.scaleBy=function(E,P,L,D){y.scaleTo(E,function(){var O=this.__zoom.k,R=typeof P=="function"?P.apply(this,arguments):P;return O*R},L,D)},y.scaleTo=function(E,P,L,D){y.transform(E,function(){var O=t.apply(this,arguments),R=this.__zoom,H=L==null?w(O):typeof L=="function"?L.apply(this,arguments):L,q=R.invert(H),F=typeof P=="function"?P.apply(this,arguments):P;return n(g(v(R,F),H,q),O,o)},L,D)},y.translateBy=function(E,P,L,D){y.transform(E,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof L=="function"?L.apply(this,arguments):L),t.apply(this,arguments),o)},null,D)},y.translateTo=function(E,P,L,D,O){y.transform(E,function(){var R=t.apply(this,arguments),H=this.__zoom,q=D==null?w(R):typeof D=="function"?D.apply(this,arguments):D;return n(ln.translate(q[0],q[1]).scale(H.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof L=="function"?-L.apply(this,arguments):-L),R,o)},D,O)};function v(E,P){return P=Math.max(s[0],Math.min(s[1],P)),P===E.k?E:new Ne(P,E.x,E.y)}function g(E,P,L){var D=P[0]-L[0]*E.k,O=P[1]-L[1]*E.k;return D===E.x&&O===E.y?E:new Ne(E.k,D,O)}function w(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function k(E,P,L,D){E.on("start.zoom",function(){_(this,arguments).event(D).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(D).end()}).tween("zoom",function(){var O=this,R=arguments,H=_(O,R).event(D),q=t.apply(O,R),F=L==null?w(q):typeof L=="function"?L.apply(O,R):L,T=Math.max(q[1][0]-q[0][0],q[1][1]-q[0][1]),$=O.__zoom,z=typeof P=="function"?P.apply(O,R):P,B=l($.invert(F).concat(T/$.k),z.invert(F).concat(T/z.k));return function(G){if(G===1)G=z;else{var Y=B(G),W=T/Y[2];G=new Ne(W,F[0]-Y[0]*W,F[1]-Y[1]*W)}H.zoom(null,G)}})}function _(E,P,L){return!L&&E.__zooming||new M(E,P)}function M(E,P){this.that=E,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,P),this.taps=0}M.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,P){return this.mouse&&E!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var P=ue(this.that).datum();d.call(E,this.that,new Wf(E,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:d}),P)}};function b(E,...P){if(!e.apply(this,arguments))return;var L=_(this,P).event(E),D=this.__zoom,O=Math.max(s[0],Math.min(s[1],D.k*Math.pow(2,r.apply(this,arguments)))),R=fe(E);if(L.wheel)(L.mouse[0][0]!==R[0]||L.mouse[0][1]!==R[1])&&(L.mouse[1]=D.invert(L.mouse[0]=R)),clearTimeout(L.wheel);else{if(D.k===O)return;L.mouse=[R,D.invert(R)],Yt(this),L.start()}ct(E),L.wheel=setTimeout(H,p),L.zoom("mouse",n(g(v(D,O),L.mouse[0],L.mouse[1]),L.extent,o));function H(){L.wheel=null,L.end()}}function N(E,...P){if(f||!e.apply(this,arguments))return;var L=E.currentTarget,D=_(this,P,!0).event(E),O=ue(E.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",T,!0),R=fe(E,L),H=E.clientX,q=E.clientY;Ps(E.view),_n(E),D.mouse=[R,this.__zoom.invert(R)],Yt(this),D.start();function F($){if(ct($),!D.moved){var z=$.clientX-H,B=$.clientY-q;D.moved=z*z+B*B>x}D.event($).zoom("mouse",n(g(D.that.__zoom,D.mouse[0]=fe($,L),D.mouse[1]),D.extent,o))}function T($){O.on("mousemove.zoom mouseup.zoom",null),Rs($.view,D.moved),ct($),D.event($).end()}}function A(E,...P){if(e.apply(this,arguments)){var L=this.__zoom,D=fe(E.changedTouches?E.changedTouches[0]:E,this),O=L.invert(D),R=L.k*(E.shiftKey?.5:2),H=n(g(v(L,R),D,O),t.apply(this,P),o);ct(E),a>0?ue(this).transition().duration(a).call(k,H,D,E):ue(this).call(y.transform,H,D,E)}}function S(E,...P){if(e.apply(this,arguments)){var L=E.touches,D=L.length,O=_(this,P,E.changedTouches.length===D).event(E),R,H,q,F;for(_n(E),H=0;H<D;++H)q=L[H],F=fe(q,this),F=[F,this.__zoom.invert(F),q.identifier],O.touch0?!O.touch1&&O.touch0[2]!==F[2]&&(O.touch1=F,O.taps=0):(O.touch0=F,R=!0,O.taps=1+!!u);u&&(u=clearTimeout(u)),R&&(O.taps<2&&(c=F[0],u=setTimeout(function(){u=null},h)),Yt(this),O.start())}}function C(E,...P){if(this.__zooming){var L=_(this,P).event(E),D=E.changedTouches,O=D.length,R,H,q,F;for(ct(E),R=0;R<O;++R)H=D[R],q=fe(H,this),L.touch0&&L.touch0[2]===H.identifier?L.touch0[0]=q:L.touch1&&L.touch1[2]===H.identifier&&(L.touch1[0]=q);if(H=L.that.__zoom,L.touch1){var T=L.touch0[0],$=L.touch0[1],z=L.touch1[0],B=L.touch1[1],G=(G=z[0]-T[0])*G+(G=z[1]-T[1])*G,Y=(Y=B[0]-$[0])*Y+(Y=B[1]-$[1])*Y;H=v(H,Math.sqrt(G/Y)),q=[(T[0]+z[0])/2,(T[1]+z[1])/2],F=[($[0]+B[0])/2,($[1]+B[1])/2]}else if(L.touch0)q=L.touch0[0],F=L.touch0[1];else return;L.zoom("touch",n(g(H,q,F),L.extent,o))}}function j(E,...P){if(this.__zooming){var L=_(this,P).event(E),D=E.changedTouches,O=D.length,R,H;for(_n(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},h),R=0;R<O;++R)H=D[R],L.touch0&&L.touch0[2]===H.identifier?delete L.touch0:L.touch1&&L.touch1[2]===H.identifier&&delete L.touch1;if(L.touch1&&!L.touch0&&(L.touch0=L.touch1,delete L.touch1),L.touch0)L.touch0[1]=this.__zoom.invert(L.touch0[0]);else if(L.end(),L.taps===2&&(H=fe(H,this),Math.hypot(c[0]-H[0],c[1]-H[1])<m)){var q=ue(this).on("dblclick.zoom");q&&q.apply(this,arguments)}}}return y.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:$t(+E),y):r},y.filter=function(E){return arguments.length?(e=typeof E=="function"?E:$t(!!E),y):e},y.touchable=function(E){return arguments.length?(i=typeof E=="function"?E:$t(!!E),y):i},y.extent=function(E){return arguments.length?(t=typeof E=="function"?E:$t([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),y):t},y.scaleExtent=function(E){return arguments.length?(s[0]=+E[0],s[1]=+E[1],y):[s[0],s[1]]},y.translateExtent=function(E){return arguments.length?(o[0][0]=+E[0][0],o[1][0]=+E[1][0],o[0][1]=+E[0][1],o[1][1]=+E[1][1],y):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},y.constrain=function(E){return arguments.length?(n=E,y):n},y.duration=function(E){return arguments.length?(a=+E,y):a},y.interpolate=function(E){return arguments.length?(l=E,y):l},y.on=function(){var E=d.on.apply(d,arguments);return E===d?y:E},y.clickDistance=function(E){return arguments.length?(x=(E=+E)*E,y):Math.sqrt(x)},y.tapDistance=function(E){return arguments.length?(m=+E,y):m},y}const ve={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},yt=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Zs=["Enter"," ","Escape"],Qs={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Ze;(function(e){e.Strict="strict",e.Loose="loose"})(Ze||(Ze={}));var De;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(De||(De={}));var xt;(function(e){e.Partial="partial",e.Full="full"})(xt||(xt={}));const Js={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ae;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ae||(Ae={}));var Jt;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Jt||(Jt={}));var K;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(K||(K={}));const Li={[K.Left]:K.Right,[K.Right]:K.Left,[K.Top]:K.Bottom,[K.Bottom]:K.Top};function ea(e){return e===null?null:e?"valid":"invalid"}const ta=e=>"id"in e&&"source"in e&&"target"in e,Jf=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Xr=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Nt=(e,t=[0,0])=>{const{width:n,height:r}=ke(e),i=e.origin??t,s=n*i[0],o=r*i[1];return{x:e.position.x-s,y:e.position.y-o}},eh=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const s=typeof i=="string";let o=!t.nodeLookup&&!s?i:void 0;t.nodeLookup&&(o=s?t.nodeLookup.get(i):Xr(i)?i:t.nodeLookup.get(i.id));const a=o?en(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return un(r,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return dn(n)},St=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=un(n,en(i)),r=!0)}),r?dn(n):{x:0,y:0,width:0,height:0}},Ur=(e,t,[n,r,i]=[0,0,1],s=!1,o=!1)=>{const a={...Ct(t,[n,r,i]),width:t.width/i,height:t.height/i},l=[];for(const d of e.values()){const{measured:u,selectable:c=!0,hidden:f=!1}=d;if(o&&!c||f)continue;const h=u.width??d.width??d.initialWidth??null,p=u.height??d.height??d.initialHeight??null,x=wt(a,Je(d)),m=(h??0)*(p??0),y=s&&x>0;(!d.internals.handleBounds||y||x>=m||d.dragging)&&l.push(d)}return l},th=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function nh(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{i.measured.width&&i.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!i.hidden)&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}async function rh({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:s},o){if(e.size===0)return Promise.resolve(!0);const a=nh(e,o),l=St(a),d=Kr(l,t,n,(o==null?void 0:o.minZoom)??i,(o==null?void 0:o.maxZoom)??s,(o==null?void 0:o.padding)??.1);return await r.setViewport(d,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),Promise.resolve(!0)}function na({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){const o=n.get(e),a=o.parentId?n.get(o.parentId):void 0,{x:l,y:d}=a?a.internals.positionAbsolute:{x:0,y:0},u=o.origin??r;let c=o.extent||i;if(o.extent==="parent"&&!o.expandParent)if(!a)s==null||s("005",ve.error005());else{const h=a.measured.width,p=a.measured.height;h&&p&&(c=[[l,d],[l+h,d+p]])}else a&&et(o.extent)&&(c=[[o.extent[0][0]+l,o.extent[0][1]+d],[o.extent[1][0]+l,o.extent[1][1]+d]]);const f=et(c)?He(t,c,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(s==null||s("015",ve.error015())),{position:{x:f.x-l+(o.measured.width??0)*u[0],y:f.y-d+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function ih({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){const s=new Set(e.map(f=>f.id)),o=[];for(const f of n){if(f.deletable===!1)continue;const h=s.has(f.id),p=!h&&f.parentId&&o.find(x=>x.id===f.parentId);(h||p)&&o.push(f)}const a=new Set(t.map(f=>f.id)),l=r.filter(f=>f.deletable!==!1),u=th(o,l);for(const f of l)a.has(f.id)&&!u.find(p=>p.id===f.id)&&u.push(f);if(!i)return{edges:u,nodes:o};const c=await i({nodes:o,edges:u});return typeof c=="boolean"?c?{edges:u,nodes:o}:{edges:[],nodes:[]}:c}const Qe=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),He=(e={x:0,y:0},t,n)=>({x:Qe(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Qe(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function ra(e,t,n){const{width:r,height:i}=ke(n),{x:s,y:o}=n.internals.positionAbsolute;return He(e,[[s,o],[s+r,o+i]],t)}const Pi=(e,t,n)=>e<t?Qe(Math.abs(e-t),1,t)/t:e>n?-Qe(Math.abs(e-n),1,t)/t:0,ia=(e,t,n=15,r=40)=>{const i=Pi(e.x,r,t.width-r)*n,s=Pi(e.y,r,t.height-r)*n;return[i,s]},un=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Pr=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),dn=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Je=(e,t=[0,0])=>{var i,s;const{x:n,y:r}=Xr(e)?e.internals.positionAbsolute:Nt(e,t);return{x:n,y:r,width:((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0,height:((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0}},en=(e,t=[0,0])=>{var i,s;const{x:n,y:r}=Xr(e)?e.internals.positionAbsolute:Nt(e,t);return{x:n,y:r,x2:n+(((i=e.measured)==null?void 0:i.width)??e.width??e.initialWidth??0),y2:r+(((s=e.measured)==null?void 0:s.height)??e.height??e.initialHeight??0)}},oa=(e,t)=>dn(un(Pr(e),Pr(t))),wt=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Ri=e=>pe(e.width)&&pe(e.height)&&pe(e.x)&&pe(e.y),pe=e=>!isNaN(e)&&isFinite(e),oh=(e,t)=>{},kt=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Ct=({x:e,y:t},[n,r,i],s=!1,o=[1,1])=>{const a={x:(e-n)/i,y:(t-r)/i};return s?kt(a,o):a},tn=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function qe(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function sh(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=qe(e,n),i=qe(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){const r=qe(e.top??e.y??0,n),i=qe(e.bottom??e.y??0,n),s=qe(e.left??e.x??0,t),o=qe(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:s,x:s+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function ah(e,t,n,r,i,s){const{x:o,y:a}=tn(e,[t,n,r]),{x:l,y:d}=tn({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-l,c=s-d;return{left:Math.floor(o),top:Math.floor(a),right:Math.floor(u),bottom:Math.floor(c)}}const Kr=(e,t,n,r,i,s)=>{const o=sh(s,t,n),a=(t-o.x)/e.width,l=(n-o.y)/e.height,d=Math.min(a,l),u=Qe(d,r,i),c=e.x+e.width/2,f=e.y+e.height/2,h=t/2-c*u,p=n/2-f*u,x=ah(e,h,p,u,t,n),m={left:Math.min(x.left-o.left,0),top:Math.min(x.top-o.top,0),right:Math.min(x.right-o.right,0),bottom:Math.min(x.bottom-o.bottom,0)};return{x:h-m.left+m.right,y:p-m.top+m.bottom,zoom:u}},vt=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function et(e){return e!=null&&e!=="parent"}function ke(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function sa(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function aa(e,t={width:0,height:0},n,r,i){const s={...e},o=r.get(n);if(o){const a=o.origin||i;s.x+=o.internals.positionAbsolute.x-(t.width??0)*a[0],s.y+=o.internals.positionAbsolute.y-(t.height??0)*a[1]}return s}function $i(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function ch(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}function lh(e){return{...Qs,...e||{}}}function ft(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){const{x:s,y:o}=ge(e),a=Ct({x:s-((i==null?void 0:i.left)??0),y:o-((i==null?void 0:i.top)??0)},r),{x:l,y:d}=n?kt(a,t):a;return{xSnapped:l,ySnapped:d,...a}}const Zr=e=>({width:e.offsetWidth,height:e.offsetHeight}),ca=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},uh=["INPUT","SELECT","TEXTAREA"];function la(e){var r,i;const t=((i=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:i[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:uh.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const ua=e=>"clientX"in e,ge=(e,t)=>{var s,o;const n=ua(e),r=n?e.clientX:(s=e.touches)==null?void 0:s[0].clientX,i=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},Oi=(e,t,n,r,i)=>{const s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(o=>{const a=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:i,position:o.getAttribute("data-handlepos"),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...Zr(o)}})};function da({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:o,targetControlY:a}){const l=e*.125+i*.375+o*.375+n*.125,d=t*.125+s*.375+a*.375+r*.125,u=Math.abs(l-e),c=Math.abs(d-t);return[l,d,u,c]}function Ot(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function ji({pos:e,x1:t,y1:n,x2:r,y2:i,c:s}){switch(e){case K.Left:return[t-Ot(t-r,s),n];case K.Right:return[t+Ot(r-t,s),n];case K.Top:return[t,n-Ot(n-i,s)];case K.Bottom:return[t,n+Ot(i-n,s)]}}function Qr({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:i,targetPosition:s=K.Top,curvature:o=.25}){const[a,l]=ji({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[d,u]=ji({pos:s,x1:r,y1:i,x2:e,y2:t,c:o}),[c,f,h,p]=da({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:a,sourceControlY:l,targetControlX:d,targetControlY:u});return[`M${e},${t} C${a},${l} ${d},${u} ${r},${i}`,c,f,h,p]}function fa({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,s=n<e?n+i:n-i,o=Math.abs(r-t)/2,a=r<t?r+o:r-o;return[s,a,i,o]}function dh({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:s="basic"}){if(s==="manual")return r;const o=i&&n?r+1e3:r,a=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return o+a}function fh({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){const s=un(en(e),en(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);const o={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return wt(o,dn(s))>0}const hh=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,ph=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),gh=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||hh;let i;return ta(e)?i={...e}:i={...e,id:r(e)},ph(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function ha({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,s,o,a]=fa({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,s,o,a]}const Di={[K.Left]:{x:-1,y:0},[K.Right]:{x:1,y:0},[K.Top]:{x:0,y:-1},[K.Bottom]:{x:0,y:1}},mh=({source:e,sourcePosition:t=K.Bottom,target:n})=>t===K.Left||t===K.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},zi=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function yh({source:e,sourcePosition:t=K.Bottom,target:n,targetPosition:r=K.Top,center:i,offset:s,stepPosition:o}){const a=Di[t],l=Di[r],d={x:e.x+a.x*s,y:e.y+a.y*s},u={x:n.x+l.x*s,y:n.y+l.y*s},c=mh({source:d,sourcePosition:t,target:u}),f=c.x!==0?"x":"y",h=c[f];let p=[],x,m;const y={x:0,y:0},v={x:0,y:0},[,,g,w]=fa({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[f]*l[f]===-1){f==="x"?(x=i.x??d.x+(u.x-d.x)*o,m=i.y??(d.y+u.y)/2):(x=i.x??(d.x+u.x)/2,m=i.y??d.y+(u.y-d.y)*o);const _=[{x,y:d.y},{x,y:u.y}],M=[{x:d.x,y:m},{x:u.x,y:m}];a[f]===h?p=f==="x"?_:M:p=f==="x"?M:_}else{const _=[{x:d.x,y:u.y}],M=[{x:u.x,y:d.y}];if(f==="x"?p=a.x===h?M:_:p=a.y===h?_:M,t===r){const C=Math.abs(e[f]-n[f]);if(C<=s){const j=Math.min(s-1,s-C);a[f]===h?y[f]=(d[f]>e[f]?-1:1)*j:v[f]=(u[f]>n[f]?-1:1)*j}}if(t!==r){const C=f==="x"?"y":"x",j=a[f]===l[C],E=d[C]>u[C],P=d[C]<u[C];(a[f]===1&&(!j&&E||j&&P)||a[f]!==1&&(!j&&P||j&&E))&&(p=f==="x"?_:M)}const b={x:d.x+y.x,y:d.y+y.y},N={x:u.x+v.x,y:u.y+v.y},A=Math.max(Math.abs(b.x-p[0].x),Math.abs(N.x-p[0].x)),S=Math.max(Math.abs(b.y-p[0].y),Math.abs(N.y-p[0].y));A>=S?(x=(b.x+N.x)/2,m=p[0].y):(x=p[0].x,m=(b.y+N.y)/2)}return[[e,{x:d.x+y.x,y:d.y+y.y},...p,{x:u.x+v.x,y:u.y+v.y},n],x,m,g,w]}function xh(e,t,n,r){const i=Math.min(zi(e,t)/2,zi(t,n)/2,r),{x:s,y:o}=t;if(e.x===s&&s===n.x||e.y===o&&o===n.y)return`L${s} ${o}`;if(e.y===o){const d=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${s+i*d},${o}Q ${s},${o} ${s},${o+i*u}`}const a=e.x<n.x?1:-1,l=e.y<n.y?-1:1;return`L ${s},${o+i*l}Q ${s},${o} ${s+i*a},${o}`}function Rr({sourceX:e,sourceY:t,sourcePosition:n=K.Bottom,targetX:r,targetY:i,targetPosition:s=K.Top,borderRadius:o=5,centerX:a,centerY:l,offset:d=20,stepPosition:u=.5}){const[c,f,h,p,x]=yh({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:a,y:l},offset:d,stepPosition:u});return[c.reduce((y,v,g)=>{let w="";return g>0&&g<c.length-1?w=xh(c[g-1],v,c[g+1],o):w=`${g===0?"M":"L"}${v.x} ${v.y}`,y+=w,y},""),f,h,p,x]}function Vi(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function wh(e){var c;const{sourceNode:t,targetNode:n}=e;if(!Vi(t)||!Vi(n))return null;const r=t.internals.handleBounds||Hi(t.handles),i=n.internals.handleBounds||Hi(n.handles),s=Fi((r==null?void 0:r.source)??[],e.sourceHandle),o=Fi(e.connectionMode===Ze.Strict?(i==null?void 0:i.target)??[]:((i==null?void 0:i.target)??[]).concat((i==null?void 0:i.source)??[]),e.targetHandle);if(!s||!o)return(c=e.onError)==null||c.call(e,"008",ve.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=(s==null?void 0:s.position)||K.Bottom,l=(o==null?void 0:o.position)||K.Top,d=Fe(t,s,a),u=Fe(n,o,l);return{sourceX:d.x,sourceY:d.y,targetX:u.x,targetY:u.y,sourcePosition:a,targetPosition:l}}function Hi(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function Fe(e,t,n=K.Left,r=!1){const i=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,s=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:a}=t??ke(e);if(r)return{x:i+o/2,y:s+a/2};switch((t==null?void 0:t.position)??n){case K.Top:return{x:i+o/2,y:s};case K.Right:return{x:i+o,y:s+a/2};case K.Bottom:return{x:i+o/2,y:s+a};case K.Left:return{x:i,y:s+a/2}}}function Fi(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function $r(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function vh(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){const s=new Set;return e.reduce((o,a)=>([a.markerStart||r,a.markerEnd||i].forEach(l=>{if(l&&typeof l=="object"){const d=$r(l,t);s.has(d)||(o.push({id:d,color:l.color||n,...l}),s.add(d))}}),o),[]).sort((o,a)=>o.id.localeCompare(a.id))}const pa=1e3,bh=10,Jr={nodeOrigin:[0,0],nodeExtent:yt,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_h={...Jr,checkEquality:!0};function ei(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function Eh(e,t,n){const r=ei(Jr,n);for(const i of e.values())if(i.parentId)ni(i,e,t,r);else{const s=Nt(i,r.nodeOrigin),o=et(i.extent)?i.extent:r.nodeExtent,a=He(s,o,ke(i));i.internals.positionAbsolute=a}}function Nh(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const i of e.handles){const s={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(s):i.type==="target"&&r.push(s)}return{source:n,target:r}}function ti(e){return e==="manual"}function Or(e,t,n,r={}){var d,u;const i=ei(_h,r),s={i:0},o=new Map(t),a=i!=null&&i.elevateNodesOnSelect&&!ti(i.zIndexMode)?pa:0;let l=e.length>0;t.clear(),n.clear();for(const c of e){let f=o.get(c.id);if(i.checkEquality&&c===(f==null?void 0:f.internals.userNode))t.set(c.id,f);else{const h=Nt(c,i.nodeOrigin),p=et(c.extent)?c.extent:i.nodeExtent,x=He(h,p,ke(c));f={...i.defaults,...c,measured:{width:(d=c.measured)==null?void 0:d.width,height:(u=c.measured)==null?void 0:u.height},internals:{positionAbsolute:x,handleBounds:Nh(c,f),z:ga(c,a,i.zIndexMode),userNode:c}},t.set(c.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(l=!1),c.parentId&&ni(f,t,n,r,s)}return l}function Sh(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function ni(e,t,n,r,i){const{elevateNodesOnSelect:s,nodeOrigin:o,nodeExtent:a,zIndexMode:l}=ei(Jr,r),d=e.parentId,u=t.get(d);if(!u){console.warn(`Parent node ${d} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Sh(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&l==="auto"&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*bh),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);const c=s&&!ti(l)?pa:0,{x:f,y:h,z:p}=kh(e,u,o,a,c,l),{positionAbsolute:x}=e.internals,m=f!==x.x||h!==x.y;(m||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:m?{x:f,y:h}:x,z:p}})}function ga(e,t,n){const r=pe(e.zIndex)?e.zIndex:0;return ti(n)?r:r+(e.selected?t:0)}function kh(e,t,n,r,i,s){const{x:o,y:a}=t.internals.positionAbsolute,l=ke(e),d=Nt(e,n),u=et(e.extent)?He(d,e.extent,l):d;let c=He({x:o+u.x,y:a+u.y},r,l);e.extent==="parent"&&(c=ra(c,l,t));const f=ga(e,i,s),h=t.internals.z??0;return{x:c.x,y:c.y,z:h>=f?h+1:f}}function ri(e,t,n,r=[0,0]){var o;const i=[],s=new Map;for(const a of e){const l=t.get(a.parentId);if(!l)continue;const d=((o=s.get(a.parentId))==null?void 0:o.expandedRect)??Je(l),u=oa(d,a.rect);s.set(a.parentId,{expandedRect:u,parent:l})}return s.size>0&&s.forEach(({expandedRect:a,parent:l},d)=>{var g;const u=l.internals.positionAbsolute,c=ke(l),f=l.origin??r,h=a.x<u.x?Math.round(Math.abs(u.x-a.x)):0,p=a.y<u.y?Math.round(Math.abs(u.y-a.y)):0,x=Math.max(c.width,Math.round(a.width)),m=Math.max(c.height,Math.round(a.height)),y=(x-c.width)*f[0],v=(m-c.height)*f[1];(h>0||p>0||y||v)&&(i.push({id:d,type:"position",position:{x:l.position.x-h+y,y:l.position.y-p+v}}),(g=n.get(d))==null||g.forEach(w=>{e.some(k=>k.id===w.id)||i.push({id:w.id,type:"position",position:{x:w.position.x+h,y:w.position.y+p}})})),(c.width<a.width||c.height<a.height||h||p)&&i.push({id:d,type:"dimensions",setAttributes:!0,dimensions:{width:x+(h?f[0]*h-y:0),height:m+(p?f[1]*p-v:0)}})}),i}function Ch(e,t,n,r,i,s,o){const a=r==null?void 0:r.querySelector(".xyflow__viewport");let l=!1;if(!a)return{changes:[],updatedInternals:l};const d=[],u=window.getComputedStyle(a),{m22:c}=new window.DOMMatrixReadOnly(u.transform),f=[];for(const h of e.values()){const p=t.get(h.id);if(!p)continue;if(p.hidden){t.set(p.id,{...p,internals:{...p.internals,handleBounds:void 0}}),l=!0;continue}const x=Zr(h.nodeElement),m=p.measured.width!==x.width||p.measured.height!==x.height;if(!!(x.width&&x.height&&(m||!p.internals.handleBounds||h.force))){const v=h.nodeElement.getBoundingClientRect(),g=et(p.extent)?p.extent:s;let{positionAbsolute:w}=p.internals;p.parentId&&p.extent==="parent"?w=ra(w,x,t.get(p.parentId)):g&&(w=He(w,g,x));const k={...p,measured:x,internals:{...p.internals,positionAbsolute:w,handleBounds:{source:Oi("source",h.nodeElement,v,c,p.id),target:Oi("target",h.nodeElement,v,c,p.id)}}};t.set(p.id,k),p.parentId&&ni(k,t,n,{nodeOrigin:i,zIndexMode:o}),l=!0,m&&(d.push({id:p.id,type:"dimensions",dimensions:x}),p.expandParent&&p.parentId&&f.push({id:p.id,parentId:p.parentId,rect:Je(k,i)}))}}if(f.length>0){const h=ri(f,t,n,i);d.push(...h)}return{changes:d,updatedInternals:l}}async function Mh({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:s}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,s]],r),a=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(a)}function Bi(e,t,n,r,i,s){let o=i;const a=r.get(o)||new Map;r.set(o,a.set(n,t)),o=`${i}-${e}`;const l=r.get(o)||new Map;if(r.set(o,l.set(n,t)),s){o=`${i}-${e}-${s}`;const d=r.get(o)||new Map;r.set(o,d.set(n,t))}}function ma(e,t,n){e.clear(),t.clear();for(const r of n){const{source:i,target:s,sourceHandle:o=null,targetHandle:a=null}=r,l={edgeId:r.id,source:i,target:s,sourceHandle:o,targetHandle:a},d=`${i}-${o}--${s}-${a}`,u=`${s}-${a}--${i}-${o}`;Bi("source",l,u,e,i,o),Bi("target",l,d,e,s,a),t.set(r.id,r)}}function ya(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:ya(n,t):!1}function qi(e,t,n){var i;let r=e;do{if((i=r==null?void 0:r.matches)!=null&&i.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function Ih(e,t,n,r){const i=new Map;for(const[s,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!ya(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const a=e.get(s);a&&i.set(s,{id:s,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return i}function En({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,a,l;const i=[];for(const[d,u]of t){const c=(o=n.get(d))==null?void 0:o.internals.userNode;c&&i.push({...c,position:u.position,dragging:r})}if(!e)return[i[0],i];const s=(a=n.get(e))==null?void 0:a.internals.userNode;return[s?{...s,position:((l=t.get(e))==null?void 0:l.position)||s.position,dragging:r}:i[0],i]}function Ah({dragItems:e,snapGrid:t,x:n,y:r}){const i=e.values().next().value;if(!i)return null;const s={x:n-i.distance.x,y:r-i.distance.y},o=kt(s,t);return{x:o.x-s.x,y:o.y-s.y}}function Th({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},o=0,a=new Map,l=!1,d={x:0,y:0},u=null,c=!1,f=null,h=!1,p=!1,x=null;function m({noDragClassName:v,handleSelector:g,domNode:w,isSelectable:k,nodeId:_,nodeClickDistance:M=0}){f=ue(w);function b({x:C,y:j}){const{nodeLookup:E,nodeExtent:P,snapGrid:L,snapToGrid:D,nodeOrigin:O,onNodeDrag:R,onSelectionDrag:H,onError:q,updateNodePositions:F}=t();s={x:C,y:j};let T=!1;const $=a.size>1,z=$&&P?Pr(St(a)):null,B=$&&D?Ah({dragItems:a,snapGrid:L,x:C,y:j}):null;for(const[G,Y]of a){if(!E.has(G))continue;let W={x:C-Y.distance.x,y:j-Y.distance.y};D&&(W=B?{x:Math.round(W.x+B.x),y:Math.round(W.y+B.y)}:kt(W,L));let Z=null;if($&&P&&!Y.extent&&z){const{positionAbsolute:X}=Y.internals,J=X.x-z.x+P[0][0],ne=X.x+Y.measured.width-z.x2+P[1][0],ee=X.y-z.y+P[0][1],ce=X.y+Y.measured.height-z.y2+P[1][1];Z=[[J,ee],[ne,ce]]}const{position:Q,positionAbsolute:U}=na({nodeId:G,nextPosition:W,nodeLookup:E,nodeExtent:Z||P,nodeOrigin:O,onError:q});T=T||Y.position.x!==Q.x||Y.position.y!==Q.y,Y.position=Q,Y.internals.positionAbsolute=U}if(p=p||T,!!T&&(F(a,!0),x&&(r||R||!_&&H))){const[G,Y]=En({nodeId:_,dragItems:a,nodeLookup:E});r==null||r(x,a,G,Y),R==null||R(x,G,Y),_||H==null||H(x,Y)}}async function N(){if(!u)return;const{transform:C,panBy:j,autoPanSpeed:E,autoPanOnNodeDrag:P}=t();if(!P){l=!1,cancelAnimationFrame(o);return}const[L,D]=ia(d,u,E);(L!==0||D!==0)&&(s.x=(s.x??0)-L/C[2],s.y=(s.y??0)-D/C[2],await j({x:L,y:D})&&b(s)),o=requestAnimationFrame(N)}function A(C){var $;const{nodeLookup:j,multiSelectionActive:E,nodesDraggable:P,transform:L,snapGrid:D,snapToGrid:O,selectNodesOnDrag:R,onNodeDragStart:H,onSelectionDragStart:q,unselectNodesAndEdges:F}=t();c=!0,(!R||!k)&&!E&&_&&(($=j.get(_))!=null&&$.selected||F()),k&&R&&_&&(e==null||e(_));const T=ft(C.sourceEvent,{transform:L,snapGrid:D,snapToGrid:O,containerBounds:u});if(s=T,a=Ih(j,P,T,_),a.size>0&&(n||H||!_&&q)){const[z,B]=En({nodeId:_,dragItems:a,nodeLookup:j});n==null||n(C.sourceEvent,a,z,B),H==null||H(C.sourceEvent,z,B),_||q==null||q(C.sourceEvent,B)}}const S=$s().clickDistance(M).on("start",C=>{const{domNode:j,nodeDragThreshold:E,transform:P,snapGrid:L,snapToGrid:D}=t();u=(j==null?void 0:j.getBoundingClientRect())||null,h=!1,p=!1,x=C.sourceEvent,E===0&&A(C),s=ft(C.sourceEvent,{transform:P,snapGrid:L,snapToGrid:D,containerBounds:u}),d=ge(C.sourceEvent,u)}).on("drag",C=>{const{autoPanOnNodeDrag:j,transform:E,snapGrid:P,snapToGrid:L,nodeDragThreshold:D,nodeLookup:O}=t(),R=ft(C.sourceEvent,{transform:E,snapGrid:P,snapToGrid:L,containerBounds:u});if(x=C.sourceEvent,(C.sourceEvent.type==="touchmove"&&C.sourceEvent.touches.length>1||_&&!O.has(_))&&(h=!0),!h){if(!l&&j&&c&&(l=!0,N()),!c){const H=ge(C.sourceEvent,u),q=H.x-d.x,F=H.y-d.y;Math.sqrt(q*q+F*F)>D&&A(C)}(s.x!==R.xSnapped||s.y!==R.ySnapped)&&a&&c&&(d=ge(C.sourceEvent,u),b(R))}}).on("end",C=>{if(!(!c||h)&&(l=!1,c=!1,cancelAnimationFrame(o),a.size>0)){const{nodeLookup:j,updateNodePositions:E,onNodeDragStop:P,onSelectionDragStop:L}=t();if(p&&(E(a,!1),p=!1),i||P||!_&&L){const[D,O]=En({nodeId:_,dragItems:a,nodeLookup:j,dragging:!1});i==null||i(C.sourceEvent,a,D,O),P==null||P(C.sourceEvent,D,O),_||L==null||L(C.sourceEvent,O)}}}).filter(C=>{const j=C.target;return!C.button&&(!v||!qi(j,`.${v}`,w))&&(!g||qi(j,g,w))});f.call(S)}function y(){f==null||f.on(".drag",null)}return{update:m,destroy:y}}function Lh(e,t,n){const r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const s of t.values())wt(i,Je(s))>0&&r.push(s);return r}const Ph=250;function Rh(e,t,n,r){var a,l;let i=[],s=1/0;const o=Lh(e,n,t+Ph);for(const d of o){const u=[...((a=d.internals.handleBounds)==null?void 0:a.source)??[],...((l=d.internals.handleBounds)==null?void 0:l.target)??[]];for(const c of u){if(r.nodeId===c.nodeId&&r.type===c.type&&r.id===c.id)continue;const{x:f,y:h}=Fe(d,c,c.position,!0),p=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(h-e.y,2));p>t||(p<s?(i=[{...c,x:f,y:h}],s=p):p===s&&i.push({...c,x:f,y:h}))}}if(!i.length)return null;if(i.length>1){const d=r.type==="source"?"target":"source";return i.find(u=>u.type===d)??i[0]}return i[0]}function xa(e,t,n,r,i,s=!1){var d,u,c;const o=r.get(e);if(!o)return null;const a=i==="strict"?(d=o.internals.handleBounds)==null?void 0:d[t]:[...((u=o.internals.handleBounds)==null?void 0:u.source)??[],...((c=o.internals.handleBounds)==null?void 0:c.target)??[]],l=(n?a==null?void 0:a.find(f=>f.id===n):a==null?void 0:a[0])??null;return l&&s?{...l,...Fe(o,l,l.position,!0)}:l}function wa(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function $h(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const va=()=>!0;function Oh(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:o,domNode:a,nodeLookup:l,lib:d,autoPanOnConnect:u,flowId:c,panBy:f,cancelConnection:h,onConnectStart:p,onConnect:x,onConnectEnd:m,isValidConnection:y=va,onReconnectEnd:v,updateConnection:g,getTransform:w,getFromHandle:k,autoPanSpeed:_,dragThreshold:M=1,handleDomNode:b}){const N=ca(e.target);let A=0,S;const{x:C,y:j}=ge(e),E=wa(s,b),P=a==null?void 0:a.getBoundingClientRect();let L=!1;if(!P||!E)return;const D=xa(i,E,r,l,t);if(!D)return;let O=ge(e,P),R=!1,H=null,q=!1,F=null;function T(){if(!u||!P)return;const[Q,U]=ia(O,P,_);f({x:Q,y:U}),A=requestAnimationFrame(T)}const $={...D,nodeId:i,type:E,position:D.position},z=l.get(i);let G={inProgress:!0,isValid:null,from:Fe(z,$,K.Left,!0),fromHandle:$,fromPosition:$.position,fromNode:z,to:O,toHandle:null,toPosition:Li[$.position],toNode:null,pointer:O};function Y(){L=!0,g(G),p==null||p(e,{nodeId:i,handleId:r,handleType:E})}M===0&&Y();function W(Q){if(!L){const{x:ce,y:Ce}=ge(Q),_e=ce-C,Pe=Ce-j;if(!(_e*_e+Pe*Pe>M*M))return;Y()}if(!k()||!$){Z(Q);return}const U=w();O=ge(Q,P),S=Rh(Ct(O,U,!1,[1,1]),n,l,$),R||(T(),R=!0);const X=ba(Q,{handle:S,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?"target":"source",isValidConnection:y,doc:N,lib:d,flowId:c,nodeLookup:l});F=X.handleDomNode,H=X.connection,q=$h(!!S,X.isValid);const J=l.get(i),ne=J?Fe(J,$,K.Left,!0):G.from,ee={...G,from:ne,isValid:q,to:X.toHandle&&q?tn({x:X.toHandle.x,y:X.toHandle.y},U):O,toHandle:X.toHandle,toPosition:q&&X.toHandle?X.toHandle.position:Li[$.position],toNode:X.toHandle?l.get(X.toHandle.nodeId):null,pointer:O};g(ee),G=ee}function Z(Q){if(!("touches"in Q&&Q.touches.length>0)){if(L){(S||F)&&H&&q&&(x==null||x(H));const{inProgress:U,...X}=G,J={...X,toPosition:G.toHandle?G.toPosition:null};m==null||m(Q,J),s&&(v==null||v(Q,J))}h(),cancelAnimationFrame(A),R=!1,q=!1,H=null,F=null,N.removeEventListener("mousemove",W),N.removeEventListener("mouseup",Z),N.removeEventListener("touchmove",W),N.removeEventListener("touchend",Z)}}N.addEventListener("mousemove",W),N.addEventListener("mouseup",Z),N.addEventListener("touchmove",W),N.addEventListener("touchend",Z)}function ba(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:o,lib:a,flowId:l,isValidConnection:d=va,nodeLookup:u}){const c=s==="target",f=t?o.querySelector(`.${a}-flow__handle[data-id="${l}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:h,y:p}=ge(e),x=o.elementFromPoint(h,p),m=x!=null&&x.classList.contains(`${a}-flow__handle`)?x:f,y={handleDomNode:m,isValid:!1,connection:null,toHandle:null};if(m){const v=wa(void 0,m),g=m.getAttribute("data-nodeid"),w=m.getAttribute("data-handleid"),k=m.classList.contains("connectable"),_=m.classList.contains("connectableend");if(!g||!v)return y;const M={source:c?g:r,sourceHandle:c?w:i,target:c?r:g,targetHandle:c?i:w};y.connection=M;const N=k&&_&&(n===Ze.Strict?c&&v==="source"||!c&&v==="target":g!==r||w!==i);y.isValid=N&&d(M),y.toHandle=xa(g,v,w,u,n,!0)}return y}const jr={onPointerDown:Oh,isValid:ba};function jh({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const i=ue(e);function s({translateExtent:a,width:l,height:d,zoomStep:u=1,pannable:c=!0,zoomable:f=!0,inversePan:h=!1}){const p=g=>{if(g.sourceEvent.type!=="wheel"||!t)return;const w=n(),k=g.sourceEvent.ctrlKey&&vt()?10:1,_=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*u,M=w[2]*Math.pow(2,_*k);t.scaleTo(M)};let x=[0,0];const m=g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(x=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},y=g=>{const w=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;const k=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],_=[k[0]-x[0],k[1]-x[1]];x=k;const M=r()*Math.max(w[2],Math.log(w[2]))*(h?-1:1),b={x:w[0]-_[0]*M,y:w[1]-_[1]*M},N=[[0,0],[l,d]];t.setViewportConstrained({x:b.x,y:b.y,zoom:w[2]},N,a)},v=Ks().on("start",m).on("zoom",c?y:null).on("zoom.wheel",f?p:null);i.call(v,{})}function o(){i.on("zoom",null)}return{update:s,destroy:o,pointer:fe}}const fn=e=>({x:e.x,y:e.y,zoom:e.k}),Nn=({x:e,y:t,zoom:n})=>ln.translate(e,t).scale(n),Ye=(e,t)=>e.target.closest(`.${t}`),_a=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Dh=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Sn=(e,t=0,n=Dh,r=()=>{})=>{const i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},Ea=e=>{const t=e.ctrlKey&&vt()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function zh({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:o,onPanZoomStart:a,onPanZoom:l,onPanZoomEnd:d}){return u=>{if(Ye(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const c=n.property("__zoom").k||1;if(u.ctrlKey&&o){const m=fe(u),y=Ea(u),v=c*Math.pow(2,y);r.scaleTo(n,v,m,u);return}const f=u.deltaMode===1?20:1;let h=i===De.Vertical?0:u.deltaX*f,p=i===De.Horizontal?0:u.deltaY*f;!vt()&&u.shiftKey&&i!==De.Vertical&&(h=u.deltaY*f,p=0),r.translateBy(n,-(h/c)*s,-(p/c)*s,{internal:!0});const x=fn(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l==null||l(u,x),e.panScrollTimeout=setTimeout(()=>{d==null||d(u,x),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,a==null||a(u,x))}}function Vh({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){const s=r.type==="wheel",o=!t&&s&&!r.ctrlKey,a=Ye(r,e);if(r.ctrlKey&&s&&a&&r.preventDefault(),o||a)return null;r.preventDefault(),n.call(this,r,i)}}function Hh({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var s,o,a;if((s=r.sourceEvent)!=null&&s.internal)return;const i=fn(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=i,((a=r.sourceEvent)==null?void 0:a.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,i))}}function Fh({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{var o,a;e.usedRightMouseButton=!!(n&&_a(t,e.mouseButton??0)),(o=s.sourceEvent)!=null&&o.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!((a=s.sourceEvent)!=null&&a.internal)&&(i==null||i(s.sourceEvent,fn(s.transform)))}}function Bh({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return o=>{var a;if(!((a=o.sourceEvent)!=null&&a.internal)&&(e.isZoomingOrPanning=!1,s&&_a(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&s(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){const l=fn(o.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i==null||i(o.sourceEvent,l)},n?150:0)}}}function qh({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:o,noWheelClassName:a,noPanClassName:l,lib:d,connectionInProgress:u}){return c=>{var m;const f=e||t,h=n&&c.ctrlKey,p=c.type==="wheel";if(c.button===1&&c.type==="mousedown"&&(Ye(c,`${d}-flow__node`)||Ye(c,`${d}-flow__edge`)))return!0;if(!r&&!f&&!i&&!s&&!n||o||u&&!p||Ye(c,a)&&p||Ye(c,l)&&(!p||i&&p&&!e)||!n&&c.ctrlKey&&p)return!1;if(!n&&c.type==="touchstart"&&((m=c.touches)==null?void 0:m.length)>1)return c.preventDefault(),!1;if(!f&&!i&&!h&&p||!r&&(c.type==="mousedown"||c.type==="touchstart")||Array.isArray(r)&&!r.includes(c.button)&&c.type==="mousedown")return!1;const x=Array.isArray(r)&&r.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||p)&&x}}function Yh({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:s,onPanZoomStart:o,onPanZoomEnd:a,onDraggingChange:l}){const d={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),c=Ks().scaleExtent([t,n]).translateExtent(r),f=ue(e).call(c);v({x:i.x,y:i.y,zoom:Qe(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);const h=f.on("wheel.zoom"),p=f.on("dblclick.zoom");c.wheelDelta(Ea);function x(S,C){return f?new Promise(j=>{c==null||c.interpolate((C==null?void 0:C.interpolate)==="linear"?dt:Ft).transform(Sn(f,C==null?void 0:C.duration,C==null?void 0:C.ease,()=>j(!0)),S)}):Promise.resolve(!1)}function m({noWheelClassName:S,noPanClassName:C,onPaneContextMenu:j,userSelectionActive:E,panOnScroll:P,panOnDrag:L,panOnScrollMode:D,panOnScrollSpeed:O,preventScrolling:R,zoomOnPinch:H,zoomOnScroll:q,zoomOnDoubleClick:F,zoomActivationKeyPressed:T,lib:$,onTransformChange:z,connectionInProgress:B,paneClickDistance:G,selectionOnDrag:Y}){E&&!d.isZoomingOrPanning&&y();const W=P&&!T&&!E;c.clickDistance(Y?1/0:!pe(G)||G<0?0:G);const Z=W?zh({zoomPanValues:d,noWheelClassName:S,d3Selection:f,d3Zoom:c,panOnScrollMode:D,panOnScrollSpeed:O,zoomOnPinch:H,onPanZoomStart:o,onPanZoom:s,onPanZoomEnd:a}):Vh({noWheelClassName:S,preventScrolling:R,d3ZoomHandler:h});if(f.on("wheel.zoom",Z,{passive:!1}),!E){const U=Hh({zoomPanValues:d,onDraggingChange:l,onPanZoomStart:o});c.on("start",U);const X=Fh({zoomPanValues:d,panOnDrag:L,onPaneContextMenu:!!j,onPanZoom:s,onTransformChange:z});c.on("zoom",X);const J=Bh({zoomPanValues:d,panOnDrag:L,panOnScroll:P,onPaneContextMenu:j,onPanZoomEnd:a,onDraggingChange:l});c.on("end",J)}const Q=qh({zoomActivationKeyPressed:T,panOnDrag:L,zoomOnScroll:q,panOnScroll:P,zoomOnDoubleClick:F,zoomOnPinch:H,userSelectionActive:E,noPanClassName:C,noWheelClassName:S,lib:$,connectionInProgress:B});c.filter(Q),F?f.on("dblclick.zoom",p):f.on("dblclick.zoom",null)}function y(){c.on("zoom",null)}async function v(S,C,j){const E=Nn(S),P=c==null?void 0:c.constrain()(E,C,j);return P&&await x(P),new Promise(L=>L(P))}async function g(S,C){const j=Nn(S);return await x(j,C),new Promise(E=>E(j))}function w(S){if(f){const C=Nn(S),j=f.property("__zoom");(j.k!==S.zoom||j.x!==S.x||j.y!==S.y)&&(c==null||c.transform(f,C,null,{sync:!0}))}}function k(){const S=f?Us(f.node()):{x:0,y:0,k:1};return{x:S.x,y:S.y,zoom:S.k}}function _(S,C){return f?new Promise(j=>{c==null||c.interpolate((C==null?void 0:C.interpolate)==="linear"?dt:Ft).scaleTo(Sn(f,C==null?void 0:C.duration,C==null?void 0:C.ease,()=>j(!0)),S)}):Promise.resolve(!1)}function M(S,C){return f?new Promise(j=>{c==null||c.interpolate((C==null?void 0:C.interpolate)==="linear"?dt:Ft).scaleBy(Sn(f,C==null?void 0:C.duration,C==null?void 0:C.ease,()=>j(!0)),S)}):Promise.resolve(!1)}function b(S){c==null||c.scaleExtent(S)}function N(S){c==null||c.translateExtent(S)}function A(S){const C=!pe(S)||S<0?0:S;c==null||c.clickDistance(C)}return{update:m,destroy:y,setViewport:g,setViewportConstrained:v,getViewport:k,scaleTo:_,scaleBy:M,setScaleExtent:b,setTranslateExtent:N,syncViewport:w,setClickDistance:A}}var tt;(function(e){e.Line="line",e.Handle="handle"})(tt||(tt={}));function Gh({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:s}){const o=e-t,a=n-r,l=[o>0?1:o<0?-1:0,a>0?1:a<0?-1:0];return o&&i&&(l[0]=l[0]*-1),a&&s&&(l[1]=l[1]*-1),l}function Yi(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}function Me(e,t){return Math.max(0,t-e)}function Ie(e,t){return Math.max(0,e-t)}function jt(e,t,n){return Math.max(0,t-e,e-n)}function Gi(e,t){return e?!t:t}function Wh(e,t,n,r,i,s,o,a){let{affectsX:l,affectsY:d}=t;const{isHorizontal:u,isVertical:c}=t,f=u&&c,{xSnapped:h,ySnapped:p}=n,{minWidth:x,maxWidth:m,minHeight:y,maxHeight:v}=r,{x:g,y:w,width:k,height:_,aspectRatio:M}=e;let b=Math.floor(u?h-e.pointerX:0),N=Math.floor(c?p-e.pointerY:0);const A=k+(l?-b:b),S=_+(d?-N:N),C=-s[0]*k,j=-s[1]*_;let E=jt(A,x,m),P=jt(S,y,v);if(o){let O=0,R=0;l&&b<0?O=Me(g+b+C,o[0][0]):!l&&b>0&&(O=Ie(g+A+C,o[1][0])),d&&N<0?R=Me(w+N+j,o[0][1]):!d&&N>0&&(R=Ie(w+S+j,o[1][1])),E=Math.max(E,O),P=Math.max(P,R)}if(a){let O=0,R=0;l&&b>0?O=Ie(g+b,a[0][0]):!l&&b<0&&(O=Me(g+A,a[1][0])),d&&N>0?R=Ie(w+N,a[0][1]):!d&&N<0&&(R=Me(w+S,a[1][1])),E=Math.max(E,O),P=Math.max(P,R)}if(i){if(u){const O=jt(A/M,y,v)*M;if(E=Math.max(E,O),o){let R=0;!l&&!d||l&&!d&&f?R=Ie(w+j+A/M,o[1][1])*M:R=Me(w+j+(l?b:-b)/M,o[0][1])*M,E=Math.max(E,R)}if(a){let R=0;!l&&!d||l&&!d&&f?R=Me(w+A/M,a[1][1])*M:R=Ie(w+(l?b:-b)/M,a[0][1])*M,E=Math.max(E,R)}}if(c){const O=jt(S*M,x,m)/M;if(P=Math.max(P,O),o){let R=0;!l&&!d||d&&!l&&f?R=Ie(g+S*M+C,o[1][0])/M:R=Me(g+(d?N:-N)*M+C,o[0][0])/M,P=Math.max(P,R)}if(a){let R=0;!l&&!d||d&&!l&&f?R=Me(g+S*M,a[1][0])/M:R=Ie(g+(d?N:-N)*M,a[0][0])/M,P=Math.max(P,R)}}}N=N+(N<0?P:-P),b=b+(b<0?E:-E),i&&(f?A>S*M?N=(Gi(l,d)?-b:b)/M:b=(Gi(l,d)?-N:N)*M:u?(N=b/M,d=l):(b=N*M,l=d));const L=l?g+b:g,D=d?w+N:w;return{width:k+(l?-b:b),height:_+(d?-N:N),x:s[0]*b*(l?-1:1)+L,y:s[1]*N*(d?-1:1)+D}}const Na={width:0,height:0,x:0,y:0},Xh={...Na,pointerX:0,pointerY:0,aspectRatio:1};function Uh(e){return[[0,0],[e.measured.width,e.measured.height]]}function Kh(e,t,n){const r=t.position.x+e.position.x,i=t.position.y+e.position.y,s=e.measured.width??0,o=e.measured.height??0,a=n[0]*s,l=n[1]*o;return[[r-a,i-l],[r+s-a,i+o-l]]}function Zh({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){const s=ue(e);let o={controlDirection:Yi("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function a({controlPosition:d,boundaries:u,keepAspectRatio:c,resizeDirection:f,onResizeStart:h,onResize:p,onResizeEnd:x,shouldResize:m}){let y={...Na},v={...Xh};o={boundaries:u,resizeDirection:f,keepAspectRatio:c,controlDirection:Yi(d)};let g,w=null,k=[],_,M,b,N=!1;const A=$s().on("start",S=>{const{nodeLookup:C,transform:j,snapGrid:E,snapToGrid:P,nodeOrigin:L,paneDomNode:D}=n();if(g=C.get(t),!g)return;w=(D==null?void 0:D.getBoundingClientRect())??null;const{xSnapped:O,ySnapped:R}=ft(S.sourceEvent,{transform:j,snapGrid:E,snapToGrid:P,containerBounds:w});y={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},v={...y,pointerX:O,pointerY:R,aspectRatio:y.width/y.height},_=void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(_=C.get(g.parentId),M=_&&g.extent==="parent"?Uh(_):void 0),k=[],b=void 0;for(const[H,q]of C)if(q.parentId===t&&(k.push({id:H,position:{...q.position},extent:q.extent}),q.extent==="parent"||q.expandParent)){const F=Kh(q,g,q.origin??L);b?b=[[Math.min(F[0][0],b[0][0]),Math.min(F[0][1],b[0][1])],[Math.max(F[1][0],b[1][0]),Math.max(F[1][1],b[1][1])]]:b=F}h==null||h(S,{...y})}).on("drag",S=>{const{transform:C,snapGrid:j,snapToGrid:E,nodeOrigin:P}=n(),L=ft(S.sourceEvent,{transform:C,snapGrid:j,snapToGrid:E,containerBounds:w}),D=[];if(!g)return;const{x:O,y:R,width:H,height:q}=y,F={},T=g.origin??P,{width:$,height:z,x:B,y:G}=Wh(v,o.controlDirection,L,o.boundaries,o.keepAspectRatio,T,M,b),Y=$!==H,W=z!==q,Z=B!==O&&Y,Q=G!==R&&W;if(!Z&&!Q&&!Y&&!W)return;if((Z||Q||T[0]===1||T[1]===1)&&(F.x=Z?B:y.x,F.y=Q?G:y.y,y.x=F.x,y.y=F.y,k.length>0)){const ne=B-O,ee=G-R;for(const ce of k)ce.position={x:ce.position.x-ne+T[0]*($-H),y:ce.position.y-ee+T[1]*(z-q)},D.push(ce)}if((Y||W)&&(F.width=Y&&(!o.resizeDirection||o.resizeDirection==="horizontal")?$:y.width,F.height=W&&(!o.resizeDirection||o.resizeDirection==="vertical")?z:y.height,y.width=F.width,y.height=F.height),_&&g.expandParent){const ne=T[0]*(F.width??0);F.x&&F.x<ne&&(y.x=ne,v.x=v.x-(F.x-ne));const ee=T[1]*(F.height??0);F.y&&F.y<ee&&(y.y=ee,v.y=v.y-(F.y-ee))}const U=Gh({width:y.width,prevWidth:H,height:y.height,prevHeight:q,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),X={...y,direction:U};(m==null?void 0:m(S,X))!==!1&&(N=!0,p==null||p(S,X),r(F,D))}).on("end",S=>{N&&(x==null||x(S,{...y}),i==null||i({...y}),N=!1)});s.call(A)}function l(){s.on(".drag",null)}return{update:a,destroy:l}}var kn={exports:{}},Cn={},Mn={exports:{}},In={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* use-sync-external-store-shim.production.js
|
|
4
4
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-md:28rem;--container-lg:32rem;--container-5xl:64rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wider:.05em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-accent:#4263eb;--color-accent-light:#5c7cfa;--color-success:#4caf50;--color-warning:#ff9800;--color-danger:#f44336;--color-bg:#fff;--color-bg-secondary:#f8f9fa;--color-bg-tertiary:#e9ecef;--color-text:#212529;--color-text-muted:#6c757d;--color-border:#dee2e6}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.top-2{top:calc(var(--spacing) * 2)}.top-full{top:100%}.right-2{right:calc(var(--spacing) * 2)}.bottom-2{bottom:calc(var(--spacing) * 2)}.left-0{left:calc(var(--spacing) * 0)}.left-2{left:calc(var(--spacing) * 2)}.z-10{z-index:10}.z-50{z-index:50}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.\!h-2{height:calc(var(--spacing) * 2)!important}.h-1{height:calc(var(--spacing) * 1)}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-4{height:calc(var(--spacing) * 4)}.h-full{height:100%}.h-screen{height:100vh}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[400px\]{max-height:400px}.min-h-0{min-height:calc(var(--spacing) * 0)}.\!w-2{width:calc(var(--spacing) * 2)!important}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-8{width:calc(var(--spacing) * 8)}.w-10{width:calc(var(--spacing) * 10)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-32{width:calc(var(--spacing) * 32)}.w-40{width:calc(var(--spacing) * 40)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-80{width:calc(var(--spacing) * 80)}.w-96{width:calc(var(--spacing) * 96)}.w-\[30\%\]{width:30%}.w-full{width:100%}.w-px{width:1px}.max-w-5xl{max-width:var(--container-5xl)}.max-w-\[150px\]{max-width:150px}.max-w-\[200px\]{max-width:200px}.max-w-\[300px\]{max-width:300px}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[200px\]{min-width:200px}.min-w-\[300px\]{min-width:300px}.min-w-\[320px\]{min-width:320px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.rotate-90{rotate:90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.list-disc{list-style-type:disc}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-\[var\(--color-accent\)\]{border-color:var(--color-accent)}.border-\[var\(--color-border\)\]{border-color:var(--color-border)}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500) 30%,transparent)}}.border-transparent{border-color:#0000}.bg-\[var\(--color-accent\)\]{background-color:var(--color-accent)}.bg-\[var\(--color-bg\)\]{background-color:var(--color-bg)}.bg-\[var\(--color-bg-secondary\)\]{background-color:var(--color-bg-secondary)}.bg-\[var\(--color-bg-tertiary\)\]{background-color:var(--color-bg-tertiary)}.bg-\[var\(--color-border\)\]{background-color:var(--color-border)}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/10{background-color:color-mix(in oklab,var(--color-blue-500) 10%,transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500) 20%,transparent)}}.bg-gray-500\/20{background-color:#6a728233}@supports (color:color-mix(in lab,red,red)){.bg-gray-500\/20{background-color:color-mix(in oklab,var(--color-gray-500) 20%,transparent)}}.bg-green-500\/10{background-color:#00c7581a}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/10{background-color:color-mix(in oklab,var(--color-green-500) 10%,transparent)}}.bg-green-500\/20{background-color:#00c75833}@supports (color:color-mix(in lab,red,red)){.bg-green-500\/20{background-color:color-mix(in oklab,var(--color-green-500) 20%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.bg-yellow-500\/20{background-color:#edb20033}@supports (color:color-mix(in lab,red,red)){.bg-yellow-500\/20{background-color:color-mix(in oklab,var(--color-yellow-500) 20%,transparent)}}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-0{padding-block:calc(var(--spacing) * 0)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-8{padding-block:calc(var(--spacing) * 8)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pl-1{padding-left:calc(var(--spacing) * 1)}.pl-4{padding-left:calc(var(--spacing) * 4)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#3a3a5a\]{color:#3a3a5a}.text-\[var\(--color-accent\)\]{color:var(--color-accent)}.text-\[var\(--color-danger\)\]{color:var(--color-danger)}.text-\[var\(--color-text\)\]{color:var(--color-text)}.text-\[var\(--color-text-muted\)\]{color:var(--color-text-muted)}.text-\[var\(--color-warning\)\]{color:var(--color-warning)}.text-blue-400{color:var(--color-blue-400)}.text-blue-500{color:var(--color-blue-500)}.text-gray-400{color:var(--color-gray-400)}.text-green-400{color:var(--color-green-400)}.text-green-500{color:var(--color-green-500)}.text-red-400{color:var(--color-red-400)}.text-red-500{color:var(--color-red-500)}.text-white{color:var(--color-white)}.text-yellow-400{color:var(--color-yellow-400)}.uppercase{text-transform:uppercase}.underline{text-decoration-line:underline}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-\[var\(--color-accent\)\]{--tw-ring-color:var(--color-accent)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.placeholder\:text-\[var\(--color-text-muted\)\]::placeholder{color:var(--color-text-muted)}@media(hover:hover){.hover\:bg-\[var\(--color-accent-light\)\]:hover{background-color:var(--color-accent-light)}.hover\:bg-\[var\(--color-bg-secondary\)\]:hover{background-color:var(--color-bg-secondary)}.hover\:bg-\[var\(--color-bg-tertiary\)\]:hover{background-color:var(--color-bg-tertiary)}.hover\:bg-\[var\(--color-border\)\]:hover{background-color:var(--color-border)}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.hover\:text-\[var\(--color-text\)\]:hover{color:var(--color-text)}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\:border-\[var\(--color-accent\)\]:focus{border-color:var(--color-accent)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-50:disabled{opacity:.5}}.dark{--color-bg:#1a1b1e;--color-bg-secondary:#25262b;--color-bg-tertiary:#2c2e33;--color-text:#c1c2c5;--color-text-muted:#909296;--color-border:#373a40}body{background:var(--color-bg);color:var(--color-text);margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;transition:background .2s,color .2s}.react-flow__node{font-size:12px}.react-flow__attribution{display:none!important}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:var(--color-bg-secondary)}::-webkit-scrollbar-thumb{background:var(--color-border);border-radius:3px}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}
|