Spaces:
Sleeping
Sleeping
import{b as _a,n as Sa,at as Ea,v as Na,r as b,C as Wo,c as Rt,ah as $a,g as qo,R as L,j as G,aP as Yt,aA as Ma,ac as Ta,m as Vr,F as ge,k as Aa,z as ka,B as Ia,E as Pa}from"./index-bf3ffc0f.js";import{g as Oa,P as Ra,c as La,b as Da,e as Va,T as Ba}from"./index-68d29b47.js";import{g as Ha,Z as za,a as Fa}from"./routes-17d4ed4d.js";const ln=e=>e?typeof e=="function"?e():e:null,ja=e=>{const{componentCls:t,popoverColor:n,titleMinWidth:r,fontWeightStrong:o,innerPadding:i,boxShadowSecondary:s,colorTextHeading:a,borderRadiusLG:c,zIndexPopup:u,titleMarginBottom:l,colorBgElevated:f,popoverBg:d,titleBorderBottom:h,innerContentPadding:y,titlePadding:p}=e;return[{[t]:Object.assign(Object.assign({},Na(e)),{position:"absolute",top:0,left:{_skip_check_:!0,value:0},zIndex:u,fontWeight:"normal",whiteSpace:"normal",textAlign:"start",cursor:"auto",userSelect:"text",transformOrigin:"var(--arrow-x, 50%) var(--arrow-y, 50%)","--antd-arrow-background-color":f,"&-rtl":{direction:"rtl"},"&-hidden":{display:"none"},[`${t}-content`]:{position:"relative"},[`${t}-inner`]:{backgroundColor:d,backgroundClip:"padding-box",borderRadius:c,boxShadow:s,padding:i},[`${t}-title`]:{minWidth:r,marginBottom:l,color:a,fontWeight:o,borderBottom:h,padding:p},[`${t}-inner-content`]:{color:n,padding:y}})},Oa(e,"var(--antd-arrow-background-color)"),{[`${t}-pure`]:{position:"relative",maxWidth:"none",margin:e.sizePopupArrow,display:"inline-block",[`${t}-content`]:{display:"inline-block"}}}]},Ga=e=>{const{componentCls:t}=e;return{[t]:Ra.map(n=>{const r=e[`${n}6`];return{[`&${t}-${n}`]:{"--antd-arrow-background-color":r,[`${t}-inner`]:{backgroundColor:r},[`${t}-arrow`]:{background:"transparent"}}}})}},Ua=e=>{const{lineWidth:t,controlHeight:n,fontHeight:r,padding:o,wireframe:i,zIndexPopupBase:s,borderRadiusLG:a,marginXS:c,lineType:u,colorSplit:l,paddingSM:f}=e,d=n-r,h=d/2,y=d/2-t,p=o;return Object.assign(Object.assign(Object.assign({titleMinWidth:177,zIndexPopup:s+30},La(e)),Da({contentRadius:a,limitVerticalRadius:!0})),{innerPadding:i?0:12,titleMarginBottom:i?0:c,titlePadding:i?`${h}px ${p}px ${y}px`:0,titleBorderBottom:i?`${t}px ${u} ${l}`:"none",innerContentPadding:i?`${f}px ${p}px`:0})},Ko=_a("Popover",e=>{const{colorBgElevated:t,colorText:n}=e,r=Sa(e,{popoverBg:t,popoverColor:n});return[ja(r),Ga(r),Ea(r,"zoom-big")]},Ua,{resetStyle:!1,deprecatedTokens:[["width","titleMinWidth"],["minWidth","titleMinWidth"]]});var Za=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const Ya=(e,t,n)=>{if(!(!t&&!n))return b.createElement(b.Fragment,null,t&&b.createElement("div",{className:`${e}-title`},ln(t)),b.createElement("div",{className:`${e}-inner-content`},ln(n)))},Xa=e=>{const{hashId:t,prefixCls:n,className:r,style:o,placement:i="top",title:s,content:a,children:c}=e;return b.createElement("div",{className:Rt(t,n,`${n}-pure`,`${n}-placement-${i}`,r),style:o},b.createElement("div",{className:`${n}-arrow`}),b.createElement(Va,Object.assign({},e,{className:t,prefixCls:n}),c||Ya(n,s,a)))},Wa=e=>{const{prefixCls:t,className:n}=e,r=Za(e,["prefixCls","className"]),{getPrefixCls:o}=b.useContext(Wo),i=o("popover",t),[s,a,c]=Ko(i);return s(b.createElement(Xa,Object.assign({},r,{prefixCls:i,hashId:a,className:Rt(n,c)})))},qa=Wa;var Ka=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n};const Qa=e=>{let{title:t,content:n,prefixCls:r}=e;return b.createElement(b.Fragment,null,t&&b.createElement("div",{className:`${r}-title`},ln(t)),b.createElement("div",{className:`${r}-inner-content`},ln(n)))},Qo=b.forwardRef((e,t)=>{const{prefixCls:n,title:r,content:o,overlayClassName:i,placement:s="top",trigger:a="hover",mouseEnterDelay:c=.1,mouseLeaveDelay:u=.1,overlayStyle:l={}}=e,f=Ka(e,["prefixCls","title","content","overlayClassName","placement","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle"]),{getPrefixCls:d}=b.useContext(Wo),h=d("popover",n),[y,p,w]=Ko(h),m=d(),_=Rt(i,p,w);return y(b.createElement(Ba,Object.assign({placement:s,trigger:a,mouseEnterDelay:c,mouseLeaveDelay:u,overlayStyle:l},f,{prefixCls:h,overlayClassName:_,ref:t,overlay:r||o?b.createElement(Qa,{prefixCls:h,title:r,content:o}):null,transitionName:$a(m,"zoom-big",f.transitionName),"data-popover-inject":!0})))});Qo._InternalPanelDoNotUseOrYouWillBeFired=qa;const Ja=Qo;function me(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=me(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Jo={exports:{}},ei={},ti={exports:{}},ni={};/** | |
* @license React | |
* use-sync-external-store-shim.production.min.js | |
* | |
* Copyright (c) Facebook, Inc. and its affiliates. | |
* | |
* This source code is licensed under the MIT license found in the | |
* LICENSE file in the root directory of this source tree. | |
*/var ht=b;function ec(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var tc=typeof Object.is=="function"?Object.is:ec,nc=ht.useState,rc=ht.useEffect,oc=ht.useLayoutEffect,ic=ht.useDebugValue;function sc(e,t){var n=t(),r=nc({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return oc(function(){o.value=n,o.getSnapshot=t,Vn(o)&&i({inst:o})},[e,n,t]),rc(function(){return Vn(o)&&i({inst:o}),e(function(){Vn(o)&&i({inst:o})})},[e]),ic(n),n}function Vn(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!tc(e,n)}catch{return!0}}function ac(e,t){return t()}var cc=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ac:sc;ni.useSyncExternalStore=ht.useSyncExternalStore!==void 0?ht.useSyncExternalStore:cc;ti.exports=ni;var lc=ti.exports;/** | |
* @license React | |
* use-sync-external-store-shim/with-selector.production.min.js | |
* | |
* Copyright (c) Facebook, Inc. and its affiliates. | |
* | |
* This source code is licensed under the MIT license found in the | |
* LICENSE file in the root directory of this source tree. | |
*/var bn=b,uc=lc;function fc(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var dc=typeof Object.is=="function"?Object.is:fc,hc=uc.useSyncExternalStore,gc=bn.useRef,pc=bn.useEffect,mc=bn.useMemo,yc=bn.useDebugValue;ei.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=gc(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=mc(function(){function c(h){if(!u){if(u=!0,l=h,h=r(h),o!==void 0&&s.hasValue){var y=s.value;if(o(y,h))return f=y}return f=h}if(y=f,dc(l,h))return y;var p=r(h);return o!==void 0&&o(y,p)?y:(l=h,f=p)}var u=!1,l,f,d=n===void 0?null:n;return[function(){return c(t())},d===null?void 0:function(){return c(d())}]},[t,n,r,o]);var a=hc(e,i[0],i[1]);return pc(function(){s.hasValue=!0,s.value=a},[a]),yc(a),a};Jo.exports=ei;var vc=Jo.exports;const ri=qo(vc),Br=e=>{let t;const n=new Set,r=(c,u)=>{const l=typeof c=="function"?c(t):c;if(!Object.is(l,t)){const f=t;t=u??(typeof l!="object"||l===null)?l:Object.assign({},t,l),n.forEach(d=>d(t,f))}},o=()=>t,a={setState:r,getState:o,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{n.clear()}};return t=e(r,o,a),a},oi=e=>e?Br(e):Br,{useDebugValue:xc}=L,{useSyncExternalStoreWithSelector:wc}=ri;function ii(e,t=e.getState,n){const r=wc(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return xc(r),r}const Hr=(e,t)=>{const n=oi(e),r=(o,i=t)=>ii(n,o,i);return Object.assign(r,n),r},Cc=(e,t)=>e?Hr(e,t):Hr;function ue(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var bc={value:()=>{}};function _n(){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 on(n)}function on(e){this._=e}function _c(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}on.prototype=_n.prototype={constructor:on,on:function(e,t){var n=this._,r=_c(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=Sc(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=zr(n[o],e.name,t);else if(t==null)for(o in n)n[o]=zr(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new on(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[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],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};function Sc(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function zr(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=bc,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Wn="http://www.w3.org/1999/xhtml";const Fr={svg:"http://www.w3.org/2000/svg",xhtml:Wn,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)),Fr.hasOwnProperty(t)?{space:Fr[t],local:e}:e}function Ec(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Wn&&t.documentElement.namespaceURI===Wn?t.createElement(e):t.createElementNS(n,e)}}function Nc(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function si(e){var t=Sn(e);return(t.local?Nc:Ec)(t)}function $c(){}function fr(e){return e==null?$c:function(){return this.querySelector(e)}}function Mc(e){typeof e!="function"&&(e=fr(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=new Array(s),c,u,l=0;l<s;++l)(c=i[l])&&(u=e.call(c,c.__data__,l,i))&&("__data__"in c&&(u.__data__=c.__data__),a[l]=u);return new he(r,this._parents)}function Tc(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Ac(){return[]}function ai(e){return e==null?Ac:function(){return this.querySelectorAll(e)}}function kc(e){return function(){return Tc(e.apply(this,arguments))}}function Ic(e){typeof e=="function"?e=kc(e):e=ai(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],a=s.length,c,u=0;u<a;++u)(c=s[u])&&(r.push(e.call(c,c.__data__,u,s)),o.push(c));return new he(r,o)}function ci(e){return function(){return this.matches(e)}}function li(e){return function(t){return t.matches(e)}}var Pc=Array.prototype.find;function Oc(e){return function(){return Pc.call(this.children,e)}}function Rc(){return this.firstElementChild}function Lc(e){return this.select(e==null?Rc:Oc(typeof e=="function"?e:li(e)))}var Dc=Array.prototype.filter;function Vc(){return Array.from(this.children)}function Bc(e){return function(){return Dc.call(this.children,e)}}function Hc(e){return this.selectAll(e==null?Vc:Bc(typeof e=="function"?e:li(e)))}function zc(e){typeof e!="function"&&(e=ci(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],c,u=0;u<s;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&a.push(c);return new he(r,this._parents)}function ui(e){return new Array(e.length)}function Fc(){return new he(this._enter||this._groups.map(ui),this._parents)}function un(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}un.prototype={constructor:un,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 jc(e){return function(){return e}}function Gc(e,t,n,r,o,i){for(var s=0,a,c=t.length,u=i.length;s<u;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new un(e,i[s]);for(;s<c;++s)(a=t[s])&&(o[s]=a)}function Uc(e,t,n,r,o,i,s){var a,c,u=new Map,l=t.length,f=i.length,d=new Array(l),h;for(a=0;a<l;++a)(c=t[a])&&(d[a]=h=s.call(c,c.__data__,a,t)+"",u.has(h)?o[a]=c:u.set(h,c));for(a=0;a<f;++a)h=s.call(e,i[a],a,i)+"",(c=u.get(h))?(r[a]=c,c.__data__=i[a],u.delete(h)):n[a]=new un(e,i[a]);for(a=0;a<l;++a)(c=t[a])&&u.get(d[a])===c&&(o[a]=c)}function Zc(e){return e.__data__}function Yc(e,t){if(!arguments.length)return Array.from(this,Zc);var n=t?Uc:Gc,r=this._parents,o=this._groups;typeof e!="function"&&(e=jc(e));for(var i=o.length,s=new Array(i),a=new Array(i),c=new Array(i),u=0;u<i;++u){var l=r[u],f=o[u],d=f.length,h=Xc(e.call(l,l&&l.__data__,u,r)),y=h.length,p=a[u]=new Array(y),w=s[u]=new Array(y),m=c[u]=new Array(d);n(l,f,p,w,m,h,t);for(var _=0,$=0,v,M;_<y;++_)if(v=p[_]){for(_>=$&&($=_+1);!(M=w[$])&&++$<y;);v._next=M||null}}return s=new he(s,r),s._enter=a,s._exit=c,s}function Xc(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Wc(){return new he(this._exit||this._groups.map(ui),this._parents)}function qc(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function Kc(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),a=new Array(o),c=0;c<s;++c)for(var u=n[c],l=r[c],f=u.length,d=a[c]=new Array(f),h,y=0;y<f;++y)(h=u[y]||l[y])&&(d[y]=h);for(;c<o;++c)a[c]=n[c];return new he(a,this._parents)}function Qc(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function Jc(e){e||(e=el);function t(f,d){return f&&d?e(f.__data__,d.__data__):!f-!d}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],a=s.length,c=o[i]=new Array(a),u,l=0;l<a;++l)(u=s[l])&&(c[l]=u);c.sort(t)}return new he(o,this._parents).order()}function el(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function tl(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function nl(){return Array.from(this)}function rl(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var s=r[o];if(s)return s}return null}function ol(){let e=0;for(const t of this)++e;return e}function il(){return!this.node()}function sl(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,a;i<s;++i)(a=o[i])&&e.call(a,a.__data__,i,o);return this}function al(e){return function(){this.removeAttribute(e)}}function cl(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ll(e,t){return function(){this.setAttribute(e,t)}}function ul(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function fl(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function dl(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 hl(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?cl:al:typeof t=="function"?n.local?dl:fl:n.local?ul:ll)(n,t))}function fi(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function gl(e){return function(){this.style.removeProperty(e)}}function pl(e,t,n){return function(){this.style.setProperty(e,t,n)}}function ml(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function yl(e,t,n){return arguments.length>1?this.each((t==null?gl:typeof t=="function"?ml:pl)(e,t,n??"")):gt(this.node(),e)}function gt(e,t){return e.style.getPropertyValue(t)||fi(e).getComputedStyle(e,null).getPropertyValue(t)}function vl(e){return function(){delete this[e]}}function xl(e,t){return function(){this[e]=t}}function wl(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Cl(e,t){return arguments.length>1?this.each((t==null?vl:typeof t=="function"?wl:xl)(e,t)):this.node()[e]}function di(e){return e.trim().split(/^|\s+/)}function dr(e){return e.classList||new hi(e)}function hi(e){this._node=e,this._names=di(e.getAttribute("class")||"")}hi.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 gi(e,t){for(var n=dr(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function pi(e,t){for(var n=dr(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function bl(e){return function(){gi(this,e)}}function _l(e){return function(){pi(this,e)}}function Sl(e,t){return function(){(t.apply(this,arguments)?gi:pi)(this,e)}}function El(e,t){var n=di(e+"");if(arguments.length<2){for(var r=dr(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?Sl:t?bl:_l)(n,t))}function Nl(){this.textContent=""}function $l(e){return function(){this.textContent=e}}function Ml(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Tl(e){return arguments.length?this.each(e==null?Nl:(typeof e=="function"?Ml:$l)(e)):this.node().textContent}function Al(){this.innerHTML=""}function kl(e){return function(){this.innerHTML=e}}function Il(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Pl(e){return arguments.length?this.each(e==null?Al:(typeof e=="function"?Il:kl)(e)):this.node().innerHTML}function Ol(){this.nextSibling&&this.parentNode.appendChild(this)}function Rl(){return this.each(Ol)}function Ll(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Dl(){return this.each(Ll)}function Vl(e){var t=typeof e=="function"?e:si(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Bl(){return null}function Hl(e,t){var n=typeof e=="function"?e:si(e),r=t==null?Bl:typeof t=="function"?t:fr(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function zl(){var e=this.parentNode;e&&e.removeChild(this)}function Fl(){return this.each(zl)}function jl(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Gl(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ul(e){return this.select(e?Gl:jl)}function Zl(e){return arguments.length?this.property("__data__",e):this.node().__data__}function Yl(e){return function(t){e.call(this,t,this.__data__)}}function Xl(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 Wl(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function ql(e,t,n){return function(){var r=this.__on,o,i=Yl(t);if(r){for(var s=0,a=r.length;s<a;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function Kl(e,t,n){var r=Xl(e+""),o,i=r.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,u=a.length,l;c<u;++c)for(o=0,l=a[c];o<i;++o)if((s=r[o]).type===l.type&&s.name===l.name)return l.value}return}for(a=t?ql:Wl,o=0;o<i;++o)this.each(a(r[o],t,n));return this}function mi(e,t,n){var r=fi(e),o=r.CustomEvent;typeof o=="function"?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function Ql(e,t){return function(){return mi(this,e,t)}}function Jl(e,t){return function(){return mi(this,e,t.apply(this,arguments))}}function eu(e,t){return this.each((typeof t=="function"?Jl:Ql)(e,t))}function*tu(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var yi=[null];function he(e,t){this._groups=e,this._parents=t}function jt(){return new he([[document.documentElement]],yi)}function nu(){return this}he.prototype=jt.prototype={constructor:he,select:Mc,selectAll:Ic,selectChild:Lc,selectChildren:Hc,filter:zc,data:Yc,enter:Fc,exit:Wc,join:qc,merge:Kc,selection:nu,order:Qc,sort:Jc,call:tl,nodes:nl,node:rl,size:ol,empty:il,each:sl,attr:hl,style:yl,property:Cl,classed:El,text:Tl,html:Pl,raise:Rl,lower:Dl,append:Vl,insert:Hl,remove:Fl,clone:Ul,datum:Zl,on:Kl,dispatch:eu,[Symbol.iterator]:tu};function ve(e){return typeof e=="string"?new he([[document.querySelector(e)]],[document.documentElement]):new he([[e]],yi)}function ru(e){let t;for(;t=e.sourceEvent;)e=t;return e}function _e(e,t){if(e=ru(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 o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}const ou={passive:!1},Lt={capture:!0,passive:!1};function Bn(e){e.stopImmediatePropagation()}function lt(e){e.preventDefault(),e.stopImmediatePropagation()}function vi(e){var t=e.document.documentElement,n=ve(e).on("dragstart.drag",lt,Lt);"onselectstart"in t?n.on("selectstart.drag",lt,Lt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function xi(e,t){var n=e.document.documentElement,r=ve(e).on("dragstart.drag",null);t&&(r.on("click.drag",lt,Lt),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 Xt=e=>()=>e;function qn(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:a,dx:c,dy:u,dispatch:l}){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:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:l}})}qn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function iu(e){return!e.ctrlKey&&!e.button}function su(){return this.parentNode}function au(e,t){return t??{x:e.x,y:e.y}}function cu(){return navigator.maxTouchPoints||"ontouchstart"in this}function lu(){var e=iu,t=su,n=au,r=cu,o={},i=_n("start","drag","end"),s=0,a,c,u,l,f=0;function d(v){v.on("mousedown.drag",h).filter(r).on("touchstart.drag",w).on("touchmove.drag",m,ou).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(v,M){if(!(l||!e.call(this,v,M))){var O=$(this,t.call(this,v,M),v,M,"mouse");O&&(ve(v.view).on("mousemove.drag",y,Lt).on("mouseup.drag",p,Lt),vi(v.view),Bn(v),u=!1,a=v.clientX,c=v.clientY,O("start",v))}}function y(v){if(lt(v),!u){var M=v.clientX-a,O=v.clientY-c;u=M*M+O*O>f}o.mouse("drag",v)}function p(v){ve(v.view).on("mousemove.drag mouseup.drag",null),xi(v.view,u),lt(v),o.mouse("end",v)}function w(v,M){if(e.call(this,v,M)){var O=v.changedTouches,R=t.call(this,v,M),I=O.length,k,F;for(k=0;k<I;++k)(F=$(this,R,v,M,O[k].identifier,O[k]))&&(Bn(v),F("start",v,O[k]))}}function m(v){var M=v.changedTouches,O=M.length,R,I;for(R=0;R<O;++R)(I=o[M[R].identifier])&&(lt(v),I("drag",v,M[R]))}function _(v){var M=v.changedTouches,O=M.length,R,I;for(l&&clearTimeout(l),l=setTimeout(function(){l=null},500),R=0;R<O;++R)(I=o[M[R].identifier])&&(Bn(v),I("end",v,M[R]))}function $(v,M,O,R,I,k){var F=i.copy(),D=_e(k||O,M),z,E,g;if((g=n.call(v,new qn("beforestart",{sourceEvent:O,target:d,identifier:I,active:s,x:D[0],y:D[1],dx:0,dy:0,dispatch:F}),R))!=null)return z=g.x-D[0]||0,E=g.y-D[1]||0,function S(C,T,P){var x=D,N;switch(C){case"start":o[I]=S,N=s++;break;case"end":delete o[I],--s;case"drag":D=_e(P||T,M),N=s;break}F.call(C,v,new qn(C,{sourceEvent:T,subject:g,target:d,identifier:I,active:N,x:D[0]+z,y:D[1]+E,dx:D[0]-x[0],dy:D[1]-x[1],dispatch:F}),R)}}return d.filter=function(v){return arguments.length?(e=typeof v=="function"?v:Xt(!!v),d):e},d.container=function(v){return arguments.length?(t=typeof v=="function"?v:Xt(v),d):t},d.subject=function(v){return arguments.length?(n=typeof v=="function"?v:Xt(v),d):n},d.touchable=function(v){return arguments.length?(r=typeof v=="function"?v:Xt(!!v),d):r},d.on=function(){var v=i.on.apply(i,arguments);return v===i?d:v},d.clickDistance=function(v){return arguments.length?(f=(v=+v)*v,d):Math.sqrt(f)},d}function hr(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function wi(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Gt(){}var Dt=.7,fn=1/Dt,ut="\\s*([+-]?\\d+)\\s*",Vt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Se="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",uu=/^#([0-9a-f]{3,8})$/,fu=new RegExp(`^rgb\\(${ut},${ut},${ut}\\)$`),du=new RegExp(`^rgb\\(${Se},${Se},${Se}\\)$`),hu=new RegExp(`^rgba\\(${ut},${ut},${ut},${Vt}\\)$`),gu=new RegExp(`^rgba\\(${Se},${Se},${Se},${Vt}\\)$`),pu=new RegExp(`^hsl\\(${Vt},${Se},${Se}\\)$`),mu=new RegExp(`^hsla\\(${Vt},${Se},${Se},${Vt}\\)$`),jr={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};hr(Gt,Bt,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Gr,formatHex:Gr,formatHex8:yu,formatHsl:vu,formatRgb:Ur,toString:Ur});function Gr(){return this.rgb().formatHex()}function yu(){return this.rgb().formatHex8()}function vu(){return Ci(this).formatHsl()}function Ur(){return this.rgb().formatRgb()}function Bt(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=uu.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Zr(t):n===3?new le(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Wt(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Wt(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=fu.exec(e))?new le(t[1],t[2],t[3],1):(t=du.exec(e))?new le(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=hu.exec(e))?Wt(t[1],t[2],t[3],t[4]):(t=gu.exec(e))?Wt(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=pu.exec(e))?Wr(t[1],t[2]/100,t[3]/100,1):(t=mu.exec(e))?Wr(t[1],t[2]/100,t[3]/100,t[4]):jr.hasOwnProperty(e)?Zr(jr[e]):e==="transparent"?new le(NaN,NaN,NaN,0):null}function Zr(e){return new le(e>>16&255,e>>8&255,e&255,1)}function Wt(e,t,n,r){return r<=0&&(e=t=n=NaN),new le(e,t,n,r)}function xu(e){return e instanceof Gt||(e=Bt(e)),e?(e=e.rgb(),new le(e.r,e.g,e.b,e.opacity)):new le}function Kn(e,t,n,r){return arguments.length===1?xu(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}hr(le,Kn,wi(Gt,{brighter(e){return e=e==null?fn:Math.pow(fn,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Dt:Math.pow(Dt,e),new le(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new le(qe(this.r),qe(this.g),qe(this.b),dn(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:Yr,formatHex:Yr,formatHex8:wu,formatRgb:Xr,toString:Xr}));function Yr(){return`#${Xe(this.r)}${Xe(this.g)}${Xe(this.b)}`}function wu(){return`#${Xe(this.r)}${Xe(this.g)}${Xe(this.b)}${Xe((isNaN(this.opacity)?1:this.opacity)*255)}`}function Xr(){const e=dn(this.opacity);return`${e===1?"rgb(":"rgba("}${qe(this.r)}, ${qe(this.g)}, ${qe(this.b)}${e===1?")":`, ${e})`}`}function dn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function qe(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Xe(e){return e=qe(e),(e<16?"0":"")+e.toString(16)}function Wr(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new xe(e,t,n,r)}function Ci(e){if(e instanceof xe)return new xe(e.h,e.s,e.l,e.opacity);if(e instanceof Gt||(e=Bt(e)),!e)return new xe;if(e instanceof xe)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,a=i-o,c=(i+o)/2;return a?(t===i?s=(n-r)/a+(n<r)*6:n===i?s=(r-t)/a+2:s=(t-n)/a+4,a/=c<.5?i+o:2-i-o,s*=60):a=c>0&&c<1?0:s,new xe(s,a,c,e.opacity)}function Cu(e,t,n,r){return arguments.length===1?Ci(e):new xe(e,t,n,r??1)}function xe(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}hr(xe,Cu,wi(Gt,{brighter(e){return e=e==null?fn:Math.pow(fn,e),new xe(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Dt:Math.pow(Dt,e),new xe(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,o=2*n-r;return new le(Hn(e>=240?e-240:e+120,o,r),Hn(e,o,r),Hn(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new xe(qr(this.h),qt(this.s),qt(this.l),dn(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=dn(this.opacity);return`${e===1?"hsl(":"hsla("}${qr(this.h)}, ${qt(this.s)*100}%, ${qt(this.l)*100}%${e===1?")":`, ${e})`}`}}));function qr(e){return e=(e||0)%360,e<0?e+360:e}function qt(e){return Math.max(0,Math.min(1,e||0))}function Hn(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 bi=e=>()=>e;function bu(e,t){return function(n){return e+n*t}}function _u(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 Su(e){return(e=+e)==1?_i:function(t,n){return n-t?_u(t,n,e):bi(isNaN(t)?n:t)}}function _i(e,t){var n=t-e;return n?bu(e,n):bi(isNaN(e)?t:e)}const Kr=function e(t){var n=Su(t);function r(o,i){var s=n((o=Kn(o)).r,(i=Kn(i)).r),a=n(o.g,i.g),c=n(o.b,i.b),u=_i(o.opacity,i.opacity);return function(l){return o.r=s(l),o.g=a(l),o.b=c(l),o.opacity=u(l),o+""}}return r.gamma=e,r}(1);function Oe(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Qn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,zn=new RegExp(Qn.source,"g");function Eu(e){return function(){return e}}function Nu(e){return function(t){return e(t)+""}}function $u(e,t){var n=Qn.lastIndex=zn.lastIndex=0,r,o,i,s=-1,a=[],c=[];for(e=e+"",t=t+"";(r=Qn.exec(e))&&(o=zn.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(r=r[0])===(o=o[0])?a[s]?a[s]+=o:a[++s]=o:(a[++s]=null,c.push({i:s,x:Oe(r,o)})),n=zn.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?c[0]?Nu(c[0].x):Eu(t):(t=c.length,function(u){for(var l=0,f;l<t;++l)a[(f=c[l]).i]=f.x(u);return a.join("")})}var Qr=180/Math.PI,Jn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Si(e,t,n,r,o,i){var s,a,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,c/=a),e*r<t*n&&(e=-e,t=-t,c=-c,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*Qr,skewX:Math.atan(c)*Qr,scaleX:s,scaleY:a}}var Kt;function Mu(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Jn:Si(t.a,t.b,t.c,t.d,t.e,t.f)}function Tu(e){return e==null||(Kt||(Kt=document.createElementNS("http://www.w3.org/2000/svg","g")),Kt.setAttribute("transform",e),!(e=Kt.transform.baseVal.consolidate()))?Jn:(e=e.matrix,Si(e.a,e.b,e.c,e.d,e.e,e.f))}function Ei(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,l,f,d,h,y){if(u!==f||l!==d){var p=h.push("translate(",null,t,null,n);y.push({i:p-4,x:Oe(u,f)},{i:p-2,x:Oe(l,d)})}else(f||d)&&h.push("translate("+f+t+d+n)}function s(u,l,f,d){u!==l?(u-l>180?l+=360:l-u>180&&(u+=360),d.push({i:f.push(o(f)+"rotate(",null,r)-2,x:Oe(u,l)})):l&&f.push(o(f)+"rotate("+l+r)}function a(u,l,f,d){u!==l?d.push({i:f.push(o(f)+"skewX(",null,r)-2,x:Oe(u,l)}):l&&f.push(o(f)+"skewX("+l+r)}function c(u,l,f,d,h,y){if(u!==f||l!==d){var p=h.push(o(h)+"scale(",null,",",null,")");y.push({i:p-4,x:Oe(u,f)},{i:p-2,x:Oe(l,d)})}else(f!==1||d!==1)&&h.push(o(h)+"scale("+f+","+d+")")}return function(u,l){var f=[],d=[];return u=e(u),l=e(l),i(u.translateX,u.translateY,l.translateX,l.translateY,f,d),s(u.rotate,l.rotate,f,d),a(u.skewX,l.skewX,f,d),c(u.scaleX,u.scaleY,l.scaleX,l.scaleY,f,d),u=l=null,function(h){for(var y=-1,p=d.length,w;++y<p;)f[(w=d[y]).i]=w.x(h);return f.join("")}}}var Au=Ei(Mu,"px, ","px)","deg)"),ku=Ei(Tu,", ",")",")"),Iu=1e-12;function Jr(e){return((e=Math.exp(e))+1/e)/2}function Pu(e){return((e=Math.exp(e))-1/e)/2}function Ou(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ru=function e(t,n,r){function o(i,s){var a=i[0],c=i[1],u=i[2],l=s[0],f=s[1],d=s[2],h=l-a,y=f-c,p=h*h+y*y,w,m;if(p<Iu)m=Math.log(d/u)/t,w=function(R){return[a+R*h,c+R*y,u*Math.exp(t*R*m)]};else{var _=Math.sqrt(p),$=(d*d-u*u+r*p)/(2*u*n*_),v=(d*d-u*u-r*p)/(2*d*n*_),M=Math.log(Math.sqrt($*$+1)-$),O=Math.log(Math.sqrt(v*v+1)-v);m=(O-M)/t,w=function(R){var I=R*m,k=Jr(M),F=u/(n*_)*(k*Ou(t*I+M)-Pu(M));return[a+F*h,c+F*y,u*k/Jr(t*I+M)]}}return w.duration=m*1e3*t/Math.SQRT2,w}return o.rho=function(i){var s=Math.max(.001,+i),a=s*s,c=a*a;return e(s,a,c)},o}(Math.SQRT2,2,4);var pt=0,Pt=0,$t=0,Ni=1e3,hn,Ot,gn=0,Ke=0,En=0,Ht=typeof performance=="object"&&performance.now?performance:Date,$i=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function gr(){return Ke||($i(Lu),Ke=Ht.now()+En)}function Lu(){Ke=0}function pn(){this._call=this._time=this._next=null}pn.prototype=Mi.prototype={constructor:pn,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?gr():+n)+(t==null?0:+t),!this._next&&Ot!==this&&(Ot?Ot._next=this:hn=this,Ot=this),this._call=e,this._time=n,er()},stop:function(){this._call&&(this._call=null,this._time=1/0,er())}};function Mi(e,t,n){var r=new pn;return r.restart(e,t,n),r}function Du(){gr(),++pt;for(var e=hn,t;e;)(t=Ke-e._time)>=0&&e._call.call(void 0,t),e=e._next;--pt}function eo(){Ke=(gn=Ht.now())+En,pt=Pt=0;try{Du()}finally{pt=0,Bu(),Ke=0}}function Vu(){var e=Ht.now(),t=e-gn;t>Ni&&(En-=t,gn=e)}function Bu(){for(var e,t=hn,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:hn=n);Ot=e,er(r)}function er(e){if(!pt){Pt&&(Pt=clearTimeout(Pt));var t=e-Ke;t>24?(e<1/0&&(Pt=setTimeout(eo,e-Ht.now()-En)),$t&&($t=clearInterval($t))):($t||(gn=Ht.now(),$t=setInterval(Vu,Ni)),pt=1,$i(eo))}}function to(e,t,n){var r=new pn;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var Hu=_n("start","end","cancel","interrupt"),zu=[],Ti=0,no=1,tr=2,sn=3,ro=4,nr=5,an=6;function Nn(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;Fu(e,n,{name:t,index:r,group:o,on:Hu,tween:zu,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Ti})}function pr(e,t){var n=we(e,t);if(n.state>Ti)throw new Error("too late; already scheduled");return n}function Ee(e,t){var n=we(e,t);if(n.state>sn)throw new Error("too late; already running");return n}function we(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Fu(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=Mi(i,0,n.time);function i(u){n.state=no,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var l,f,d,h;if(n.state!==no)return c();for(l in r)if(h=r[l],h.name===n.name){if(h.state===sn)return to(s);h.state===ro?(h.state=an,h.timer.stop(),h.on.call("interrupt",e,e.__data__,h.index,h.group),delete r[l]):+l<t&&(h.state=an,h.timer.stop(),h.on.call("cancel",e,e.__data__,h.index,h.group),delete r[l])}if(to(function(){n.state===sn&&(n.state=ro,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=tr,n.on.call("start",e,e.__data__,n.index,n.group),n.state===tr){for(n.state=sn,o=new Array(d=n.tween.length),l=0,f=-1;l<d;++l)(h=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(o[++f]=h);o.length=f+1}}function a(u){for(var l=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(c),n.state=nr,1),f=-1,d=o.length;++f<d;)o[f].call(e,l);n.state===nr&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=an,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function cn(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>tr&&r.state<nr,r.state=an,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function ju(e){return this.each(function(){cn(this,e)})}function Gu(e,t){var n,r;return function(){var o=Ee(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,a=r.length;s<a;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function Uu(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=Ee(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var a={name:t,value:n},c=0,u=o.length;c<u;++c)if(o[c].name===t){o[c]=a;break}c===u&&o.push(a)}i.tween=o}}function Zu(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=we(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?Gu:Uu)(n,e,t))}function mr(e,t,n){var r=e._id;return e.each(function(){var o=Ee(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return we(o,r).value[t]}}function Ai(e,t){var n;return(typeof t=="number"?Oe:t instanceof Bt?Kr:(n=Bt(t))?(t=n,Kr):$u)(e,t)}function Yu(e){return function(){this.removeAttribute(e)}}function Xu(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Wu(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function qu(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function Ku(e,t,n){var r,o,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=a+"",s===c?null:s===r&&c===o?i:(o=c,i=t(r=s,a)))}}function Qu(e,t,n){var r,o,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=a+"",s===c?null:s===r&&c===o?i:(o=c,i=t(r=s,a)))}}function Ju(e,t){var n=Sn(e),r=n==="transform"?ku:Ai;return this.attrTween(e,typeof t=="function"?(n.local?Qu:Ku)(n,r,mr(this,"attr."+e,t)):t==null?(n.local?Xu:Yu)(n):(n.local?qu:Wu)(n,r,t))}function e1(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function t1(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function n1(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&t1(e,i)),n}return o._value=t,o}function r1(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&e1(e,i)),n}return o._value=t,o}function o1(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?n1:r1)(r,t))}function i1(e,t){return function(){pr(this,e).delay=+t.apply(this,arguments)}}function s1(e,t){return t=+t,function(){pr(this,e).delay=t}}function a1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?i1:s1)(t,e)):we(this.node(),t).delay}function c1(e,t){return function(){Ee(this,e).duration=+t.apply(this,arguments)}}function l1(e,t){return t=+t,function(){Ee(this,e).duration=t}}function u1(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?c1:l1)(t,e)):we(this.node(),t).duration}function f1(e,t){if(typeof t!="function")throw new Error;return function(){Ee(this,e).ease=t}}function d1(e){var t=this._id;return arguments.length?this.each(f1(t,e)):we(this.node(),t).ease}function h1(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ee(this,e).ease=n}}function g1(e){if(typeof e!="function")throw new Error;return this.each(h1(this._id,e))}function p1(e){typeof e!="function"&&(e=ci(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,a=r[o]=[],c,u=0;u<s;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&a.push(c);return new Te(r,this._parents,this._name,this._id)}function m1(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),s=new Array(r),a=0;a<i;++a)for(var c=t[a],u=n[a],l=c.length,f=s[a]=new Array(l),d,h=0;h<l;++h)(d=c[h]||u[h])&&(f[h]=d);for(;a<r;++a)s[a]=t[a];return new Te(s,this._parents,this._name,this._id)}function y1(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 v1(e,t,n){var r,o,i=y1(t)?pr:Ee;return function(){var s=i(this,e),a=s.on;a!==r&&(o=(r=a).copy()).on(t,n),s.on=o}}function x1(e,t){var n=this._id;return arguments.length<2?we(this.node(),n).on.on(e):this.each(v1(n,e,t))}function w1(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function C1(){return this.on("end.remove",w1(this._id))}function b1(e){var t=this._name,n=this._id;typeof e!="function"&&(e=fr(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var a=r[s],c=a.length,u=i[s]=new Array(c),l,f,d=0;d<c;++d)(l=a[d])&&(f=e.call(l,l.__data__,d,a))&&("__data__"in l&&(f.__data__=l.__data__),u[d]=f,Nn(u[d],t,n,d,u,we(l,n)));return new Te(i,this._parents,t,n)}function _1(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ai(e));for(var r=this._groups,o=r.length,i=[],s=[],a=0;a<o;++a)for(var c=r[a],u=c.length,l,f=0;f<u;++f)if(l=c[f]){for(var d=e.call(l,l.__data__,f,c),h,y=we(l,n),p=0,w=d.length;p<w;++p)(h=d[p])&&Nn(h,t,n,p,d,y);i.push(d),s.push(l)}return new Te(i,s,t,n)}var S1=jt.prototype.constructor;function E1(){return new S1(this._groups,this._parents)}function N1(e,t){var n,r,o;return function(){var i=gt(this,e),s=(this.style.removeProperty(e),gt(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function ki(e){return function(){this.style.removeProperty(e)}}function $1(e,t,n){var r,o=n+"",i;return function(){var s=gt(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function M1(e,t,n){var r,o,i;return function(){var s=gt(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),gt(this,e))),s===c?null:s===r&&c===o?i:(o=c,i=t(r=s,a))}}function T1(e,t){var n,r,o,i="style."+t,s="end."+i,a;return function(){var c=Ee(this,e),u=c.on,l=c.value[i]==null?a||(a=ki(t)):void 0;(u!==n||o!==l)&&(r=(n=u).copy()).on(s,o=l),c.on=r}}function A1(e,t,n){var r=(e+="")=="transform"?Au:Ai;return t==null?this.styleTween(e,N1(e,r)).on("end.style."+e,ki(e)):typeof t=="function"?this.styleTween(e,M1(e,r,mr(this,"style."+e,t))).each(T1(this._id,e)):this.styleTween(e,$1(e,r,t),n).on("end.style."+e,null)}function k1(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function I1(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&k1(e,s,n)),r}return i._value=t,i}function P1(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,I1(e,t,n??""))}function O1(e){return function(){this.textContent=e}}function R1(e){return function(){var t=e(this);this.textContent=t??""}}function L1(e){return this.tween("text",typeof e=="function"?R1(mr(this,"text",e)):O1(e==null?"":e+""))}function D1(e){return function(t){this.textContent=e.call(this,t)}}function V1(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&D1(o)),t}return r._value=e,r}function B1(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,V1(e))}function H1(){for(var e=this._name,t=this._id,n=Ii(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,c,u=0;u<a;++u)if(c=s[u]){var l=we(c,t);Nn(c,e,n,u,s,{time:l.time+l.delay+l.duration,delay:0,duration:l.duration,ease:l.ease})}return new Te(r,this._parents,e,n)}function z1(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var a={value:s},c={value:function(){--o===0&&i()}};n.each(function(){var u=Ee(this,r),l=u.on;l!==e&&(t=(e=l).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),u.on=t}),o===0&&i()})}var F1=0;function Te(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Ii(){return++F1}var $e=jt.prototype;Te.prototype={constructor:Te,select:b1,selectAll:_1,selectChild:$e.selectChild,selectChildren:$e.selectChildren,filter:p1,merge:m1,selection:E1,transition:H1,call:$e.call,nodes:$e.nodes,node:$e.node,size:$e.size,empty:$e.empty,each:$e.each,on:x1,attr:Ju,attrTween:o1,style:A1,styleTween:P1,text:L1,textTween:B1,remove:C1,tween:Zu,delay:a1,duration:u1,ease:d1,easeVarying:g1,end:z1,[Symbol.iterator]:$e[Symbol.iterator]};function j1(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var G1={time:null,delay:0,duration:250,ease:j1};function U1(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 Z1(e){var t,n;e instanceof Te?(t=e._id,e=e._name):(t=Ii(),(n=G1).time=gr(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],a=s.length,c,u=0;u<a;++u)(c=s[u])&&Nn(c,e,t,u,s,n||U1(c,t));return new Te(r,this._parents,e,t)}jt.prototype.interrupt=ju;jt.prototype.transition=Z1;const Qt=e=>()=>e;function Y1(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){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:o}})}function Me(e,t,n){this.k=e,this.x=t,this.y=n}Me.prototype={constructor:Me,scale:function(e){return e===1?this:new Me(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Me(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 De=new Me(1,0,0);Me.prototype;function Fn(e){e.stopImmediatePropagation()}function Mt(e){e.preventDefault(),e.stopImmediatePropagation()}function X1(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function W1(){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 oo(){return this.__zoom||De}function q1(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function K1(){return navigator.maxTouchPoints||"ontouchstart"in this}function Q1(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function J1(){var e=X1,t=W1,n=Q1,r=q1,o=K1,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=Ru,u=_n("start","zoom","end"),l,f,d,h=500,y=150,p=0,w=10;function m(g){g.property("__zoom",oo).on("wheel.zoom",I,{passive:!1}).on("mousedown.zoom",k).on("dblclick.zoom",F).filter(o).on("touchstart.zoom",D).on("touchmove.zoom",z).on("touchend.zoom touchcancel.zoom",E).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}m.transform=function(g,S,C,T){var P=g.selection?g.selection():g;P.property("__zoom",oo),g!==P?M(g,S,C,T):P.interrupt().each(function(){O(this,arguments).event(T).start().zoom(null,typeof S=="function"?S.apply(this,arguments):S).end()})},m.scaleBy=function(g,S,C,T){m.scaleTo(g,function(){var P=this.__zoom.k,x=typeof S=="function"?S.apply(this,arguments):S;return P*x},C,T)},m.scaleTo=function(g,S,C,T){m.transform(g,function(){var P=t.apply(this,arguments),x=this.__zoom,N=C==null?v(P):typeof C=="function"?C.apply(this,arguments):C,A=x.invert(N),V=typeof S=="function"?S.apply(this,arguments):S;return n($(_(x,V),N,A),P,s)},C,T)},m.translateBy=function(g,S,C,T){m.transform(g,function(){return n(this.__zoom.translate(typeof S=="function"?S.apply(this,arguments):S,typeof C=="function"?C.apply(this,arguments):C),t.apply(this,arguments),s)},null,T)},m.translateTo=function(g,S,C,T,P){m.transform(g,function(){var x=t.apply(this,arguments),N=this.__zoom,A=T==null?v(x):typeof T=="function"?T.apply(this,arguments):T;return n(De.translate(A[0],A[1]).scale(N.k).translate(typeof S=="function"?-S.apply(this,arguments):-S,typeof C=="function"?-C.apply(this,arguments):-C),x,s)},T,P)};function _(g,S){return S=Math.max(i[0],Math.min(i[1],S)),S===g.k?g:new Me(S,g.x,g.y)}function $(g,S,C){var T=S[0]-C[0]*g.k,P=S[1]-C[1]*g.k;return T===g.x&&P===g.y?g:new Me(g.k,T,P)}function v(g){return[(+g[0][0]+ +g[1][0])/2,(+g[0][1]+ +g[1][1])/2]}function M(g,S,C,T){g.on("start.zoom",function(){O(this,arguments).event(T).start()}).on("interrupt.zoom end.zoom",function(){O(this,arguments).event(T).end()}).tween("zoom",function(){var P=this,x=arguments,N=O(P,x).event(T),A=t.apply(P,x),V=C==null?v(A):typeof C=="function"?C.apply(P,x):C,B=Math.max(A[1][0]-A[0][0],A[1][1]-A[0][1]),H=P.__zoom,U=typeof S=="function"?S.apply(P,x):S,Y=c(H.invert(V).concat(B/H.k),U.invert(V).concat(B/U.k));return function(W){if(W===1)W=U;else{var q=Y(W),ee=B/q[2];W=new Me(ee,V[0]-q[0]*ee,V[1]-q[1]*ee)}N.zoom(null,W)}})}function O(g,S,C){return!C&&g.__zooming||new R(g,S)}function R(g,S){this.that=g,this.args=S,this.active=0,this.sourceEvent=null,this.extent=t.apply(g,S),this.taps=0}R.prototype={event:function(g){return g&&(this.sourceEvent=g),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(g,S){return this.mouse&&g!=="mouse"&&(this.mouse[1]=S.invert(this.mouse[0])),this.touch0&&g!=="touch"&&(this.touch0[1]=S.invert(this.touch0[0])),this.touch1&&g!=="touch"&&(this.touch1[1]=S.invert(this.touch1[0])),this.that.__zoom=S,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(g){var S=ve(this.that).datum();u.call(g,this.that,new Y1(g,{sourceEvent:this.sourceEvent,target:m,type:g,transform:this.that.__zoom,dispatch:u}),S)}};function I(g,...S){if(!e.apply(this,arguments))return;var C=O(this,S).event(g),T=this.__zoom,P=Math.max(i[0],Math.min(i[1],T.k*Math.pow(2,r.apply(this,arguments)))),x=_e(g);if(C.wheel)(C.mouse[0][0]!==x[0]||C.mouse[0][1]!==x[1])&&(C.mouse[1]=T.invert(C.mouse[0]=x)),clearTimeout(C.wheel);else{if(T.k===P)return;C.mouse=[x,T.invert(x)],cn(this),C.start()}Mt(g),C.wheel=setTimeout(N,y),C.zoom("mouse",n($(_(T,P),C.mouse[0],C.mouse[1]),C.extent,s));function N(){C.wheel=null,C.end()}}function k(g,...S){if(d||!e.apply(this,arguments))return;var C=g.currentTarget,T=O(this,S,!0).event(g),P=ve(g.view).on("mousemove.zoom",V,!0).on("mouseup.zoom",B,!0),x=_e(g,C),N=g.clientX,A=g.clientY;vi(g.view),Fn(g),T.mouse=[x,this.__zoom.invert(x)],cn(this),T.start();function V(H){if(Mt(H),!T.moved){var U=H.clientX-N,Y=H.clientY-A;T.moved=U*U+Y*Y>p}T.event(H).zoom("mouse",n($(T.that.__zoom,T.mouse[0]=_e(H,C),T.mouse[1]),T.extent,s))}function B(H){P.on("mousemove.zoom mouseup.zoom",null),xi(H.view,T.moved),Mt(H),T.event(H).end()}}function F(g,...S){if(e.apply(this,arguments)){var C=this.__zoom,T=_e(g.changedTouches?g.changedTouches[0]:g,this),P=C.invert(T),x=C.k*(g.shiftKey?.5:2),N=n($(_(C,x),T,P),t.apply(this,S),s);Mt(g),a>0?ve(this).transition().duration(a).call(M,N,T,g):ve(this).call(m.transform,N,T,g)}}function D(g,...S){if(e.apply(this,arguments)){var C=g.touches,T=C.length,P=O(this,S,g.changedTouches.length===T).event(g),x,N,A,V;for(Fn(g),N=0;N<T;++N)A=C[N],V=_e(A,this),V=[V,this.__zoom.invert(V),A.identifier],P.touch0?!P.touch1&&P.touch0[2]!==V[2]&&(P.touch1=V,P.taps=0):(P.touch0=V,x=!0,P.taps=1+!!l);l&&(l=clearTimeout(l)),x&&(P.taps<2&&(f=V[0],l=setTimeout(function(){l=null},h)),cn(this),P.start())}}function z(g,...S){if(this.__zooming){var C=O(this,S).event(g),T=g.changedTouches,P=T.length,x,N,A,V;for(Mt(g),x=0;x<P;++x)N=T[x],A=_e(N,this),C.touch0&&C.touch0[2]===N.identifier?C.touch0[0]=A:C.touch1&&C.touch1[2]===N.identifier&&(C.touch1[0]=A);if(N=C.that.__zoom,C.touch1){var B=C.touch0[0],H=C.touch0[1],U=C.touch1[0],Y=C.touch1[1],W=(W=U[0]-B[0])*W+(W=U[1]-B[1])*W,q=(q=Y[0]-H[0])*q+(q=Y[1]-H[1])*q;N=_(N,Math.sqrt(W/q)),A=[(B[0]+U[0])/2,(B[1]+U[1])/2],V=[(H[0]+Y[0])/2,(H[1]+Y[1])/2]}else if(C.touch0)A=C.touch0[0],V=C.touch0[1];else return;C.zoom("touch",n($(N,A,V),C.extent,s))}}function E(g,...S){if(this.__zooming){var C=O(this,S).event(g),T=g.changedTouches,P=T.length,x,N;for(Fn(g),d&&clearTimeout(d),d=setTimeout(function(){d=null},h),x=0;x<P;++x)N=T[x],C.touch0&&C.touch0[2]===N.identifier?delete C.touch0:C.touch1&&C.touch1[2]===N.identifier&&delete C.touch1;if(C.touch1&&!C.touch0&&(C.touch0=C.touch1,delete C.touch1),C.touch0)C.touch0[1]=this.__zoom.invert(C.touch0[0]);else if(C.end(),C.taps===2&&(N=_e(N,this),Math.hypot(f[0]-N[0],f[1]-N[1])<w)){var A=ve(this).on("dblclick.zoom");A&&A.apply(this,arguments)}}}return m.wheelDelta=function(g){return arguments.length?(r=typeof g=="function"?g:Qt(+g),m):r},m.filter=function(g){return arguments.length?(e=typeof g=="function"?g:Qt(!!g),m):e},m.touchable=function(g){return arguments.length?(o=typeof g=="function"?g:Qt(!!g),m):o},m.extent=function(g){return arguments.length?(t=typeof g=="function"?g:Qt([[+g[0][0],+g[0][1]],[+g[1][0],+g[1][1]]]),m):t},m.scaleExtent=function(g){return arguments.length?(i[0]=+g[0],i[1]=+g[1],m):[i[0],i[1]]},m.translateExtent=function(g){return arguments.length?(s[0][0]=+g[0][0],s[1][0]=+g[1][0],s[0][1]=+g[0][1],s[1][1]=+g[1][1],m):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},m.constrain=function(g){return arguments.length?(n=g,m):n},m.duration=function(g){return arguments.length?(a=+g,m):a},m.interpolate=function(g){return arguments.length?(c=g,m):c},m.on=function(){var g=u.on.apply(u,arguments);return g===u?m:g},m.clickDistance=function(g){return arguments.length?(p=(g=+g)*g,m):Math.sqrt(p)},m.tapDistance=function(g){return arguments.length?(w=+g,m):w},m}const $n=b.createContext(null),ef=$n.Provider,Ae={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,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,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.`},Pi=Ae.error001();function J(e,t){const n=b.useContext($n);if(n===null)throw new Error(Pi);return ii(n,e,t)}const oe=()=>{const e=b.useContext($n);if(e===null)throw new Error(Pi);return b.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},tf=e=>e.userSelectionActive?"none":"all";function nf({position:e,children:t,className:n,style:r,...o}){const i=J(tf),s=`${e}`.split("-");return L.createElement("div",{className:me(["react-flow__panel",n,...s]),style:{...r,pointerEvents:i},...o},t)}function rf({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:L.createElement(nf,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},L.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const of=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:o=!0,labelBgStyle:i={},labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:c,className:u,...l})=>{const f=b.useRef(null),[d,h]=b.useState({x:0,y:0,width:0,height:0}),y=me(["react-flow__edge-textwrapper",u]);return b.useEffect(()=>{if(f.current){const p=f.current.getBBox();h({x:p.x,y:p.y,width:p.width,height:p.height})}},[n]),typeof n>"u"||!n?null:L.createElement("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:y,visibility:d.width?"visible":"hidden",...l},o&&L.createElement("rect",{width:d.width+2*s[0],x:-s[0],y:-s[1],height:d.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),L.createElement("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:f,style:r},n),c)};var sf=b.memo(of);const yr=e=>({width:e.offsetWidth,height:e.offsetHeight}),mt=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),vr=(e={x:0,y:0},t)=>({x:mt(e.x,t[0][0],t[1][0]),y:mt(e.y,t[0][1],t[1][1])}),io=(e,t,n)=>e<t?mt(Math.abs(e-t),1,50)/50:e>n?-mt(Math.abs(e-n),1,50)/50:0,Oi=(e,t)=>{const n=io(e.x,35,t.width-35)*20,r=io(e.y,35,t.height-35)*20;return[n,r]},Ri=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},af=(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)}),xr=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),cf=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),so=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),rr=(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)},lf=e=>pe(e.width)&&pe(e.height)&&pe(e.x)&&pe(e.y),pe=e=>!isNaN(e)&&isFinite(e),re=Symbol.for("internals"),Li=["Enter"," ","Escape"],uf=(e,t)=>{},ff=e=>"nativeEvent"in e;function or(e){var o,i;const t=ff(e)?e.nativeEvent:e,n=((i=(o=t.composedPath)==null?void 0:o.call(t))==null?void 0:i[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const Di=e=>"clientX"in e,Ve=(e,t)=>{var i,s;const n=Di(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},mn=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},Ut=({id:e,path:t,labelX:n,labelY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u,style:l,markerEnd:f,markerStart:d,interactionWidth:h=20})=>L.createElement(L.Fragment,null,L.createElement("path",{id:e,style:l,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:d}),h&&L.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),o&&pe(n)&&pe(r)?L.createElement(sf,{x:n,y:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u}):null);Ut.displayName="BaseEdge";function Tt(e,t,n){return n===void 0?n:r=>{const o=t().edges.find(i=>i.id===e);o&&n(r,{...o})}}function Vi({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,a=r<t?r+s:r-s;return[i,a,o,s]}function Bi({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:a}){const c=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+a*.375+r*.125,l=Math.abs(c-e),f=Math.abs(u-t);return[c,u,l,f]}var Qe;(function(e){e.Strict="strict",e.Loose="loose"})(Qe||(Qe={}));var We;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(We||(We={}));var zt;(function(e){e.Partial="partial",e.Full="full"})(zt||(zt={}));var Le;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Le||(Le={}));var yn;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(yn||(yn={}));var j;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(j||(j={}));function ao({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===j.Left||e===j.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function Hi({sourceX:e,sourceY:t,sourcePosition:n=j.Bottom,targetX:r,targetY:o,targetPosition:i=j.Top}){const[s,a]=ao({pos:n,x1:e,y1:t,x2:r,y2:o}),[c,u]=ao({pos:i,x1:r,y1:o,x2:e,y2:t}),[l,f,d,h]=Bi({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:a,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${a} ${c},${u} ${r},${o}`,l,f,d,h]}const wr=b.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=j.Bottom,targetPosition:i=j.Top,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:l,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:y,interactionWidth:p})=>{const[w,m,_]=Hi({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i});return L.createElement(Ut,{path:w,labelX:m,labelY:_,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:l,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:y,interactionWidth:p})});wr.displayName="SimpleBezierEdge";const co={[j.Left]:{x:-1,y:0},[j.Right]:{x:1,y:0},[j.Top]:{x:0,y:-1},[j.Bottom]:{x:0,y:1}},df=({source:e,sourcePosition:t=j.Bottom,target:n})=>t===j.Left||t===j.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},lo=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function hf({source:e,sourcePosition:t=j.Bottom,target:n,targetPosition:r=j.Top,center:o,offset:i}){const s=co[t],a=co[r],c={x:e.x+s.x*i,y:e.y+s.y*i},u={x:n.x+a.x*i,y:n.y+a.y*i},l=df({source:c,sourcePosition:t,target:u}),f=l.x!==0?"x":"y",d=l[f];let h=[],y,p;const w={x:0,y:0},m={x:0,y:0},[_,$,v,M]=Vi({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*a[f]===-1){y=o.x||_,p=o.y||$;const R=[{x:y,y:c.y},{x:y,y:u.y}],I=[{x:c.x,y:p},{x:u.x,y:p}];s[f]===d?h=f==="x"?R:I:h=f==="x"?I:R}else{const R=[{x:c.x,y:u.y}],I=[{x:u.x,y:c.y}];if(f==="x"?h=s.x===d?I:R:h=s.y===d?R:I,t===r){const E=Math.abs(e[f]-n[f]);if(E<=i){const g=Math.min(i-1,i-E);s[f]===d?w[f]=(c[f]>e[f]?-1:1)*g:m[f]=(u[f]>n[f]?-1:1)*g}}if(t!==r){const E=f==="x"?"y":"x",g=s[f]===a[E],S=c[E]>u[E],C=c[E]<u[E];(s[f]===1&&(!g&&S||g&&C)||s[f]!==1&&(!g&&C||g&&S))&&(h=f==="x"?R:I)}const k={x:c.x+w.x,y:c.y+w.y},F={x:u.x+m.x,y:u.y+m.y},D=Math.max(Math.abs(k.x-h[0].x),Math.abs(F.x-h[0].x)),z=Math.max(Math.abs(k.y-h[0].y),Math.abs(F.y-h[0].y));D>=z?(y=(k.x+F.x)/2,p=h[0].y):(y=h[0].x,p=(k.y+F.y)/2)}return[[e,{x:c.x+w.x,y:c.y+w.y},...h,{x:u.x+m.x,y:u.y+m.y},n],y,p,v,M]}function gf(e,t,n,r){const o=Math.min(lo(e,t)/2,lo(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,l=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*l}`}const a=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${s+o*c}Q ${i},${s} ${i+o*a},${s}`}function ir({sourceX:e,sourceY:t,sourcePosition:n=j.Bottom,targetX:r,targetY:o,targetPosition:i=j.Top,borderRadius:s=5,centerX:a,centerY:c,offset:u=20}){const[l,f,d,h,y]=hf({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:a,y:c},offset:u});return[l.reduce((w,m,_)=>{let $="";return _>0&&_<l.length-1?$=gf(l[_-1],m,l[_+1],s):$=`${_===0?"M":"L"}${m.x} ${m.y}`,w+=$,w},""),f,d,h,y]}const Mn=b.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u,style:l,sourcePosition:f=j.Bottom,targetPosition:d=j.Top,markerEnd:h,markerStart:y,pathOptions:p,interactionWidth:w})=>{const[m,_,$]=ir({sourceX:e,sourceY:t,sourcePosition:f,targetX:n,targetY:r,targetPosition:d,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset});return L.createElement(Ut,{path:m,labelX:_,labelY:$,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u,style:l,markerEnd:h,markerStart:y,interactionWidth:w})});Mn.displayName="SmoothStepEdge";const Cr=b.memo(e=>{var t;return L.createElement(Mn,{...e,pathOptions:b.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});Cr.displayName="StepEdge";function pf({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,a]=Vi({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,a]}const br=b.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u,style:l,markerEnd:f,markerStart:d,interactionWidth:h})=>{const[y,p,w]=pf({sourceX:e,sourceY:t,targetX:n,targetY:r});return L.createElement(Ut,{path:y,labelX:p,labelY:w,label:o,labelStyle:i,labelShowBg:s,labelBgStyle:a,labelBgPadding:c,labelBgBorderRadius:u,style:l,markerEnd:f,markerStart:d,interactionWidth:h})});br.displayName="StraightEdge";function Jt(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function uo({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case j.Left:return[t-Jt(t-r,i),n];case j.Right:return[t+Jt(r-t,i),n];case j.Top:return[t,n-Jt(n-o,i)];case j.Bottom:return[t,n+Jt(o-n,i)]}}function zi({sourceX:e,sourceY:t,sourcePosition:n=j.Bottom,targetX:r,targetY:o,targetPosition:i=j.Top,curvature:s=.25}){const[a,c]=uo({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,l]=uo({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[f,d,h,y]=Bi({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:c,targetControlX:u,targetControlY:l});return[`M${e},${t} C${a},${c} ${u},${l} ${r},${o}`,f,d,h,y]}const vn=b.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:o=j.Bottom,targetPosition:i=j.Top,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:l,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:y,pathOptions:p,interactionWidth:w})=>{const[m,_,$]=zi({sourceX:e,sourceY:t,sourcePosition:o,targetX:n,targetY:r,targetPosition:i,curvature:p==null?void 0:p.curvature});return L.createElement(Ut,{path:m,labelX:_,labelY:$,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:u,labelBgPadding:l,labelBgBorderRadius:f,style:d,markerEnd:h,markerStart:y,interactionWidth:w})});vn.displayName="BezierEdge";const _r=b.createContext(null),mf=_r.Provider;_r.Consumer;const yf=()=>b.useContext(_r),vf=e=>"id"in e&&"source"in e&&"target"in e,xf=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,sr=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,wf=(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)),Fi=(e,t)=>{if(!e.source||!e.target)return t;let n;return vf(e)?n={...e}:n={...e,id:xf(e)},wf(n,t)?t:t.concat(n)},ar=({x:e,y:t},[n,r,o],i,[s,a])=>{const c={x:(e-n)/o,y:(t-r)/o};return i?{x:s*Math.round(c.x/s),y:a*Math.round(c.y/a)}:c},ji=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),ft=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},Sr=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const{x:i,y:s}=ft(o,t).positionAbsolute;return af(r,xr({x:i,y:s,width:o.width||0,height:o.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return cf(n)},Gi=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1,a=[0,0])=>{const c={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},u=[];return e.forEach(l=>{const{width:f,height:d,selectable:h=!0,hidden:y=!1}=l;if(s&&!h||y)return!1;const{positionAbsolute:p}=ft(l,a),w={x:p.x,y:p.y,width:f||0,height:d||0},m=rr(c,w),_=typeof f>"u"||typeof d>"u"||f===null||d===null,$=i&&m>0,v=(f||0)*(d||0);(_||$||m>=v||l.dragging)&&u.push(l)}),u},Ui=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},Zi=(e,t,n,r,o,i=.1)=>{const s=t/(e.width*(1+i)),a=n/(e.height*(1+i)),c=Math.min(s,a),u=mt(c,r,o),l=e.x+e.width/2,f=e.y+e.height/2,d=t/2-l*u,h=n/2-f*u;return{x:d,y:h,zoom:u}},Ye=(e,t=0)=>e.transition().duration(t);function fo(e,t,n,r){return(t[n]||[]).reduce((o,i)=>{var s,a;return`${e.id}-${i.id}-${n}`!==r&&o.push({id:i.id||null,type:n,nodeId:e.id,x:(((s=e.positionAbsolute)==null?void 0:s.x)??0)+i.x+i.width/2,y:(((a=e.positionAbsolute)==null?void 0:a.y)??0)+i.y+i.height/2}),o},[])}function Cf(e,t,n,r,o,i){const{x:s,y:a}=Ve(e),u=t.elementsFromPoint(s,a).find(y=>y.classList.contains("react-flow__handle"));if(u){const y=u.getAttribute("data-nodeid");if(y){const p=Er(void 0,u),w=u.getAttribute("data-handleid"),m=i({nodeId:y,id:w,type:p});if(m){const _=o.find($=>$.nodeId===y&&$.type===p&&$.id===w);return{handle:{id:w,type:p,nodeId:y,x:(_==null?void 0:_.x)||n.x,y:(_==null?void 0:_.y)||n.y},validHandleResult:m}}}}let l=[],f=1/0;if(o.forEach(y=>{const p=Math.sqrt((y.x-n.x)**2+(y.y-n.y)**2);if(p<=r){const w=i(y);p<=f&&(p<f?l=[{handle:y,validHandleResult:w}]:p===f&&l.push({handle:y,validHandleResult:w}),f=p)}}),!l.length)return{handle:null,validHandleResult:Yi()};if(l.length===1)return l[0];const d=l.some(({validHandleResult:y})=>y.isValid),h=l.some(({handle:y})=>y.type==="target");return l.find(({handle:y,validHandleResult:p})=>h?y.type==="target":d?p.isValid:!0)||l[0]}const bf={source:null,target:null,sourceHandle:null,targetHandle:null},Yi=()=>({handleDomNode:null,isValid:!1,connection:bf,endHandle:null});function Xi(e,t,n,r,o,i,s){const a=o==="target",c=s.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),u={...Yi(),handleDomNode:c};if(c){const l=Er(void 0,c),f=c.getAttribute("data-nodeid"),d=c.getAttribute("data-handleid"),h=c.classList.contains("connectable"),y=c.classList.contains("connectableend"),p={source:a?f:n,sourceHandle:a?d:r,target:a?n:f,targetHandle:a?r:d};u.connection=p,h&&y&&(t===Qe.Strict?a&&l==="source"||!a&&l==="target":f!==n||d!==r)&&(u.endHandle={nodeId:f,handleId:d,type:l},u.isValid=i(p))}return u}function _f({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((o,i)=>{if(i[re]){const{handleBounds:s}=i[re];let a=[],c=[];s&&(a=fo(i,s,"source",`${t}-${n}-${r}`),c=fo(i,s,"target",`${t}-${n}-${r}`)),o.push(...a,...c)}return o},[])}function Er(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function jn(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function Sf(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function Wi({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:s,isValidConnection:a,edgeUpdaterType:c,onEdgeUpdateEnd:u}){const l=Ri(e.target),{connectionMode:f,domNode:d,autoPanOnConnect:h,connectionRadius:y,onConnectStart:p,panBy:w,getNodes:m,cancelConnection:_}=i();let $=0,v;const{x:M,y:O}=Ve(e),R=l==null?void 0:l.elementFromPoint(M,O),I=Er(c,R),k=d==null?void 0:d.getBoundingClientRect();if(!k||!I)return;let F,D=Ve(e,k),z=!1,E=null,g=!1,S=null;const C=_f({nodes:m(),nodeId:n,handleId:t,handleType:I}),T=()=>{if(!h)return;const[N,A]=Oi(D,k);w({x:N,y:A}),$=requestAnimationFrame(T)};s({connectionPosition:D,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:I,connectionStartHandle:{nodeId:n,handleId:t,type:I},connectionEndHandle:null}),p==null||p(e,{nodeId:n,handleId:t,handleType:I});function P(N){const{transform:A}=i();D=Ve(N,k);const{handle:V,validHandleResult:B}=Cf(N,l,ar(D,A,!1,[1,1]),y,C,H=>Xi(H,f,n,t,o?"target":"source",a,l));if(v=V,z||(T(),z=!0),S=B.handleDomNode,E=B.connection,g=B.isValid,s({connectionPosition:v&&g?ji({x:v.x,y:v.y},A):D,connectionStatus:Sf(!!v,g),connectionEndHandle:B.endHandle}),!v&&!g&&!S)return jn(F);E.source!==E.target&&S&&(jn(F),F=S,S.classList.add("connecting","react-flow__handle-connecting"),S.classList.toggle("valid",g),S.classList.toggle("react-flow__handle-valid",g))}function x(N){var A,V;(v||S)&&E&&g&&(r==null||r(E)),(V=(A=i()).onConnectEnd)==null||V.call(A,N),c&&(u==null||u(N)),jn(F),_(),cancelAnimationFrame($),z=!1,g=!1,E=null,S=null,l.removeEventListener("mousemove",P),l.removeEventListener("mouseup",x),l.removeEventListener("touchmove",P),l.removeEventListener("touchend",x)}l.addEventListener("mousemove",P),l.addEventListener("mouseup",x),l.addEventListener("touchmove",P),l.addEventListener("touchend",x)}const ho=()=>!0,Ef=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),Nf=(e,t,n)=>r=>{const{connectionStartHandle:o,connectionEndHandle:i,connectionClickStartHandle:s}=r;return{connecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n||(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.handleId)===t&&(s==null?void 0:s.type)===n}},qi=b.forwardRef(({type:e="source",position:t=j.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:c,className:u,onMouseDown:l,onTouchStart:f,...d},h)=>{var k,F;const y=s||null,p=e==="target",w=oe(),m=yf(),{connectOnClick:_,noPanClassName:$}=J(Ef,ue),{connecting:v,clickConnecting:M}=J(Nf(m,y,e),ue);m||(F=(k=w.getState()).onError)==null||F.call(k,"010",Ae.error010());const O=D=>{const{defaultEdgeOptions:z,onConnect:E,hasDefaultEdges:g}=w.getState(),S={...z,...D};if(g){const{edges:C,setEdges:T}=w.getState();T(Fi(S,C))}E==null||E(S),a==null||a(S)},R=D=>{if(!m)return;const z=Di(D);o&&(z&&D.button===0||!z)&&Wi({event:D,handleId:y,nodeId:m,onConnect:O,isTarget:p,getState:w.getState,setState:w.setState,isValidConnection:n||w.getState().isValidConnection||ho}),z?l==null||l(D):f==null||f(D)},I=D=>{const{onClickConnectStart:z,onClickConnectEnd:E,connectionClickStartHandle:g,connectionMode:S,isValidConnection:C}=w.getState();if(!m||!g&&!o)return;if(!g){z==null||z(D,{nodeId:m,handleId:y,handleType:e}),w.setState({connectionClickStartHandle:{nodeId:m,type:e,handleId:y}});return}const T=Ri(D.target),P=n||C||ho,{connection:x,isValid:N}=Xi({nodeId:m,id:y,type:e},S,g.nodeId,g.handleId||null,g.type,P,T);N&&O(x),E==null||E(D),w.setState({connectionClickStartHandle:null})};return L.createElement("div",{"data-handleid":y,"data-nodeid":m,"data-handlepos":t,"data-id":`${m}-${y}-${e}`,className:me(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",$,u,{source:!p,target:p,connectable:r,connectablestart:o,connectableend:i,connecting:M,connectionindicator:r&&(o&&!v||i&&v)}]),onMouseDown:R,onTouchStart:R,onClick:_?I:void 0,ref:h,...d},c)});qi.displayName="Handle";var yt=b.memo(qi);const Ki=({data:e,isConnectable:t,targetPosition:n=j.Top,sourcePosition:r=j.Bottom})=>L.createElement(L.Fragment,null,L.createElement(yt,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,L.createElement(yt,{type:"source",position:r,isConnectable:t}));Ki.displayName="DefaultNode";var cr=b.memo(Ki);const Qi=({data:e,isConnectable:t,sourcePosition:n=j.Bottom})=>L.createElement(L.Fragment,null,e==null?void 0:e.label,L.createElement(yt,{type:"source",position:n,isConnectable:t}));Qi.displayName="InputNode";var Ji=b.memo(Qi);const es=({data:e,isConnectable:t,targetPosition:n=j.Top})=>L.createElement(L.Fragment,null,L.createElement(yt,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label);es.displayName="OutputNode";var ts=b.memo(es);const Nr=()=>null;Nr.displayName="GroupNode";const $f=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),en=e=>e.id;function Mf(e,t){return ue(e.selectedNodes.map(en),t.selectedNodes.map(en))&&ue(e.selectedEdges.map(en),t.selectedEdges.map(en))}const ns=b.memo(({onSelectionChange:e})=>{const t=oe(),{selectedNodes:n,selectedEdges:r}=J($f,Mf);return b.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChange.forEach(i=>i(o))},[n,r,e]),null});ns.displayName="SelectionListener";const Tf=e=>!!e.onSelectionChange;function Af({onSelectionChange:e}){const t=J(Tf);return e||t?L.createElement(ns,{onSelectionChange:e}):null}const kf=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function rt(e,t){b.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function X(e,t,n){b.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const If=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:i,onConnectEnd:s,onClickConnectStart:a,onClickConnectEnd:c,nodesDraggable:u,nodesConnectable:l,nodesFocusable:f,edgesFocusable:d,edgesUpdatable:h,elevateNodesOnSelect:y,minZoom:p,maxZoom:w,nodeExtent:m,onNodesChange:_,onEdgesChange:$,elementsSelectable:v,connectionMode:M,snapGrid:O,snapToGrid:R,translateExtent:I,connectOnClick:k,defaultEdgeOptions:F,fitView:D,fitViewOptions:z,onNodesDelete:E,onEdgesDelete:g,onNodeDrag:S,onNodeDragStart:C,onNodeDragStop:T,onSelectionDrag:P,onSelectionDragStart:x,onSelectionDragStop:N,noPanClassName:A,nodeOrigin:V,rfId:B,autoPanOnConnect:H,autoPanOnNodeDrag:U,onError:Y,connectionRadius:W,isValidConnection:q,nodeDragThreshold:ee})=>{const{setNodes:te,setEdges:ae,setDefaultNodesAndEdges:ye,setMinZoom:Ce,setMaxZoom:ne,setTranslateExtent:Q,setNodeExtent:ce,reset:fe}=J(kf,ue),Z=oe();return b.useEffect(()=>{const Be=r==null?void 0:r.map(He=>({...He,...F}));return ye(n,Be),()=>{fe()}},[]),X("defaultEdgeOptions",F,Z.setState),X("connectionMode",M,Z.setState),X("onConnect",o,Z.setState),X("onConnectStart",i,Z.setState),X("onConnectEnd",s,Z.setState),X("onClickConnectStart",a,Z.setState),X("onClickConnectEnd",c,Z.setState),X("nodesDraggable",u,Z.setState),X("nodesConnectable",l,Z.setState),X("nodesFocusable",f,Z.setState),X("edgesFocusable",d,Z.setState),X("edgesUpdatable",h,Z.setState),X("elementsSelectable",v,Z.setState),X("elevateNodesOnSelect",y,Z.setState),X("snapToGrid",R,Z.setState),X("snapGrid",O,Z.setState),X("onNodesChange",_,Z.setState),X("onEdgesChange",$,Z.setState),X("connectOnClick",k,Z.setState),X("fitViewOnInit",D,Z.setState),X("fitViewOnInitOptions",z,Z.setState),X("onNodesDelete",E,Z.setState),X("onEdgesDelete",g,Z.setState),X("onNodeDrag",S,Z.setState),X("onNodeDragStart",C,Z.setState),X("onNodeDragStop",T,Z.setState),X("onSelectionDrag",P,Z.setState),X("onSelectionDragStart",x,Z.setState),X("onSelectionDragStop",N,Z.setState),X("noPanClassName",A,Z.setState),X("nodeOrigin",V,Z.setState),X("rfId",B,Z.setState),X("autoPanOnConnect",H,Z.setState),X("autoPanOnNodeDrag",U,Z.setState),X("onError",Y,Z.setState),X("connectionRadius",W,Z.setState),X("isValidConnection",q,Z.setState),X("nodeDragThreshold",ee,Z.setState),rt(e,te),rt(t,ae),rt(p,Ce),rt(w,ne),rt(I,Q),rt(m,ce),null},go={display:"none"},Pf={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},rs="react-flow__node-desc",os="react-flow__edge-desc",Of="react-flow__aria-live",Rf=e=>e.ariaLiveMessage;function Lf({rfId:e}){const t=J(Rf);return L.createElement("div",{id:`${Of}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Pf},t)}function Df({rfId:e,disableKeyboardA11y:t}){return L.createElement(L.Fragment,null,L.createElement("div",{id:`${rs}-${e}`,style:go},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),L.createElement("div",{id:`${os}-${e}`,style:go},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&L.createElement(Lf,{rfId:e}))}var Ft=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=b.useState(!1),o=b.useRef(!1),i=b.useRef(new Set([])),[s,a]=b.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.split("+")),l=u.reduce((f,d)=>f.concat(...d),[]);return[u,l]}return[[],[]]},[e]);return b.useEffect(()=>{const c=typeof document<"u"?document:null,u=(t==null?void 0:t.target)||c;if(e!==null){const l=h=>{if(o.current=h.ctrlKey||h.metaKey||h.shiftKey,(!o.current||o.current&&!t.actInsideInputWithModifier)&&or(h))return!1;const p=mo(h.code,a);i.current.add(h[p]),po(s,i.current,!1)&&(h.preventDefault(),r(!0))},f=h=>{if((!o.current||o.current&&!t.actInsideInputWithModifier)&&or(h))return!1;const p=mo(h.code,a);po(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(h[p]),h.key==="Meta"&&i.current.clear(),o.current=!1},d=()=>{i.current.clear(),r(!1)};return u==null||u.addEventListener("keydown",l),u==null||u.addEventListener("keyup",f),window.addEventListener("blur",d),()=>{u==null||u.removeEventListener("keydown",l),u==null||u.removeEventListener("keyup",f),window.removeEventListener("blur",d)}}},[e,r]),n};function po(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function mo(e,t){return t.includes(e)?"code":"key"}function is(e,t,n,r){var s,a;if(!e.parentNode)return n;const o=t.get(e.parentNode),i=ft(o,r);return is(o,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(((s=o[re])==null?void 0:s.z)??0)>(n.z??0)?((a=o[re])==null?void 0:a.z)??0:n.z??0},r)}function ss(e,t,n){e.forEach(r=>{var o;if(r.parentNode&&!e.has(r.parentNode))throw new Error(`Parent node ${r.parentNode} not found`);if(r.parentNode||n!=null&&n[r.id]){const{x:i,y:s,z:a}=is(r,e,{...r.position,z:((o=r[re])==null?void 0:o.z)??0},t);r.positionAbsolute={x:i,y:s},r[re].z=a,n!=null&&n[r.id]&&(r[re].isParent=!0)}})}function Gn(e,t,n,r){const o=new Map,i={},s=r?1e3:0;return e.forEach(a=>{var f;const c=(pe(a.zIndex)?a.zIndex:0)+(a.selected?s:0),u=t.get(a.id),l={width:u==null?void 0:u.width,height:u==null?void 0:u.height,...a,positionAbsolute:{x:a.position.x,y:a.position.y}};a.parentNode&&(l.parentNode=a.parentNode,i[a.parentNode]=!0),Object.defineProperty(l,re,{enumerable:!1,value:{handleBounds:(f=u==null?void 0:u[re])==null?void 0:f.handleBounds,z:c}}),o.set(a.id,l)}),ss(o,n,i),o}function as(e,t={}){const{getNodes:n,width:r,height:o,minZoom:i,maxZoom:s,d3Zoom:a,d3Selection:c,fitViewOnInitDone:u,fitViewOnInit:l,nodeOrigin:f}=e(),d=t.initial&&!u&&l;if(a&&c&&(d||!t.initial)){const y=n().filter(w=>{var _;const m=t.includeHiddenNodes?w.width&&w.height:!w.hidden;return(_=t.nodes)!=null&&_.length?m&&t.nodes.some($=>$.id===w.id):m}),p=y.every(w=>w.width&&w.height);if(y.length>0&&p){const w=Sr(y,f),{x:m,y:_,zoom:$}=Zi(w,r,o,t.minZoom??i,t.maxZoom??s,t.padding??.1),v=De.translate(m,_).scale($);return typeof t.duration=="number"&&t.duration>0?a.transform(Ye(c,t.duration),v):a.transform(c,v),!0}}return!1}function Vf(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[re]:r[re],selected:n.selected})}),new Map(t)}function Bf(e,t){return t.map(n=>{const r=e.find(o=>o.id===n.id);return r&&(n.selected=r.selected),n})}function tn({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:i,onNodesChange:s,onEdgesChange:a,hasDefaultNodes:c,hasDefaultEdges:u}=n();e!=null&&e.length&&(c&&r({nodeInternals:Vf(e,o)}),s==null||s(e)),t!=null&&t.length&&(u&&r({edges:Bf(t,i)}),a==null||a(t))}const ot=()=>{},Hf={zoomIn:ot,zoomOut:ot,zoomTo:ot,getZoom:()=>1,setViewport:ot,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:ot,fitBounds:ot,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},zf=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),Ff=()=>{const e=oe(),{d3Zoom:t,d3Selection:n}=J(zf,ue);return b.useMemo(()=>n&&t?{zoomIn:o=>t.scaleBy(Ye(n,o==null?void 0:o.duration),1.2),zoomOut:o=>t.scaleBy(Ye(n,o==null?void 0:o.duration),1/1.2),zoomTo:(o,i)=>t.scaleTo(Ye(n,i==null?void 0:i.duration),o),getZoom:()=>e.getState().transform[2],setViewport:(o,i)=>{const[s,a,c]=e.getState().transform,u=De.translate(o.x??s,o.y??a).scale(o.zoom??c);t.transform(Ye(n,i==null?void 0:i.duration),u)},getViewport:()=>{const[o,i,s]=e.getState().transform;return{x:o,y:i,zoom:s}},fitView:o=>as(e.getState,o),setCenter:(o,i,s)=>{const{width:a,height:c,maxZoom:u}=e.getState(),l=typeof(s==null?void 0:s.zoom)<"u"?s.zoom:u,f=a/2-o*l,d=c/2-i*l,h=De.translate(f,d).scale(l);t.transform(Ye(n,s==null?void 0:s.duration),h)},fitBounds:(o,i)=>{const{width:s,height:a,minZoom:c,maxZoom:u}=e.getState(),{x:l,y:f,zoom:d}=Zi(o,s,a,c,u,(i==null?void 0:i.padding)??.1),h=De.translate(l,f).scale(d);t.transform(Ye(n,i==null?void 0:i.duration),h)},project:o=>{const{transform:i,snapToGrid:s,snapGrid:a}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),ar(o,i,s,a)},screenToFlowPosition:o=>{const{transform:i,snapToGrid:s,snapGrid:a,domNode:c}=e.getState();if(!c)return o;const{x:u,y:l}=c.getBoundingClientRect(),f={x:o.x-u,y:o.y-l};return ar(f,i,s,a)},flowToScreenPosition:o=>{const{transform:i,domNode:s}=e.getState();if(!s)return o;const{x:a,y:c}=s.getBoundingClientRect(),u=ji(o,i);return{x:u.x+a,y:u.y+c}},viewportInitialized:!0}:Hf,[t,n])};function cs(){const e=Ff(),t=oe(),n=b.useCallback(()=>t.getState().getNodes().map(p=>({...p})),[]),r=b.useCallback(p=>t.getState().nodeInternals.get(p),[]),o=b.useCallback(()=>{const{edges:p=[]}=t.getState();return p.map(w=>({...w}))},[]),i=b.useCallback(p=>{const{edges:w=[]}=t.getState();return w.find(m=>m.id===p)},[]),s=b.useCallback(p=>{const{getNodes:w,setNodes:m,hasDefaultNodes:_,onNodesChange:$}=t.getState(),v=w(),M=typeof p=="function"?p(v):p;if(_)m(M);else if($){const O=M.length===0?v.map(R=>({type:"remove",id:R.id})):M.map(R=>({item:R,type:"reset"}));$(O)}},[]),a=b.useCallback(p=>{const{edges:w=[],setEdges:m,hasDefaultEdges:_,onEdgesChange:$}=t.getState(),v=typeof p=="function"?p(w):p;if(_)m(v);else if($){const M=v.length===0?w.map(O=>({type:"remove",id:O.id})):v.map(O=>({item:O,type:"reset"}));$(M)}},[]),c=b.useCallback(p=>{const w=Array.isArray(p)?p:[p],{getNodes:m,setNodes:_,hasDefaultNodes:$,onNodesChange:v}=t.getState();if($){const O=[...m(),...w];_(O)}else if(v){const M=w.map(O=>({item:O,type:"add"}));v(M)}},[]),u=b.useCallback(p=>{const w=Array.isArray(p)?p:[p],{edges:m=[],setEdges:_,hasDefaultEdges:$,onEdgesChange:v}=t.getState();if($)_([...m,...w]);else if(v){const M=w.map(O=>({item:O,type:"add"}));v(M)}},[]),l=b.useCallback(()=>{const{getNodes:p,edges:w=[],transform:m}=t.getState(),[_,$,v]=m;return{nodes:p().map(M=>({...M})),edges:w.map(M=>({...M})),viewport:{x:_,y:$,zoom:v}}},[]),f=b.useCallback(({nodes:p,edges:w})=>{const{nodeInternals:m,getNodes:_,edges:$,hasDefaultNodes:v,hasDefaultEdges:M,onNodesDelete:O,onEdgesDelete:R,onNodesChange:I,onEdgesChange:k}=t.getState(),F=(p||[]).map(S=>S.id),D=(w||[]).map(S=>S.id),z=_().reduce((S,C)=>{const T=!F.includes(C.id)&&C.parentNode&&S.find(x=>x.id===C.parentNode);return(typeof C.deletable=="boolean"?C.deletable:!0)&&(F.includes(C.id)||T)&&S.push(C),S},[]),E=$.filter(S=>typeof S.deletable=="boolean"?S.deletable:!0),g=E.filter(S=>D.includes(S.id));if(z||g){const S=Ui(z,E),C=[...g,...S],T=C.reduce((P,x)=>(P.includes(x.id)||P.push(x.id),P),[]);if((M||v)&&(M&&t.setState({edges:$.filter(P=>!T.includes(P.id))}),v&&(z.forEach(P=>{m.delete(P.id)}),t.setState({nodeInternals:new Map(m)}))),T.length>0&&(R==null||R(C),k&&k(T.map(P=>({id:P,type:"remove"})))),z.length>0&&(O==null||O(z),I)){const P=z.map(x=>({id:x.id,type:"remove"}));I(P)}}},[]),d=b.useCallback(p=>{const w=lf(p),m=w?null:t.getState().nodeInternals.get(p.id);return[w?p:so(m),m,w]},[]),h=b.useCallback((p,w=!0,m)=>{const[_,$,v]=d(p);return _?(m||t.getState().getNodes()).filter(M=>{if(!v&&(M.id===$.id||!M.positionAbsolute))return!1;const O=so(M),R=rr(O,_);return w&&R>0||R>=_.width*_.height}):[]},[]),y=b.useCallback((p,w,m=!0)=>{const[_]=d(p);if(!_)return!1;const $=rr(_,w);return m&&$>0||$>=_.width*_.height},[]);return b.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:o,getEdge:i,setNodes:s,setEdges:a,addNodes:c,addEdges:u,toObject:l,deleteElements:f,getIntersectingNodes:h,isNodeIntersecting:y}),[e,n,r,o,i,s,a,c,u,l,f,h,y])}const jf={actInsideInputWithModifier:!1};var Gf=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=oe(),{deleteElements:r}=cs(),o=Ft(e,jf),i=Ft(t);b.useEffect(()=>{if(o){const{edges:s,getNodes:a}=n.getState(),c=a().filter(l=>l.selected),u=s.filter(l=>l.selected);r({nodes:c,edges:u}),n.setState({nodesSelectionActive:!1})}},[o]),b.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])};function Uf(e){const t=oe();b.useEffect(()=>{let n;const r=()=>{var i,s;if(!e.current)return;const o=yr(e.current);(o.height===0||o.width===0)&&((s=(i=t.getState()).onError)==null||s.call(i,"004",Ae.error004())),t.setState({width:o.width||500,height:o.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const $r={position:"absolute",width:"100%",height:"100%",top:0,left:0},Zf=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,nn=e=>({x:e.x,y:e.y,zoom:e.k}),it=(e,t)=>e.target.closest(`.${t}`),yo=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),vo=e=>{const t=e.ctrlKey&&mn()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},Yf=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),Xf=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:o=!0,zoomOnPinch:i=!0,panOnScroll:s=!1,panOnScrollSpeed:a=.5,panOnScrollMode:c=We.Free,zoomOnDoubleClick:u=!0,elementsSelectable:l,panOnDrag:f=!0,defaultViewport:d,translateExtent:h,minZoom:y,maxZoom:p,zoomActivationKeyCode:w,preventScrolling:m=!0,children:_,noWheelClassName:$,noPanClassName:v})=>{const M=b.useRef(),O=oe(),R=b.useRef(!1),I=b.useRef(!1),k=b.useRef(null),F=b.useRef({x:0,y:0,zoom:0}),{d3Zoom:D,d3Selection:z,d3ZoomHandler:E,userSelectionActive:g}=J(Yf,ue),S=Ft(w),C=b.useRef(0),T=b.useRef(!1),P=b.useRef();return Uf(k),b.useEffect(()=>{if(k.current){const x=k.current.getBoundingClientRect(),N=J1().scaleExtent([y,p]).translateExtent(h),A=ve(k.current).call(N),V=De.translate(d.x,d.y).scale(mt(d.zoom,y,p)),B=[[0,0],[x.width,x.height]],H=N.constrain()(V,B,h);N.transform(A,H),N.wheelDelta(vo),O.setState({d3Zoom:N,d3Selection:A,d3ZoomHandler:A.on("wheel.zoom"),transform:[H.x,H.y,H.k],domNode:k.current.closest(".react-flow")})}},[]),b.useEffect(()=>{z&&D&&(s&&!S&&!g?z.on("wheel.zoom",x=>{if(it(x,$))return!1;x.preventDefault(),x.stopImmediatePropagation();const N=z.property("__zoom").k||1,A=mn();if(x.ctrlKey&&i&&A){const ee=_e(x),te=vo(x),ae=N*Math.pow(2,te);D.scaleTo(z,ae,ee,x);return}const V=x.deltaMode===1?20:1;let B=c===We.Vertical?0:x.deltaX*V,H=c===We.Horizontal?0:x.deltaY*V;!A&&x.shiftKey&&c!==We.Vertical&&(B=x.deltaY*V,H=0),D.translateBy(z,-(B/N)*a,-(H/N)*a,{internal:!0});const U=nn(z.property("__zoom")),{onViewportChangeStart:Y,onViewportChange:W,onViewportChangeEnd:q}=O.getState();clearTimeout(P.current),T.current||(T.current=!0,t==null||t(x,U),Y==null||Y(U)),T.current&&(e==null||e(x,U),W==null||W(U),P.current=setTimeout(()=>{n==null||n(x,U),q==null||q(U),T.current=!1},150))},{passive:!1}):typeof E<"u"&&z.on("wheel.zoom",function(x,N){if(!m||it(x,$))return null;x.preventDefault(),E.call(this,x,N)},{passive:!1}))},[g,s,c,z,D,E,S,i,m,$,t,e,n]),b.useEffect(()=>{D&&D.on("start",x=>{var V,B;if(!x.sourceEvent||x.sourceEvent.internal)return null;C.current=(V=x.sourceEvent)==null?void 0:V.button;const{onViewportChangeStart:N}=O.getState(),A=nn(x.transform);R.current=!0,F.current=A,((B=x.sourceEvent)==null?void 0:B.type)==="mousedown"&&O.setState({paneDragging:!0}),N==null||N(A),t==null||t(x.sourceEvent,A)})},[D,t]),b.useEffect(()=>{D&&(g&&!R.current?D.on("zoom",null):g||D.on("zoom",x=>{var A;const{onViewportChange:N}=O.getState();if(O.setState({transform:[x.transform.x,x.transform.y,x.transform.k]}),I.current=!!(r&&yo(f,C.current??0)),(e||N)&&!((A=x.sourceEvent)!=null&&A.internal)){const V=nn(x.transform);N==null||N(V),e==null||e(x.sourceEvent,V)}}))},[g,D,e,f,r]),b.useEffect(()=>{D&&D.on("end",x=>{if(!x.sourceEvent||x.sourceEvent.internal)return null;const{onViewportChangeEnd:N}=O.getState();if(R.current=!1,O.setState({paneDragging:!1}),r&&yo(f,C.current??0)&&!I.current&&r(x.sourceEvent),I.current=!1,(n||N)&&Zf(F.current,x.transform)){const A=nn(x.transform);F.current=A,clearTimeout(M.current),M.current=setTimeout(()=>{N==null||N(A),n==null||n(x.sourceEvent,A)},s?150:0)}})},[D,s,f,n,r]),b.useEffect(()=>{D&&D.filter(x=>{const N=S||o,A=i&&x.ctrlKey;if((f===!0||Array.isArray(f)&&f.includes(1))&&x.button===1&&x.type==="mousedown"&&(it(x,"react-flow__node")||it(x,"react-flow__edge")))return!0;if(!f&&!N&&!s&&!u&&!i||g||!u&&x.type==="dblclick"||it(x,$)&&x.type==="wheel"||it(x,v)&&(x.type!=="wheel"||s&&x.type==="wheel"&&!S)||!i&&x.ctrlKey&&x.type==="wheel"||!N&&!s&&!A&&x.type==="wheel"||!f&&(x.type==="mousedown"||x.type==="touchstart")||Array.isArray(f)&&!f.includes(x.button)&&(x.type==="mousedown"||x.type==="touchstart"))return!1;const V=Array.isArray(f)&&f.includes(x.button)||!x.button||x.button<=1;return(!x.ctrlKey||x.type==="wheel")&&V})},[g,D,o,i,s,u,f,l,S]),L.createElement("div",{className:"react-flow__renderer",ref:k,style:$r},_)},Wf=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function qf(){const{userSelectionActive:e,userSelectionRect:t}=J(Wf,ue);return e&&t?L.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function xo(e,t){const n=e.find(r=>r.id===t.parentNode);if(n){const r=t.position.x+t.width-n.width,o=t.position.y+t.height-n.height;if(r>0||o>0||t.position.x<0||t.position.y<0){if(n.style={...n.style},n.style.width=n.style.width??n.width,n.style.height=n.style.height??n.height,r>0&&(n.style.width+=r),o>0&&(n.style.height+=o),t.position.x<0){const i=Math.abs(t.position.x);n.position.x=n.position.x-i,n.style.width+=i,t.position.x=0}if(t.position.y<0){const i=Math.abs(t.position.y);n.position.y=n.position.y-i,n.style.height+=i,t.position.y=0}n.width=n.style.width,n.height=n.style.height}}}function ls(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,o)=>{const i=e.filter(a=>a.id===o.id);if(i.length===0)return r.push(o),r;const s={...o};for(const a of i)if(a)switch(a.type){case"select":{s.selected=a.selected;break}case"position":{typeof a.position<"u"&&(s.position=a.position),typeof a.positionAbsolute<"u"&&(s.positionAbsolute=a.positionAbsolute),typeof a.dragging<"u"&&(s.dragging=a.dragging),s.expandParent&&xo(r,s);break}case"dimensions":{typeof a.dimensions<"u"&&(s.width=a.dimensions.width,s.height=a.dimensions.height),typeof a.updateStyle<"u"&&(s.style={...s.style||{},...a.dimensions}),typeof a.resizing=="boolean"&&(s.resizing=a.resizing),s.expandParent&&xo(r,s);break}case"remove":return r}return r.push(s),r},n)}function us(e,t){return ls(e,t)}function Kf(e,t){return ls(e,t)}const Re=(e,t)=>({id:e,type:"select",selected:t});function ct(e,t){return e.reduce((n,r)=>{const o=t.includes(r.id);return!r.selected&&o?(r.selected=!0,n.push(Re(r.id,!0))):r.selected&&!o&&(r.selected=!1,n.push(Re(r.id,!1))),n},[])}const Un=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Qf=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),fs=b.memo(({isSelecting:e,selectionMode:t=zt.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:o,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:a,onPaneMouseEnter:c,onPaneMouseMove:u,onPaneMouseLeave:l,children:f})=>{const d=b.useRef(null),h=oe(),y=b.useRef(0),p=b.useRef(0),w=b.useRef(),{userSelectionActive:m,elementsSelectable:_,dragging:$}=J(Qf,ue),v=()=>{h.setState({userSelectionActive:!1,userSelectionRect:null}),y.current=0,p.current=0},M=E=>{i==null||i(E),h.getState().resetSelectedElements(),h.setState({nodesSelectionActive:!1})},O=E=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){E.preventDefault();return}s==null||s(E)},R=a?E=>a(E):void 0,I=E=>{const{resetSelectedElements:g,domNode:S}=h.getState();if(w.current=S==null?void 0:S.getBoundingClientRect(),!_||!e||E.button!==0||E.target!==d.current||!w.current)return;const{x:C,y:T}=Ve(E,w.current);g(),h.setState({userSelectionRect:{width:0,height:0,startX:C,startY:T,x:C,y:T}}),r==null||r(E)},k=E=>{const{userSelectionRect:g,nodeInternals:S,edges:C,transform:T,onNodesChange:P,onEdgesChange:x,nodeOrigin:N,getNodes:A}=h.getState();if(!e||!w.current||!g)return;h.setState({userSelectionActive:!0,nodesSelectionActive:!1});const V=Ve(E,w.current),B=g.startX??0,H=g.startY??0,U={...g,x:V.x<B?V.x:B,y:V.y<H?V.y:H,width:Math.abs(V.x-B),height:Math.abs(V.y-H)},Y=A(),W=Gi(S,U,T,t===zt.Partial,!0,N),q=Ui(W,C).map(te=>te.id),ee=W.map(te=>te.id);if(y.current!==ee.length){y.current=ee.length;const te=ct(Y,ee);te.length&&(P==null||P(te))}if(p.current!==q.length){p.current=q.length;const te=ct(C,q);te.length&&(x==null||x(te))}h.setState({userSelectionRect:U})},F=E=>{if(E.button!==0)return;const{userSelectionRect:g}=h.getState();!m&&g&&E.target===d.current&&(M==null||M(E)),h.setState({nodesSelectionActive:y.current>0}),v(),o==null||o(E)},D=E=>{m&&(h.setState({nodesSelectionActive:y.current>0}),o==null||o(E)),v()},z=_&&(e||m);return L.createElement("div",{className:me(["react-flow__pane",{dragging:$,selection:e}]),onClick:z?void 0:Un(M,d),onContextMenu:Un(O,d),onWheel:Un(R,d),onMouseEnter:z?void 0:c,onMouseDown:z?I:void 0,onMouseMove:z?k:u,onMouseUp:z?F:void 0,onMouseLeave:z?D:l,ref:d,style:$r},f,L.createElement(qf,null))});fs.displayName="Pane";function ds(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:ds(n,t):!1}function wo(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function Jf(e,t,n,r){return Array.from(e.values()).filter(o=>(o.selected||o.id===r)&&(!o.parentNode||!ds(o,e))&&(o.draggable||t&&typeof o.draggable>"u")).map(o=>{var i,s;return{id:o.id,position:o.position||{x:0,y:0},positionAbsolute:o.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((i=o.positionAbsolute)==null?void 0:i.x)??0),y:n.y-(((s=o.positionAbsolute)==null?void 0:s.y)??0)},delta:{x:0,y:0},extent:o.extent,parentNode:o.parentNode,width:o.width,height:o.height,expandParent:o.expandParent}})}function ed(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function hs(e,t,n,r,o=[0,0],i){const s=ed(e,e.extent||r);let a=s;if(e.extent==="parent"&&!e.expandParent)if(e.parentNode&&e.width&&e.height){const l=n.get(e.parentNode),{x:f,y:d}=ft(l,o).positionAbsolute;a=l&&pe(f)&&pe(d)&&pe(l.width)&&pe(l.height)?[[f+e.width*o[0],d+e.height*o[1]],[f+l.width-e.width+e.width*o[0],d+l.height-e.height+e.height*o[1]]]:a}else i==null||i("005",Ae.error005()),a=s;else if(e.extent&&e.parentNode&&e.extent!=="parent"){const l=n.get(e.parentNode),{x:f,y:d}=ft(l,o).positionAbsolute;a=[[e.extent[0][0]+f,e.extent[0][1]+d],[e.extent[1][0]+f,e.extent[1][1]+d]]}let c={x:0,y:0};if(e.parentNode){const l=n.get(e.parentNode);c=ft(l,o).positionAbsolute}const u=a&&a!=="parent"?vr(t,a):t;return{position:{x:u.x-c.x,y:u.y-c.y},positionAbsolute:u}}function Zn({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(o=>({...n.get(o.id),position:o.position,positionAbsolute:o.positionAbsolute}));return[e?r.find(o=>o.id===e):r[0],r]}const Co=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const i=Array.from(o),s=t.getBoundingClientRect(),a={x:s.width*r[0],y:s.height*r[1]};return i.map(c=>{const u=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),position:c.getAttribute("data-handlepos"),x:(u.left-s.left-a.x)/n,y:(u.top-s.top-a.y)/n,...yr(c)}})};function At(e,t,n){return n===void 0?n:r=>{const o=t().nodeInternals.get(e);o&&n(r,{...o})}}function lr({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeInternals:a,onError:c}=t.getState(),u=a.get(e);if(!u){c==null||c("012",Ae.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var l;return(l=r==null?void 0:r.current)==null?void 0:l.blur()})):o([e])}function td(){const e=oe();return b.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:o,snapToGrid:i}=e.getState(),s=n.touches?n.touches[0].clientX:n.clientX,a=n.touches?n.touches[0].clientY:n.clientY,c={x:(s-r[0])/r[2],y:(a-r[1])/r[2]};return{xSnapped:i?o[0]*Math.round(c.x/o[0]):c.x,ySnapped:i?o[1]*Math.round(c.y/o[1]):c.y,...c}},[])}function Yn(e){return(t,n,r)=>e==null?void 0:e(t,r)}function gs({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,selectNodesOnDrag:s}){const a=oe(),[c,u]=b.useState(!1),l=b.useRef([]),f=b.useRef({x:null,y:null}),d=b.useRef(0),h=b.useRef(null),y=b.useRef({x:0,y:0}),p=b.useRef(null),w=b.useRef(!1),m=b.useRef(!1),_=td();return b.useEffect(()=>{if(e!=null&&e.current){const $=ve(e.current),v=({x:R,y:I})=>{const{nodeInternals:k,onNodeDrag:F,onSelectionDrag:D,updateNodePositions:z,nodeExtent:E,snapGrid:g,snapToGrid:S,nodeOrigin:C,onError:T}=a.getState();f.current={x:R,y:I};let P=!1,x={x:0,y:0,x2:0,y2:0};if(l.current.length>1&&E){const A=Sr(l.current,C);x=xr(A)}if(l.current=l.current.map(A=>{const V={x:R-A.distance.x,y:I-A.distance.y};S&&(V.x=g[0]*Math.round(V.x/g[0]),V.y=g[1]*Math.round(V.y/g[1]));const B=[[E[0][0],E[0][1]],[E[1][0],E[1][1]]];l.current.length>1&&E&&!A.extent&&(B[0][0]=A.positionAbsolute.x-x.x+E[0][0],B[1][0]=A.positionAbsolute.x+(A.width??0)-x.x2+E[1][0],B[0][1]=A.positionAbsolute.y-x.y+E[0][1],B[1][1]=A.positionAbsolute.y+(A.height??0)-x.y2+E[1][1]);const H=hs(A,V,k,B,C,T);return P=P||A.position.x!==H.position.x||A.position.y!==H.position.y,A.position=H.position,A.positionAbsolute=H.positionAbsolute,A}),!P)return;z(l.current,!0,!0),u(!0);const N=o?F:Yn(D);if(N&&p.current){const[A,V]=Zn({nodeId:o,dragItems:l.current,nodeInternals:k});N(p.current,A,V)}},M=()=>{if(!h.current)return;const[R,I]=Oi(y.current,h.current);if(R!==0||I!==0){const{transform:k,panBy:F}=a.getState();f.current.x=(f.current.x??0)-R/k[2],f.current.y=(f.current.y??0)-I/k[2],F({x:R,y:I})&&v(f.current)}d.current=requestAnimationFrame(M)},O=R=>{var C;const{nodeInternals:I,multiSelectionActive:k,nodesDraggable:F,unselectNodesAndEdges:D,onNodeDragStart:z,onSelectionDragStart:E}=a.getState();m.current=!0;const g=o?z:Yn(E);(!s||!i)&&!k&&o&&((C=I.get(o))!=null&&C.selected||D()),o&&i&&s&&lr({id:o,store:a,nodeRef:e});const S=_(R);if(f.current=S,l.current=Jf(I,F,S,o),g&&l.current){const[T,P]=Zn({nodeId:o,dragItems:l.current,nodeInternals:I});g(R.sourceEvent,T,P)}};if(t)$.on(".drag",null);else{const R=lu().on("start",I=>{const{domNode:k,nodeDragThreshold:F}=a.getState();F===0&&O(I);const D=_(I);f.current=D,h.current=(k==null?void 0:k.getBoundingClientRect())||null,y.current=Ve(I.sourceEvent,h.current)}).on("drag",I=>{var z,E;const k=_(I),{autoPanOnNodeDrag:F,nodeDragThreshold:D}=a.getState();if(!w.current&&m.current&&F&&(w.current=!0,M()),!m.current){const g=k.xSnapped-(((z=f==null?void 0:f.current)==null?void 0:z.x)??0),S=k.ySnapped-(((E=f==null?void 0:f.current)==null?void 0:E.y)??0);Math.sqrt(g*g+S*S)>D&&O(I)}(f.current.x!==k.xSnapped||f.current.y!==k.ySnapped)&&l.current&&m.current&&(p.current=I.sourceEvent,y.current=Ve(I.sourceEvent,h.current),v(k))}).on("end",I=>{if(m.current&&(u(!1),w.current=!1,m.current=!1,cancelAnimationFrame(d.current),l.current)){const{updateNodePositions:k,nodeInternals:F,onNodeDragStop:D,onSelectionDragStop:z}=a.getState(),E=o?D:Yn(z);if(k(l.current,!1,!1),E){const[g,S]=Zn({nodeId:o,dragItems:l.current,nodeInternals:F});E(I.sourceEvent,g,S)}}}).filter(I=>{const k=I.target;return!I.button&&(!n||!wo(k,`.${n}`,e))&&(!r||wo(k,r,e))});return $.call(R),()=>{$.on(".drag",null)}}}},[e,t,n,r,i,a,o,s,_]),c}function ps(){const e=oe();return b.useCallback(n=>{const{nodeInternals:r,nodeExtent:o,updateNodePositions:i,getNodes:s,snapToGrid:a,snapGrid:c,onError:u,nodesDraggable:l}=e.getState(),f=s().filter(_=>_.selected&&(_.draggable||l&&typeof _.draggable>"u")),d=a?c[0]:5,h=a?c[1]:5,y=n.isShiftPressed?4:1,p=n.x*d*y,w=n.y*h*y,m=f.map(_=>{if(_.positionAbsolute){const $={x:_.positionAbsolute.x+p,y:_.positionAbsolute.y+w};a&&($.x=c[0]*Math.round($.x/c[0]),$.y=c[1]*Math.round($.y/c[1]));const{positionAbsolute:v,position:M}=hs(_,$,r,o,void 0,u);_.position=M,_.positionAbsolute=v}return _});i(m,!0,!1)},[])}const dt={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var kt=e=>{const t=({id:n,type:r,data:o,xPos:i,yPos:s,xPosOrigin:a,yPosOrigin:c,selected:u,onClick:l,onMouseEnter:f,onMouseMove:d,onMouseLeave:h,onContextMenu:y,onDoubleClick:p,style:w,className:m,isDraggable:_,isSelectable:$,isConnectable:v,isFocusable:M,selectNodesOnDrag:O,sourcePosition:R,targetPosition:I,hidden:k,resizeObserver:F,dragHandle:D,zIndex:z,isParent:E,noDragClassName:g,noPanClassName:S,initialized:C,disableKeyboardA11y:T,ariaLabel:P,rfId:x})=>{const N=oe(),A=b.useRef(null),V=b.useRef(R),B=b.useRef(I),H=b.useRef(r),U=$||_||l||f||d||h,Y=ps(),W=At(n,N.getState,f),q=At(n,N.getState,d),ee=At(n,N.getState,h),te=At(n,N.getState,y),ae=At(n,N.getState,p),ye=Q=>{const{nodeDragThreshold:ce}=N.getState();if($&&(!O||!_||ce>0)&&lr({id:n,store:N,nodeRef:A}),l){const fe=N.getState().nodeInternals.get(n);fe&&l(Q,{...fe})}},Ce=Q=>{if(!or(Q))if(Li.includes(Q.key)&&$){const ce=Q.key==="Escape";lr({id:n,store:N,unselect:ce,nodeRef:A})}else!T&&_&&u&&Object.prototype.hasOwnProperty.call(dt,Q.key)&&(N.setState({ariaLiveMessage:`Moved selected node ${Q.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~s}`}),Y({x:dt[Q.key].x,y:dt[Q.key].y,isShiftPressed:Q.shiftKey}))};b.useEffect(()=>{if(A.current&&!k){const Q=A.current;return F==null||F.observe(Q),()=>F==null?void 0:F.unobserve(Q)}},[k]),b.useEffect(()=>{const Q=H.current!==r,ce=V.current!==R,fe=B.current!==I;A.current&&(Q||ce||fe)&&(Q&&(H.current=r),ce&&(V.current=R),fe&&(B.current=I),N.getState().updateNodeDimensions([{id:n,nodeElement:A.current,forceUpdate:!0}]))},[n,r,R,I]);const ne=gs({nodeRef:A,disabled:k||!_,noDragClassName:g,handleSelector:D,nodeId:n,isSelectable:$,selectNodesOnDrag:O});return k?null:L.createElement("div",{className:me(["react-flow__node",`react-flow__node-${r}`,{[S]:_},m,{selected:u,selectable:$,parent:E,dragging:ne}]),ref:A,style:{zIndex:z,transform:`translate(${a}px,${c}px)`,pointerEvents:U?"all":"none",visibility:C?"visible":"hidden",...w},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:W,onMouseMove:q,onMouseLeave:ee,onContextMenu:te,onClick:ye,onDoubleClick:ae,onKeyDown:M?Ce:void 0,tabIndex:M?0:void 0,role:M?"button":void 0,"aria-describedby":T?void 0:`${rs}-${x}`,"aria-label":P},L.createElement(mf,{value:n},L.createElement(e,{id:n,data:o,type:r,xPos:i,yPos:s,selected:u,isConnectable:v,sourcePosition:R,targetPosition:I,dragging:ne,dragHandle:D,zIndex:z})))};return t.displayName="NodeWrapper",b.memo(t)};const nd=e=>{const t=e.getNodes().filter(n=>n.selected);return{...Sr(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function rd({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=oe(),{width:o,height:i,x:s,y:a,transformString:c,userSelectionActive:u}=J(nd,ue),l=ps(),f=b.useRef(null);if(b.useEffect(()=>{var y;n||(y=f.current)==null||y.focus({preventScroll:!0})},[n]),gs({nodeRef:f}),u||!o||!i)return null;const d=e?y=>{const p=r.getState().getNodes().filter(w=>w.selected);e(y,p)}:void 0,h=y=>{Object.prototype.hasOwnProperty.call(dt,y.key)&&l({x:dt[y.key].x,y:dt[y.key].y,isShiftPressed:y.shiftKey})};return L.createElement("div",{className:me(["react-flow__nodesselection","react-flow__container",t]),style:{transform:c}},L.createElement("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:o,height:i,top:a,left:s}}))}var od=b.memo(rd);const id=e=>e.nodesSelectionActive,ms=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,deleteKeyCode:a,onMove:c,onMoveStart:u,onMoveEnd:l,selectionKeyCode:f,selectionOnDrag:d,selectionMode:h,onSelectionStart:y,onSelectionEnd:p,multiSelectionKeyCode:w,panActivationKeyCode:m,zoomActivationKeyCode:_,elementsSelectable:$,zoomOnScroll:v,zoomOnPinch:M,panOnScroll:O,panOnScrollSpeed:R,panOnScrollMode:I,zoomOnDoubleClick:k,panOnDrag:F,defaultViewport:D,translateExtent:z,minZoom:E,maxZoom:g,preventScrolling:S,onSelectionContextMenu:C,noWheelClassName:T,noPanClassName:P,disableKeyboardA11y:x})=>{const N=J(id),A=Ft(f),V=Ft(m),B=V||F,H=V||O,U=A||d&&B!==!0;return Gf({deleteKeyCode:a,multiSelectionKeyCode:w}),L.createElement(Xf,{onMove:c,onMoveStart:u,onMoveEnd:l,onPaneContextMenu:i,elementsSelectable:$,zoomOnScroll:v,zoomOnPinch:M,panOnScroll:H,panOnScrollSpeed:R,panOnScrollMode:I,zoomOnDoubleClick:k,panOnDrag:!A&&B,defaultViewport:D,translateExtent:z,minZoom:E,maxZoom:g,zoomActivationKeyCode:_,preventScrolling:S,noWheelClassName:T,noPanClassName:P},L.createElement(fs,{onSelectionStart:y,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:B,isSelecting:!!U,selectionMode:h},e,N&&L.createElement(od,{onSelectionContextMenu:C,noPanClassName:P,disableKeyboardA11y:x})))};ms.displayName="FlowRenderer";var sd=b.memo(ms);function ad(e){return J(b.useCallback(n=>e?Gi(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function cd(e){const t={input:kt(e.input||Ji),default:kt(e.default||cr),output:kt(e.output||ts),group:kt(e.group||Nr)},n={},r=Object.keys(e).filter(o=>!["input","default","output","group"].includes(o)).reduce((o,i)=>(o[i]=kt(e[i]||cr),o),n);return{...t,...r}}const ld=({x:e,y:t,width:n,height:r,origin:o})=>!n||!r?{x:e,y:t}:o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]},ud=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),ys=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:o,updateNodeDimensions:i,onError:s}=J(ud,ue),a=ad(e.onlyRenderVisibleElements),c=b.useRef(),u=b.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const l=new ResizeObserver(f=>{const d=f.map(h=>({id:h.target.getAttribute("data-id"),nodeElement:h.target,forceUpdate:!0}));i(d)});return c.current=l,l},[]);return b.useEffect(()=>()=>{var l;(l=c==null?void 0:c.current)==null||l.disconnect()},[]),L.createElement("div",{className:"react-flow__nodes",style:$r},a.map(l=>{var M,O;let f=l.type||"default";e.nodeTypes[f]||(s==null||s("003",Ae.error003(f)),f="default");const d=e.nodeTypes[f]||e.nodeTypes.default,h=!!(l.draggable||t&&typeof l.draggable>"u"),y=!!(l.selectable||o&&typeof l.selectable>"u"),p=!!(l.connectable||n&&typeof l.connectable>"u"),w=!!(l.focusable||r&&typeof l.focusable>"u"),m=e.nodeExtent?vr(l.positionAbsolute,e.nodeExtent):l.positionAbsolute,_=(m==null?void 0:m.x)??0,$=(m==null?void 0:m.y)??0,v=ld({x:_,y:$,width:l.width??0,height:l.height??0,origin:e.nodeOrigin});return L.createElement(d,{key:l.id,id:l.id,className:l.className,style:l.style,type:f,data:l.data,sourcePosition:l.sourcePosition||j.Bottom,targetPosition:l.targetPosition||j.Top,hidden:l.hidden,xPos:_,yPos:$,xPosOrigin:v.x,yPosOrigin:v.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!l.selected,isDraggable:h,isSelectable:y,isConnectable:p,isFocusable:w,resizeObserver:u,dragHandle:l.dragHandle,zIndex:((M=l[re])==null?void 0:M.z)??0,isParent:!!((O=l[re])!=null&&O.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!l.width&&!!l.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:l.ariaLabel})}))};ys.displayName="NodeRenderer";var fd=b.memo(ys);const dd=(e,t,n)=>n===j.Left?e-t:n===j.Right?e+t:e,hd=(e,t,n)=>n===j.Top?e-t:n===j.Bottom?e+t:e,bo="react-flow__edgeupdater",_o=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:a})=>L.createElement("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:me([bo,`${bo}-${a}`]),cx:dd(t,r,e),cy:hd(n,r,e),r,stroke:"transparent",fill:"transparent"}),gd=()=>!0;var st=e=>{const t=({id:n,className:r,type:o,data:i,onClick:s,onEdgeDoubleClick:a,selected:c,animated:u,label:l,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:y,labelBgBorderRadius:p,style:w,source:m,target:_,sourceX:$,sourceY:v,targetX:M,targetY:O,sourcePosition:R,targetPosition:I,elementsSelectable:k,hidden:F,sourceHandleId:D,targetHandleId:z,onContextMenu:E,onMouseEnter:g,onMouseMove:S,onMouseLeave:C,edgeUpdaterRadius:T,onEdgeUpdate:P,onEdgeUpdateStart:x,onEdgeUpdateEnd:N,markerEnd:A,markerStart:V,rfId:B,ariaLabel:H,isFocusable:U,isUpdatable:Y,pathOptions:W,interactionWidth:q})=>{const ee=b.useRef(null),[te,ae]=b.useState(!1),[ye,Ce]=b.useState(!1),ne=oe(),Q=b.useMemo(()=>`url(#${sr(V,B)})`,[V,B]),ce=b.useMemo(()=>`url(#${sr(A,B)})`,[A,B]);if(F)return null;const fe=ie=>{var be;const{edges:de,addSelectedEdges:je,unselectNodesAndEdges:Ge,multiSelectionActive:Ue}=ne.getState(),Ne=de.find(Et=>Et.id===n);Ne&&(k&&(ne.setState({nodesSelectionActive:!1}),Ne.selected&&Ue?(Ge({nodes:[],edges:[Ne]}),(be=ee.current)==null||be.blur()):je([n])),s&&s(ie,Ne))},Z=Tt(n,ne.getState,a),Be=Tt(n,ne.getState,E),He=Tt(n,ne.getState,g),_t=Tt(n,ne.getState,S),et=Tt(n,ne.getState,C),ze=(ie,de)=>{if(ie.button!==0)return;const{edges:je,isValidConnection:Ge}=ne.getState(),Ue=de?_:m,Ne=(de?z:D)||null,be=de?"target":"source",Et=Ge||gd,Rn=de,Nt=je.find(Ze=>Ze.id===n);Ce(!0),x==null||x(ie,Nt,be);const Ln=Ze=>{Ce(!1),N==null||N(Ze,Nt,be)};Wi({event:ie,handleId:Ne,nodeId:Ue,onConnect:Ze=>P==null?void 0:P(Nt,Ze),isTarget:Rn,getState:ne.getState,setState:ne.setState,isValidConnection:Et,edgeUpdaterType:be,onEdgeUpdateEnd:Ln})},ke=ie=>ze(ie,!0),tt=ie=>ze(ie,!1),Ie=()=>ae(!0),Fe=()=>ae(!1),St=!k&&!s,nt=ie=>{var de;if(Li.includes(ie.key)&&k){const{unselectNodesAndEdges:je,addSelectedEdges:Ge,edges:Ue}=ne.getState();ie.key==="Escape"?((de=ee.current)==null||de.blur(),je({edges:[Ue.find(be=>be.id===n)]})):Ge([n])}};return L.createElement("g",{className:me(["react-flow__edge",`react-flow__edge-${o}`,r,{selected:c,animated:u,inactive:St,updating:te}]),onClick:fe,onDoubleClick:Z,onContextMenu:Be,onMouseEnter:He,onMouseMove:_t,onMouseLeave:et,onKeyDown:U?nt:void 0,tabIndex:U?0:void 0,role:U?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":H===null?void 0:H||`Edge from ${m} to ${_}`,"aria-describedby":U?`${os}-${B}`:void 0,ref:ee},!ye&&L.createElement(e,{id:n,source:m,target:_,selected:c,animated:u,label:l,labelStyle:f,labelShowBg:d,labelBgStyle:h,labelBgPadding:y,labelBgBorderRadius:p,data:i,style:w,sourceX:$,sourceY:v,targetX:M,targetY:O,sourcePosition:R,targetPosition:I,sourceHandleId:D,targetHandleId:z,markerStart:Q,markerEnd:ce,pathOptions:W,interactionWidth:q}),Y&&L.createElement(L.Fragment,null,(Y==="source"||Y===!0)&&L.createElement(_o,{position:R,centerX:$,centerY:v,radius:T,onMouseDown:ke,onMouseEnter:Ie,onMouseOut:Fe,type:"source"}),(Y==="target"||Y===!0)&&L.createElement(_o,{position:I,centerX:M,centerY:O,radius:T,onMouseDown:tt,onMouseEnter:Ie,onMouseOut:Fe,type:"target"})))};return t.displayName="EdgeWrapper",b.memo(t)};function pd(e){const t={default:st(e.default||vn),straight:st(e.bezier||br),step:st(e.step||Cr),smoothstep:st(e.step||Mn),simplebezier:st(e.simplebezier||wr)},n={},r=Object.keys(e).filter(o=>!["default","bezier"].includes(o)).reduce((o,i)=>(o[i]=st(e[i]||vn),o),n);return{...t,...r}}function So(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,o=((n==null?void 0:n.y)||0)+t.y,i=(n==null?void 0:n.width)||t.width,s=(n==null?void 0:n.height)||t.height;switch(e){case j.Top:return{x:r+i/2,y:o};case j.Right:return{x:r+i,y:o+s/2};case j.Bottom:return{x:r+i/2,y:o+s};case j.Left:return{x:r,y:o+s/2}}}function Eo(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const md=(e,t,n,r,o,i)=>{const s=So(n,e,t),a=So(i,r,o);return{sourceX:s.x,sourceY:s.y,targetX:a.x,targetY:a.y}};function yd({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:s,height:a,transform:c}){const u={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+o),y2:Math.max(e.y+r,t.y+i)};u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const l=xr({x:(0-c[0])/c[2],y:(0-c[1])/c[2],width:s/c[2],height:a/c[2]}),f=Math.max(0,Math.min(l.x2,u.x2)-Math.max(l.x,u.x)),d=Math.max(0,Math.min(l.y2,u.y2)-Math.max(l.y,u.y));return Math.ceil(f*d)>0}function No(e){var r,o,i,s,a;const t=((r=e==null?void 0:e[re])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.x)<"u"&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.y)<"u";return[{x:((s=e==null?void 0:e.positionAbsolute)==null?void 0:s.x)||0,y:((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const vd=[{level:0,isMaxLevel:!0,edges:[]}];function xd(e,t,n=!1){let r=-1;const o=e.reduce((s,a)=>{var l,f;const c=pe(a.zIndex);let u=c?a.zIndex:0;if(n){const d=t.get(a.target),h=t.get(a.source),y=a.selected||(d==null?void 0:d.selected)||(h==null?void 0:h.selected),p=Math.max(((l=h==null?void 0:h[re])==null?void 0:l.z)||0,((f=d==null?void 0:d[re])==null?void 0:f.z)||0,1e3);u=(c?a.zIndex:0)+(y?p:0)}return s[u]?s[u].push(a):s[u]=[a],r=u>r?u:r,s},{}),i=Object.entries(o).map(([s,a])=>{const c=+s;return{edges:a,level:c,isMaxLevel:c===r}});return i.length===0?vd:i}function wd(e,t,n){const r=J(b.useCallback(o=>e?o.edges.filter(i=>{const s=t.get(i.source),a=t.get(i.target);return(s==null?void 0:s.width)&&(s==null?void 0:s.height)&&(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&yd({sourcePos:s.positionAbsolute||{x:0,y:0},targetPos:a.positionAbsolute||{x:0,y:0},sourceWidth:s.width,sourceHeight:s.height,targetWidth:a.width,targetHeight:a.height,width:o.width,height:o.height,transform:o.transform})}):o.edges,[e,t]));return xd(r,t,n)}const Cd=({color:e="none",strokeWidth:t=1})=>L.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),bd=({color:e="none",strokeWidth:t=1})=>L.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),$o={[yn.Arrow]:Cd,[yn.ArrowClosed]:bd};function _d(e){const t=oe();return b.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call($o,e)?$o[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",Ae.error009(e)),null)},[e])}const Sd=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const c=_d(t);return c?L.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0"},L.createElement(c,{color:n,strokeWidth:s})):null},Ed=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((o,i)=>([i.markerStart,i.markerEnd].forEach(s=>{if(s&&typeof s=="object"){const a=sr(s,t);r.includes(a)||(o.push({id:a,color:s.color||e,...s}),r.push(a))}}),o),[]).sort((o,i)=>o.id.localeCompare(i.id))},vs=({defaultColor:e,rfId:t})=>{const n=J(b.useCallback(Ed({defaultColor:e,rfId:t}),[e,t]),(r,o)=>!(r.length!==o.length||r.some((i,s)=>i.id!==o[s].id)));return L.createElement("defs",null,n.map(r=>L.createElement(Sd,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};vs.displayName="MarkerDefinitions";var Nd=b.memo(vs);const $d=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),xs=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:o,noPanClassName:i,onEdgeUpdate:s,onEdgeContextMenu:a,onEdgeMouseEnter:c,onEdgeMouseMove:u,onEdgeMouseLeave:l,onEdgeClick:f,edgeUpdaterRadius:d,onEdgeDoubleClick:h,onEdgeUpdateStart:y,onEdgeUpdateEnd:p,children:w})=>{const{edgesFocusable:m,edgesUpdatable:_,elementsSelectable:$,width:v,height:M,connectionMode:O,nodeInternals:R,onError:I}=J($d,ue),k=wd(t,R,n);return v?L.createElement(L.Fragment,null,k.map(({level:F,edges:D,isMaxLevel:z})=>L.createElement("svg",{key:F,style:{zIndex:F},width:v,height:M,className:"react-flow__edges react-flow__container"},z&&L.createElement(Nd,{defaultColor:e,rfId:r}),L.createElement("g",null,D.map(E=>{const[g,S,C]=No(R.get(E.source)),[T,P,x]=No(R.get(E.target));if(!C||!x)return null;let N=E.type||"default";o[N]||(I==null||I("011",Ae.error011(N)),N="default");const A=o[N]||o.default,V=O===Qe.Strict?P.target:(P.target??[]).concat(P.source??[]),B=Eo(S.source,E.sourceHandle),H=Eo(V,E.targetHandle),U=(B==null?void 0:B.position)||j.Bottom,Y=(H==null?void 0:H.position)||j.Top,W=!!(E.focusable||m&&typeof E.focusable>"u"),q=typeof s<"u"&&(E.updatable||_&&typeof E.updatable>"u");if(!B||!H)return I==null||I("008",Ae.error008(B,E)),null;const{sourceX:ee,sourceY:te,targetX:ae,targetY:ye}=md(g,B,U,T,H,Y);return L.createElement(A,{key:E.id,id:E.id,className:me([E.className,i]),type:N,data:E.data,selected:!!E.selected,animated:!!E.animated,hidden:!!E.hidden,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,style:E.style,source:E.source,target:E.target,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerEnd:E.markerEnd,markerStart:E.markerStart,sourceX:ee,sourceY:te,targetX:ae,targetY:ye,sourcePosition:U,targetPosition:Y,elementsSelectable:$,onEdgeUpdate:s,onContextMenu:a,onMouseEnter:c,onMouseMove:u,onMouseLeave:l,onClick:f,edgeUpdaterRadius:d,onEdgeDoubleClick:h,onEdgeUpdateStart:y,onEdgeUpdateEnd:p,rfId:r,ariaLabel:E.ariaLabel,isFocusable:W,isUpdatable:q,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth})})))),w):null};xs.displayName="EdgeRenderer";var Md=b.memo(xs);const Td=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Ad({children:e}){const t=J(Td);return L.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function kd(e){const t=cs(),n=b.useRef(!1);b.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const Id={[j.Left]:j.Right,[j.Right]:j.Left,[j.Top]:j.Bottom,[j.Bottom]:j.Top},ws=({nodeId:e,handleType:t,style:n,type:r=Le.Bezier,CustomComponent:o,connectionStatus:i})=>{var O,R,I;const{fromNode:s,handleId:a,toX:c,toY:u,connectionMode:l}=J(b.useCallback(k=>({fromNode:k.nodeInternals.get(e),handleId:k.connectionHandleId,toX:(k.connectionPosition.x-k.transform[0])/k.transform[2],toY:(k.connectionPosition.y-k.transform[1])/k.transform[2],connectionMode:k.connectionMode}),[e]),ue),f=(O=s==null?void 0:s[re])==null?void 0:O.handleBounds;let d=f==null?void 0:f[t];if(l===Qe.Loose&&(d=d||(f==null?void 0:f[t==="source"?"target":"source"])),!s||!d)return null;const h=a?d.find(k=>k.id===a):d[0],y=h?h.x+h.width/2:(s.width??0)/2,p=h?h.y+h.height/2:s.height??0,w=(((R=s.positionAbsolute)==null?void 0:R.x)??0)+y,m=(((I=s.positionAbsolute)==null?void 0:I.y)??0)+p,_=h==null?void 0:h.position,$=_?Id[_]:null;if(!_||!$)return null;if(o)return L.createElement(o,{connectionLineType:r,connectionLineStyle:n,fromNode:s,fromHandle:h,fromX:w,fromY:m,toX:c,toY:u,fromPosition:_,toPosition:$,connectionStatus:i});let v="";const M={sourceX:w,sourceY:m,sourcePosition:_,targetX:c,targetY:u,targetPosition:$};return r===Le.Bezier?[v]=zi(M):r===Le.Step?[v]=ir({...M,borderRadius:0}):r===Le.SmoothStep?[v]=ir(M):r===Le.SimpleBezier?[v]=Hi(M):v=`M${w},${m} ${c},${u}`,L.createElement("path",{d:v,fill:"none",className:"react-flow__connection-path",style:n})};ws.displayName="ConnectionLine";const Pd=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Od({containerStyle:e,style:t,type:n,component:r}){const{nodeId:o,handleType:i,nodesConnectable:s,width:a,height:c,connectionStatus:u}=J(Pd,ue);return!(o&&i&&a&&s)?null:L.createElement("svg",{style:e,width:a,height:c,className:"react-flow__edges react-flow__connectionline react-flow__container"},L.createElement("g",{className:me(["react-flow__connection",u])},L.createElement(ws,{nodeId:o,handleType:i,style:t,type:n,CustomComponent:r,connectionStatus:u})))}function Mo(e,t){return b.useRef(null),oe(),b.useMemo(()=>t(e),[e])}const Cs=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:o,onInit:i,onNodeClick:s,onEdgeClick:a,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:l,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:h,onSelectionContextMenu:y,onSelectionStart:p,onSelectionEnd:w,connectionLineType:m,connectionLineStyle:_,connectionLineComponent:$,connectionLineContainerStyle:v,selectionKeyCode:M,selectionOnDrag:O,selectionMode:R,multiSelectionKeyCode:I,panActivationKeyCode:k,zoomActivationKeyCode:F,deleteKeyCode:D,onlyRenderVisibleElements:z,elementsSelectable:E,selectNodesOnDrag:g,defaultViewport:S,translateExtent:C,minZoom:T,maxZoom:P,preventScrolling:x,defaultMarkerColor:N,zoomOnScroll:A,zoomOnPinch:V,panOnScroll:B,panOnScrollSpeed:H,panOnScrollMode:U,zoomOnDoubleClick:Y,panOnDrag:W,onPaneClick:q,onPaneMouseEnter:ee,onPaneMouseMove:te,onPaneMouseLeave:ae,onPaneScroll:ye,onPaneContextMenu:Ce,onEdgeUpdate:ne,onEdgeContextMenu:Q,onEdgeMouseEnter:ce,onEdgeMouseMove:fe,onEdgeMouseLeave:Z,edgeUpdaterRadius:Be,onEdgeUpdateStart:He,onEdgeUpdateEnd:_t,noDragClassName:et,noWheelClassName:ze,noPanClassName:ke,elevateEdgesOnSelect:tt,disableKeyboardA11y:Ie,nodeOrigin:Fe,nodeExtent:St,rfId:nt})=>{const ie=Mo(e,cd),de=Mo(t,pd);return kd(i),L.createElement(sd,{onPaneClick:q,onPaneMouseEnter:ee,onPaneMouseMove:te,onPaneMouseLeave:ae,onPaneContextMenu:Ce,onPaneScroll:ye,deleteKeyCode:D,selectionKeyCode:M,selectionOnDrag:O,selectionMode:R,onSelectionStart:p,onSelectionEnd:w,multiSelectionKeyCode:I,panActivationKeyCode:k,zoomActivationKeyCode:F,elementsSelectable:E,onMove:n,onMoveStart:r,onMoveEnd:o,zoomOnScroll:A,zoomOnPinch:V,zoomOnDoubleClick:Y,panOnScroll:B,panOnScrollSpeed:H,panOnScrollMode:U,panOnDrag:W,defaultViewport:S,translateExtent:C,minZoom:T,maxZoom:P,onSelectionContextMenu:y,preventScrolling:x,noDragClassName:et,noWheelClassName:ze,noPanClassName:ke,disableKeyboardA11y:Ie},L.createElement(Ad,null,L.createElement(Md,{edgeTypes:de,onEdgeClick:a,onEdgeDoubleClick:u,onEdgeUpdate:ne,onlyRenderVisibleElements:z,onEdgeContextMenu:Q,onEdgeMouseEnter:ce,onEdgeMouseMove:fe,onEdgeMouseLeave:Z,onEdgeUpdateStart:He,onEdgeUpdateEnd:_t,edgeUpdaterRadius:Be,defaultMarkerColor:N,noPanClassName:ke,elevateEdgesOnSelect:!!tt,disableKeyboardA11y:Ie,rfId:nt},L.createElement(Od,{style:_,type:m,component:$,containerStyle:v})),L.createElement("div",{className:"react-flow__edgelabel-renderer"}),L.createElement(fd,{nodeTypes:ie,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:l,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:h,selectNodesOnDrag:g,onlyRenderVisibleElements:z,noPanClassName:ke,noDragClassName:et,disableKeyboardA11y:Ie,nodeOrigin:Fe,nodeExtent:St,rfId:nt})))};Cs.displayName="GraphView";var Rd=b.memo(Cs);const ur=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Pe={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:ur,nodeExtent:ur,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Qe.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:uf,isValidConnection:void 0},Ld=()=>Cc((e,t)=>({...Pe,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:Gn(n,r,o,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(o=>({...r,...o}))})},setDefaultNodesAndEdges:(n,r)=>{const o=typeof n<"u",i=typeof r<"u",s=o?Gn(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:s,edges:i?r:[],hasDefaultNodes:o,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,fitViewOnInit:i,fitViewOnInitDone:s,fitViewOnInitOptions:a,domNode:c,nodeOrigin:u}=t(),l=c==null?void 0:c.querySelector(".react-flow__viewport");if(!l)return;const f=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(f.transform),h=n.reduce((p,w)=>{const m=o.get(w.id);if(m){const _=yr(w.nodeElement);!!(_.width&&_.height&&(m.width!==_.width||m.height!==_.height||w.forceUpdate))&&(o.set(m.id,{...m,[re]:{...m[re],handleBounds:{source:Co(".source",w.nodeElement,d,u),target:Co(".target",w.nodeElement,d,u)}},..._}),p.push({id:m.id,type:"dimensions",dimensions:_}))}return p},[]);ss(o,u);const y=s||i&&!s&&as(t,{initial:!0,...a});e({nodeInternals:new Map(o),fitViewOnInitDone:y}),(h==null?void 0:h.length)>0&&(r==null||r(h))},updateNodePositions:(n,r=!0,o=!1)=>{const{triggerNodeChanges:i}=t(),s=n.map(a=>{const c={id:a.id,type:"position",dragging:o};return r&&(c.positionAbsolute=a.positionAbsolute,c.position=a.position),c});i(s)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:i,nodeOrigin:s,getNodes:a,elevateNodesOnSelect:c}=t();if(n!=null&&n.length){if(i){const u=us(n,a()),l=Gn(u,o,s,c);e({nodeInternals:l})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,a=null;r?s=n.map(c=>Re(c,!0)):(s=ct(i(),n),a=ct(o,[])),tn({changedNodes:s,changedEdges:a,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let s,a=null;r?s=n.map(c=>Re(c,!0)):(s=ct(o,n),a=ct(i(),[])),tn({changedNodes:a,changedEdges:s,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:i}=t(),s=n||i(),a=r||o,c=s.map(l=>(l.selected=!1,Re(l.id,!1))),u=a.map(l=>Re(l.id,!1));tn({changedNodes:c,changedEdges:u,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:o}=t();r==null||r.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:o}=t();r==null||r.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),i=r().filter(a=>a.selected).map(a=>Re(a.id,!1)),s=n.filter(a=>a.selected).map(a=>Re(a.id,!1));tn({changedNodes:i,changedEdges:s,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(o=>{o.positionAbsolute=vr(o.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:o,height:i,d3Zoom:s,d3Selection:a,translateExtent:c}=t();if(!s||!a||!n.x&&!n.y)return!1;const u=De.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),l=[[0,0],[o,i]],f=s==null?void 0:s.constrain()(u,l,c);return s.transform(a,f),r[0]!==f.x||r[1]!==f.y||r[2]!==f.k},cancelConnection:()=>e({connectionNodeId:Pe.connectionNodeId,connectionHandleId:Pe.connectionHandleId,connectionHandleType:Pe.connectionHandleType,connectionStatus:Pe.connectionStatus,connectionStartHandle:Pe.connectionStartHandle,connectionEndHandle:Pe.connectionEndHandle}),reset:()=>e({...Pe})}),Object.is),bs=({children:e})=>{const t=b.useRef(null);return t.current||(t.current=Ld()),L.createElement(ef,{value:t.current},e)};bs.displayName="ReactFlowProvider";const _s=({children:e})=>b.useContext($n)?L.createElement(L.Fragment,null,e):L.createElement(bs,null,e);_s.displayName="ReactFlowWrapper";const Dd={input:Ji,default:cr,output:ts,group:Nr},Vd={default:vn,straight:br,step:Cr,smoothstep:Mn,simplebezier:wr},Bd=[0,0],Hd=[15,15],zd={x:0,y:0,zoom:1},Fd={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},jd=b.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i=Dd,edgeTypes:s=Vd,onNodeClick:a,onEdgeClick:c,onInit:u,onMove:l,onMoveStart:f,onMoveEnd:d,onConnect:h,onConnectStart:y,onConnectEnd:p,onClickConnectStart:w,onClickConnectEnd:m,onNodeMouseEnter:_,onNodeMouseMove:$,onNodeMouseLeave:v,onNodeContextMenu:M,onNodeDoubleClick:O,onNodeDragStart:R,onNodeDrag:I,onNodeDragStop:k,onNodesDelete:F,onEdgesDelete:D,onSelectionChange:z,onSelectionDragStart:E,onSelectionDrag:g,onSelectionDragStop:S,onSelectionContextMenu:C,onSelectionStart:T,onSelectionEnd:P,connectionMode:x=Qe.Strict,connectionLineType:N=Le.Bezier,connectionLineStyle:A,connectionLineComponent:V,connectionLineContainerStyle:B,deleteKeyCode:H="Backspace",selectionKeyCode:U="Shift",selectionOnDrag:Y=!1,selectionMode:W=zt.Full,panActivationKeyCode:q="Space",multiSelectionKeyCode:ee=mn()?"Meta":"Control",zoomActivationKeyCode:te=mn()?"Meta":"Control",snapToGrid:ae=!1,snapGrid:ye=Hd,onlyRenderVisibleElements:Ce=!1,selectNodesOnDrag:ne=!0,nodesDraggable:Q,nodesConnectable:ce,nodesFocusable:fe,nodeOrigin:Z=Bd,edgesFocusable:Be,edgesUpdatable:He,elementsSelectable:_t,defaultViewport:et=zd,minZoom:ze=.5,maxZoom:ke=2,translateExtent:tt=ur,preventScrolling:Ie=!0,nodeExtent:Fe,defaultMarkerColor:St="#b1b1b7",zoomOnScroll:nt=!0,zoomOnPinch:ie=!0,panOnScroll:de=!1,panOnScrollSpeed:je=.5,panOnScrollMode:Ge=We.Free,zoomOnDoubleClick:Ue=!0,panOnDrag:Ne=!0,onPaneClick:be,onPaneMouseEnter:Et,onPaneMouseMove:Rn,onPaneMouseLeave:Nt,onPaneScroll:Ln,onPaneContextMenu:Or,children:Ze,onEdgeUpdate:Ys,onEdgeContextMenu:Xs,onEdgeDoubleClick:Ws,onEdgeMouseEnter:qs,onEdgeMouseMove:Ks,onEdgeMouseLeave:Qs,onEdgeUpdateStart:Js,onEdgeUpdateEnd:ea,edgeUpdaterRadius:ta=10,onNodesChange:na,onEdgesChange:ra,noDragClassName:oa="nodrag",noWheelClassName:ia="nowheel",noPanClassName:Rr="nopan",fitView:sa=!1,fitViewOptions:aa,connectOnClick:ca=!0,attributionPosition:la,proOptions:ua,defaultEdgeOptions:fa,elevateNodesOnSelect:da=!0,elevateEdgesOnSelect:ha=!1,disableKeyboardA11y:Lr=!1,autoPanOnConnect:ga=!0,autoPanOnNodeDrag:pa=!0,connectionRadius:ma=20,isValidConnection:ya,onError:va,style:xa,id:Dr,nodeDragThreshold:wa,...Ca},ba)=>{const Dn=Dr||"1";return L.createElement("div",{...Ca,style:{...xa,...Fd},ref:ba,className:me(["react-flow",o]),"data-testid":"rf__wrapper",id:Dr},L.createElement(_s,null,L.createElement(Rd,{onInit:u,onMove:l,onMoveStart:f,onMoveEnd:d,onNodeClick:a,onEdgeClick:c,onNodeMouseEnter:_,onNodeMouseMove:$,onNodeMouseLeave:v,onNodeContextMenu:M,onNodeDoubleClick:O,nodeTypes:i,edgeTypes:s,connectionLineType:N,connectionLineStyle:A,connectionLineComponent:V,connectionLineContainerStyle:B,selectionKeyCode:U,selectionOnDrag:Y,selectionMode:W,deleteKeyCode:H,multiSelectionKeyCode:ee,panActivationKeyCode:q,zoomActivationKeyCode:te,onlyRenderVisibleElements:Ce,selectNodesOnDrag:ne,defaultViewport:et,translateExtent:tt,minZoom:ze,maxZoom:ke,preventScrolling:Ie,zoomOnScroll:nt,zoomOnPinch:ie,zoomOnDoubleClick:Ue,panOnScroll:de,panOnScrollSpeed:je,panOnScrollMode:Ge,panOnDrag:Ne,onPaneClick:be,onPaneMouseEnter:Et,onPaneMouseMove:Rn,onPaneMouseLeave:Nt,onPaneScroll:Ln,onPaneContextMenu:Or,onSelectionContextMenu:C,onSelectionStart:T,onSelectionEnd:P,onEdgeUpdate:Ys,onEdgeContextMenu:Xs,onEdgeDoubleClick:Ws,onEdgeMouseEnter:qs,onEdgeMouseMove:Ks,onEdgeMouseLeave:Qs,onEdgeUpdateStart:Js,onEdgeUpdateEnd:ea,edgeUpdaterRadius:ta,defaultMarkerColor:St,noDragClassName:oa,noWheelClassName:ia,noPanClassName:Rr,elevateEdgesOnSelect:ha,rfId:Dn,disableKeyboardA11y:Lr,nodeOrigin:Z,nodeExtent:Fe}),L.createElement(If,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:h,onConnectStart:y,onConnectEnd:p,onClickConnectStart:w,onClickConnectEnd:m,nodesDraggable:Q,nodesConnectable:ce,nodesFocusable:fe,edgesFocusable:Be,edgesUpdatable:He,elementsSelectable:_t,elevateNodesOnSelect:da,minZoom:ze,maxZoom:ke,nodeExtent:Fe,onNodesChange:na,onEdgesChange:ra,snapToGrid:ae,snapGrid:ye,connectionMode:x,translateExtent:tt,connectOnClick:ca,defaultEdgeOptions:fa,fitView:sa,fitViewOptions:aa,onNodesDelete:F,onEdgesDelete:D,onNodeDragStart:R,onNodeDrag:I,onNodeDragStop:k,onSelectionDrag:g,onSelectionDragStart:E,onSelectionDragStop:S,noPanClassName:Rr,nodeOrigin:Z,rfId:Dn,autoPanOnConnect:ga,autoPanOnNodeDrag:pa,onError:va,connectionRadius:ma,isValidConnection:ya,nodeDragThreshold:wa}),L.createElement(Af,{onSelectionChange:z}),Ze,L.createElement(rf,{proOptions:ua,position:la}),L.createElement(Df,{rfId:Dn,disableKeyboardA11y:Lr})))});jd.displayName="ReactFlow";function I7(){const e=oe();return b.useCallback(t=>{const{domNode:n,updateNodeDimensions:r}=e.getState(),i=(Array.isArray(t)?t:[t]).reduce((s,a)=>{const c=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${a}"]`);return c&&s.push({id:a,nodeElement:c,forceUpdate:!0}),s},[]);requestAnimationFrame(()=>r(i))},[])}const Gd=e=>t=>t.nodeInternals.size===0?!1:t.getNodes().filter(n=>e.includeHiddenNodes?!0:!n.hidden).every(n=>{var r;return((r=n[re])==null?void 0:r.handleBounds)!==void 0}),Ud={includeHiddenNodes:!1};function P7(e=Ud){return J(Gd(e))}let Mr="";const Zd=e=>Mr=e,Ss=()=>Mr,Es=()=>`https://huggingface.co/${Tr}/raw/main/.integrity`,O7=()=>`${Ss()}/store/v1`;let rn=null;const R7=async e=>{if(!rn){if(e){const r=await fetch(`${Mr}/users.json`);if(!r.ok)return console.error(`Failed to fetch users. Status: ${r.status}`),null;rn=(await r.json()).results}const t=await fetch(`${Es()}/users.json`);if(!t.ok)return console.error(`Failed to fetch users. Status: ${t.status}`),null;rn=(await t.json()).results}return rn},L7=async e=>{e.startsWith("/")&&(e=e.slice(1));const t=`${Es()}/${e}`;return await fetch(t,{})},D7=async e=>e.endsWith(".node")||e.endsWith(".governance")?await fetch(e):(Zd(e),e.endsWith("integrity.json")||(e=`${Ss()}/integrity.json`),await fetch(e));let Tr="";const V7=e=>Tr=e,B7=()=>Tr,Yd=({className:e})=>G.jsx("svg",{className:`${e}`,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:G.jsx("path",{d:"M7 6.41667C8.45833 6.41667 9.69792 6.18819 10.7188 5.73125C11.7396 5.27431 12.25 4.725 12.25 4.08333C12.25 3.44167 11.7396 2.89236 10.7188 2.43542C9.69792 1.97847 8.45833 1.75 7 1.75C5.54167 1.75 4.30208 1.97847 3.28125 2.43542C2.26042 2.89236 1.75 3.44167 1.75 4.08333C1.75 4.725 2.26042 5.27431 3.28125 5.73125C4.30208 6.18819 5.54167 6.41667 7 6.41667ZM7 7.875C7.39861 7.875 7.89688 7.83368 8.49479 7.75104C9.09271 7.6684 9.66875 7.53472 10.2229 7.35C10.7771 7.16528 11.2535 6.92465 11.6521 6.62813C12.0507 6.3316 12.25 5.96944 12.25 5.54167V7C12.25 7.42778 12.0507 7.78993 11.6521 8.08646C11.2535 8.38299 10.7771 8.62361 10.2229 8.80833C9.66875 8.99306 9.09271 9.12674 8.49479 9.20938C7.89688 9.29201 7.39861 9.33333 7 9.33333C6.60139 9.33333 6.10313 9.29201 5.50521 9.20938C4.90729 9.12674 4.33125 8.99306 3.77708 8.80833C3.22292 8.62361 2.74653 8.38299 2.34792 8.08646C1.94931 7.78993 1.75 7.42778 1.75 7V5.54167C1.75 5.96944 1.94931 6.3316 2.34792 6.62813C2.74653 6.92465 3.22292 7.16528 3.77708 7.35C4.33125 7.53472 4.90729 7.6684 5.50521 7.75104C6.10313 7.83368 6.60139 7.875 7 7.875ZM7 10.7917C7.39861 10.7917 7.89688 10.7503 8.49479 10.6677C9.09271 10.5851 9.66875 10.4514 10.2229 10.2667C10.7771 10.0819 11.2535 9.84132 11.6521 9.54479C12.0507 9.24826 12.25 8.88611 12.25 8.45833V9.91667C12.25 10.3444 12.0507 10.7066 11.6521 11.0031C11.2535 11.2997 10.7771 11.5403 10.2229 11.725C9.66875 11.9097 9.09271 12.0434 8.49479 12.126C7.89688 12.2087 7.39861 12.25 7 12.25C6.60139 12.25 6.10313 12.2087 5.50521 12.126C4.90729 12.0434 4.33125 11.9097 3.77708 11.725C3.22292 11.5403 2.74653 11.2997 2.34792 11.0031C1.94931 10.7066 1.75 10.3444 1.75 9.91667V8.45833C1.75 8.88611 1.94931 9.24826 2.34792 9.54479C2.74653 9.84132 3.22292 10.0819 3.77708 10.2667C4.33125 10.4514 4.90729 10.5851 5.50521 10.6677C6.10313 10.7503 6.60139 10.7917 7 10.7917Z",fill:"black"})}),Xd=({className:e})=>G.jsx("svg",{className:`${e} w-14 h-14`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14",fill:"none",children:G.jsx("path",{d:"M6.41667 12.6729L2.33333 10.325C2.14861 10.2181 2.00521 10.0771 1.90313 9.90208C1.80104 9.72708 1.75 9.53264 1.75 9.31875V4.68125C1.75 4.46736 1.80104 4.27291 1.90313 4.09791C2.00521 3.92291 2.14861 3.78194 2.33333 3.675L6.41667 1.32708C6.60139 1.22014 6.79583 1.16666 7 1.16666C7.20417 1.16666 7.39861 1.22014 7.58333 1.32708L11.6667 3.675C11.8514 3.78194 11.9948 3.92291 12.0969 4.09791C12.199 4.27291 12.25 4.46736 12.25 4.68125V9.31875C12.25 9.53264 12.199 9.72708 12.0969 9.90208C11.9948 10.0771 11.8514 10.2181 11.6667 10.325L7.58333 12.6729C7.39861 12.7799 7.20417 12.8333 7 12.8333C6.79583 12.8333 6.60139 12.7799 6.41667 12.6729ZM6.41667 7.33541V11.3312L7 11.6667L7.58333 11.3312V7.33541L11.0833 5.30833V4.69583L10.4563 4.33125L7 6.32916L3.54375 4.33125L2.91667 4.69583V5.30833L6.41667 7.33541Z",fill:"black"})}),Wd=({className:e})=>G.jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14",fill:"none",children:G.jsx("path",{d:"M3.49999 12.8333C3.17916 12.8333 2.90451 12.7191 2.67604 12.4906C2.44756 12.2622 2.33333 11.9875 2.33333 11.6667V2.33333C2.33333 2.0125 2.44756 1.73785 2.67604 1.50938C2.90451 1.2809 3.17916 1.16667 3.49999 1.16667H7.68541C7.84097 1.16667 7.98923 1.19583 8.1302 1.25417C8.27117 1.3125 8.39513 1.39514 8.50208 1.50208L11.3312 4.33125C11.4382 4.4382 11.5208 4.56215 11.5792 4.70313C11.6375 4.8441 11.6667 4.99236 11.6667 5.14792V11.6667C11.6667 11.9875 11.5524 12.2622 11.324 12.4906C11.0955 12.7191 10.8208 12.8333 10.5 12.8333H3.49999ZM7.58333 4.66667C7.58333 4.83195 7.63923 4.97049 7.75104 5.08229C7.86284 5.1941 8.00138 5.25 8.16666 5.25H10.5L7.58333 2.33333V4.66667Z",fill:"black"})}),qd=({className:e})=>G.jsx("svg",{className:`${e} `,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 11 11",children:G.jsx("path",{d:"M3.75 6.66667V4.33333C3.75 4.16806 3.8059 4.02951 3.91771 3.91771C4.02951 3.8059 4.16806 3.75 4.33333 3.75H6.66667C6.83194 3.75 6.97049 3.8059 7.08229 3.91771C7.1941 4.02951 7.25 4.16806 7.25 4.33333V6.66667C7.25 6.83194 7.1941 6.97049 7.08229 7.08229C6.97049 7.1941 6.83194 7.25 6.66667 7.25H4.33333C4.16806 7.25 4.02951 7.1941 3.91771 7.08229C3.8059 6.97049 3.75 6.83194 3.75 6.66667ZM3.75 10.1667V9.58333H2.58333C2.2625 9.58333 1.98785 9.4691 1.75937 9.24063C1.5309 9.01215 1.41667 8.7375 1.41667 8.41667V7.25H0.833333C0.668056 7.25 0.529514 7.1941 0.417708 7.08229C0.305903 6.97049 0.25 6.83194 0.25 6.66667C0.25 6.50139 0.305903 6.36285 0.417708 6.25104C0.529514 6.13924 0.668056 6.08333 0.833333 6.08333H1.41667V4.91667H0.833333C0.668056 4.91667 0.529514 4.86076 0.417708 4.74896C0.305903 4.63715 0.25 4.49861 0.25 4.33333C0.25 4.16806 0.305903 4.02951 0.417708 3.91771C0.529514 3.8059 0.668056 3.75 0.833333 3.75H1.41667V2.58333C1.41667 2.2625 1.5309 1.98785 1.75937 1.75937C1.98785 1.5309 2.2625 1.41667 2.58333 1.41667H3.75V0.833333C3.75 0.668056 3.8059 0.529514 3.91771 0.417708C4.02951 0.305903 4.16806 0.25 4.33333 0.25C4.49861 0.25 4.63715 0.305903 4.74896 0.417708C4.86076 0.529514 4.91667 0.668056 4.91667 0.833333V1.41667H6.08333V0.833333C6.08333 0.668056 6.13924 0.529514 6.25104 0.417708C6.36285 0.305903 6.50139 0.25 6.66667 0.25C6.83194 0.25 6.97049 0.305903 7.08229 0.417708C7.1941 0.529514 7.25 0.668056 7.25 0.833333V1.41667H8.41667C8.7375 1.41667 9.01215 1.5309 9.24063 1.75937C9.4691 1.98785 9.58333 2.2625 9.58333 2.58333V3.75H10.1667C10.3319 3.75 10.4705 3.8059 10.5823 3.91771C10.6941 4.02951 10.75 4.16806 10.75 4.33333C10.75 4.49861 10.6941 4.63715 10.5823 4.74896C10.4705 4.86076 10.3319 4.91667 10.1667 4.91667H9.58333V6.08333H10.1667C10.3319 6.08333 10.4705 6.13924 10.5823 6.25104C10.6941 6.36285 10.75 6.50139 10.75 6.66667C10.75 6.83194 10.6941 6.97049 10.5823 7.08229C10.4705 7.1941 10.3319 7.25 10.1667 7.25H9.58333V8.41667C9.58333 8.7375 9.4691 9.01215 9.24063 9.24063C9.01215 9.4691 8.7375 9.58333 8.41667 9.58333H7.25V10.1667C7.25 10.3319 7.1941 10.4705 7.08229 10.5823C6.97049 10.6941 6.83194 10.75 6.66667 10.75C6.50139 10.75 6.36285 10.6941 6.25104 10.5823C6.13924 10.4705 6.08333 10.3319 6.08333 10.1667V9.58333H4.91667V10.1667C4.91667 10.3319 4.86076 10.4705 4.74896 10.5823C4.63715 10.6941 4.49861 10.75 4.33333 10.75C4.16806 10.75 4.02951 10.6941 3.91771 10.5823C3.8059 10.4705 3.75 10.3319 3.75 10.1667ZM8.41667 8.41667V2.58333H2.58333V8.41667H8.41667Z",fill:"black"})}),Kd=({className:e})=>G.jsx("svg",{className:`${e}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14",fill:"none",children:G.jsx("path",{d:"M3.90834 11.2583L4.75417 12.6875C4.83195 12.8139 4.93889 12.899 5.075 12.9427C5.21111 12.9865 5.34722 12.9792 5.48334 12.9208L7 12.2792L8.51667 12.9208C8.65278 12.9792 8.78889 12.9865 8.925 12.9427C9.06111 12.899 9.16806 12.8139 9.24584 12.6875L10.0917 11.2583L11.6958 10.9083C11.8417 10.8792 11.9583 10.8038 12.0458 10.6823C12.1333 10.5608 12.1674 10.4271 12.1479 10.2812L11.9875 8.63333L13.0813 7.37916C13.1785 7.27221 13.2271 7.14583 13.2271 6.99999C13.2271 6.85416 13.1785 6.72777 13.0813 6.62083L11.9875 5.36666L12.1479 3.71874C12.1674 3.57291 12.1333 3.43923 12.0458 3.3177C11.9583 3.19617 11.8417 3.12083 11.6958 3.09166L10.0917 2.74166L9.24584 1.31249C9.16806 1.1861 9.06111 1.10103 8.925 1.05728C8.78889 1.01353 8.65278 1.02083 8.51667 1.07916L7 1.72083L5.48334 1.07916C5.34722 1.02083 5.21111 1.01353 5.075 1.05728C4.93889 1.10103 4.83195 1.1861 4.75417 1.31249L3.90834 2.74166L2.30417 3.09166C2.15834 3.12083 2.04167 3.19617 1.95417 3.3177C1.86667 3.43923 1.83264 3.57291 1.85209 3.71874L2.0125 5.36666L0.918752 6.62083C0.82153 6.72777 0.772919 6.85416 0.772919 6.99999C0.772919 7.14583 0.82153 7.27221 0.918752 7.37916L2.0125 8.63333L1.85209 10.2812C1.83264 10.4271 1.86667 10.5608 1.95417 10.6823C2.04167 10.8038 2.15834 10.8792 2.30417 10.9083L3.90834 11.2583Z",fill:"black"})}),Qd=({className:e})=>G.jsx("svg",{className:e,viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:G.jsx("path",{d:"M7.47254 9.26664C7.75031 9.54442 8.10031 9.67498 8.52254 9.65831C8.94476 9.64164 9.25031 9.48887 9.4392 9.19998L12.2559 4.98331C12.3559 4.82775 12.342 4.68609 12.2142 4.55831C12.0864 4.43053 11.9448 4.41664 11.7892 4.51664L7.57254 7.33331C7.28365 7.53331 7.12531 7.83609 7.09754 8.24164C7.06976 8.6472 7.19476 8.98887 7.47254 9.26664ZM3.90587 12.2666C3.66142 12.2666 3.43642 12.2139 3.23087 12.1083C3.02531 12.0028 2.86142 11.8444 2.7392 11.6333C2.45031 11.1111 2.22809 10.5694 2.07254 10.0083C1.91698 9.4472 1.8392 8.86664 1.8392 8.26664C1.8392 7.34442 2.0142 6.47775 2.3642 5.66664C2.7142 4.85553 3.1892 4.14998 3.7892 3.54998C4.3892 2.94998 5.09476 2.47498 5.90587 2.12498C6.71698 1.77498 7.58365 1.59998 8.50587 1.59998C9.41698 1.59998 10.2725 1.7722 11.0725 2.11664C11.8725 2.46109 12.5725 2.93053 13.1725 3.52498C13.7725 4.11942 14.2503 4.81386 14.6059 5.60831C14.9614 6.40275 15.1448 7.25553 15.1559 8.16664C15.167 8.77775 15.0975 9.37498 14.9475 9.95831C14.7975 10.5416 14.567 11.1 14.2559 11.6333C14.1336 11.8444 13.9698 12.0028 13.7642 12.1083C13.5586 12.2139 13.3336 12.2666 13.0892 12.2666H3.90587Z",fill:"white"})}),Jd=({className:e})=>G.jsxs("svg",{className:`${e}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14",fill:"none",children:[G.jsx("path",{d:"M5.68451 8.71817C5.91785 8.9515 6.21185 9.06117 6.56652 9.04717C6.92118 9.03317 7.17785 8.90483 7.33652 8.66217L9.70252 5.12017C9.78652 4.9895 9.77485 4.8705 9.66752 4.76317C9.56018 4.65583 9.44118 4.64417 9.31052 4.72817L5.76852 7.09417C5.52585 7.26217 5.39285 7.5165 5.36952 7.85717C5.34618 8.19783 5.45118 8.48483 5.68451 8.71817ZM2.68851 11.2382C2.48318 11.2382 2.29418 11.1938 2.12151 11.1052C1.94885 11.0165 1.81118 10.8835 1.70851 10.7062C1.46585 10.2675 1.27918 9.8125 1.14851 9.34117C1.01785 8.86983 0.952515 8.38217 0.952515 7.87817C0.952515 7.1035 1.09951 6.3755 1.39351 5.69417C1.68751 5.01283 2.08651 4.42017 2.59051 3.91617C3.09451 3.41217 3.68718 3.01317 4.36852 2.71917C5.04985 2.42517 5.77785 2.27817 6.55252 2.27817C7.31785 2.27817 8.03652 2.42283 8.70852 2.71217C9.38052 3.0015 9.96852 3.39583 10.4725 3.89517C10.9765 4.3945 11.3778 4.97783 11.6765 5.64517C11.9752 6.3125 12.1292 7.02883 12.1385 7.79417C12.1478 8.3075 12.0895 8.80917 11.9635 9.29917C11.8375 9.78917 11.6438 10.2582 11.3825 10.7062C11.2798 10.8835 11.1422 11.0165 10.9695 11.1052C10.7968 11.1938 10.6078 11.2382 10.4025 11.2382H2.68851Z",fill:"black"}),G.jsx("path",{d:"M11.6175 6.47817H13.5288V11.7218H9.24592V8.84977C9.24592 8.19363 9.47715 7.63433 9.93961 7.17186C10.4021 6.7094 10.9614 6.47817 11.6175 6.47817Z",fill:"white"}),G.jsx("path",{d:"M10.6689 11.2214C10.5345 11.2214 10.4218 11.1759 10.3309 11.085C10.24 10.9941 10.1946 10.8814 10.1946 10.7471V9.32409C10.1946 9.1897 10.24 9.07705 10.3309 8.98614C10.4218 8.89523 10.5345 8.84977 10.6689 8.84977V8.37545C10.6689 8.11458 10.7618 7.89125 10.9475 7.70547C11.1333 7.5197 11.3566 7.42681 11.6175 7.42681C11.8784 7.42681 12.1017 7.5197 12.2875 7.70547C12.4733 7.89125 12.5662 8.11458 12.5662 8.37545V8.84977C12.7005 8.84977 12.8132 8.89523 12.9041 8.98614C12.995 9.07705 13.0405 9.1897 13.0405 9.32409V10.7471C13.0405 10.8814 12.995 10.9941 12.9041 11.085C12.8132 11.1759 12.7005 11.2214 12.5662 11.2214H10.6689ZM11.1432 8.84977H12.0918V8.37545C12.0918 8.24106 12.0464 8.12841 11.9555 8.0375C11.8646 7.94659 11.7519 7.90113 11.6175 7.90113C11.4831 7.90113 11.3705 7.94659 11.2796 8.0375C11.1887 8.12841 11.1432 8.24106 11.1432 8.37545V8.84977Z",fill:"black"})]}),e0=({className:e})=>G.jsx("svg",{className:`${e}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14",fill:"none",children:G.jsx("path",{d:"M6.99999 7.58333C6.51388 7.58333 6.10069 7.41319 5.76041 7.07291C5.42013 6.73264 5.24999 6.31944 5.24999 5.83333C5.24999 5.34722 5.42013 4.93403 5.76041 4.59375C6.10069 4.25347 6.51388 4.08333 6.99999 4.08333C7.48611 4.08333 7.8993 4.25347 8.23958 4.59375C8.57986 4.93403 8.74999 5.34722 8.74999 5.83333C8.74999 6.31944 8.57986 6.73264 8.23958 7.07291C7.8993 7.41319 7.48611 7.58333 6.99999 7.58333ZM6.99999 12.25L4.27291 13.1542C4.07847 13.2222 3.90104 13.1979 3.74062 13.0812C3.5802 12.9646 3.49999 12.809 3.49999 12.6146V8.91041C3.13055 8.50208 2.84374 8.03541 2.63958 7.51041C2.43541 6.98541 2.33333 6.42639 2.33333 5.83333C2.33333 4.53055 2.78541 3.42708 3.68958 2.52291C4.59374 1.61875 5.69722 1.16666 6.99999 1.16666C8.30277 1.16666 9.40624 1.61875 10.3104 2.52291C11.2146 3.42708 11.6667 4.53055 11.6667 5.83333C11.6667 6.42639 11.5646 6.98541 11.3604 7.51041C11.1562 8.03541 10.8694 8.50208 10.5 8.91041V12.6146C10.5 12.809 10.4198 12.9646 10.2594 13.0812C10.099 13.1979 9.92152 13.2222 9.72708 13.1542L6.99999 12.25ZM6.99999 9.33333C7.97222 9.33333 8.79861 8.99305 9.47916 8.3125C10.1597 7.63194 10.5 6.80555 10.5 5.83333C10.5 4.86111 10.1597 4.03472 9.47916 3.35416C8.79861 2.67361 7.97222 2.33333 6.99999 2.33333C6.02777 2.33333 5.20138 2.67361 4.52083 3.35416C3.84027 4.03472 3.49999 4.86111 3.49999 5.83333C3.49999 6.80555 3.84027 7.63194 4.52083 8.3125C5.20138 8.99305 6.02777 9.33333 6.99999 9.33333Z",fill:"black"})});function t0({className:e}){return G.jsx("svg",{className:`${e} w-14 h-14`,viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:G.jsx("path",{d:"M5.31407 5.89587C5.52796 5.67226 5.77831 5.49483 6.06511 5.36358C6.35192 5.23233 6.66546 5.1667 7.00574 5.1667C7.34602 5.1667 7.65956 5.23233 7.94636 5.36358C8.23317 5.49483 8.48352 5.67226 8.6974 5.89587L11.6432 4.24795L7.57449 1.98753C7.39949 1.88059 7.2099 1.82712 7.00574 1.82712C6.80157 1.82712 6.61199 1.88059 6.43699 1.98753L2.36824 4.24795L5.31407 5.89587ZM6.4224 13.0125V9.76045C5.91685 9.62434 5.49879 9.34969 5.16824 8.93649C4.83768 8.5233 4.6724 8.04448 4.6724 7.50003C4.6724 7.39309 4.67727 7.29101 4.68699 7.19378C4.69671 7.09656 4.71615 7.0042 4.74532 6.9167L1.75574 5.23962V9.73129C1.75574 9.94517 1.80921 10.142 1.91615 10.3219C2.0231 10.5018 2.16893 10.6452 2.35365 10.7521L6.4224 13.0125ZM7.00574 8.6667C7.32657 8.6667 7.60122 8.55247 7.8297 8.32399C8.05817 8.09552 8.1724 7.82087 8.1724 7.50003C8.1724 7.1792 8.05817 6.90455 7.8297 6.67608C7.60122 6.4476 7.32657 6.33337 7.00574 6.33337C6.6849 6.33337 6.41025 6.4476 6.18178 6.67608C5.95331 6.90455 5.83907 7.1792 5.83907 7.50003C5.83907 7.82087 5.95331 8.09552 6.18178 8.32399C6.41025 8.55247 6.6849 8.6667 7.00574 8.6667ZM7.58907 13.0125L11.6578 10.7521C11.8425 10.6452 11.9884 10.5018 12.0953 10.3219C12.2023 10.142 12.2557 9.94517 12.2557 9.73129V5.23962L9.26615 6.9167C9.29532 7.01392 9.31477 7.10872 9.32449 7.20108C9.33421 7.29344 9.33907 7.39309 9.33907 7.50003C9.33907 8.04448 9.17379 8.5233 8.84324 8.93649C8.51268 9.34969 8.09463 9.62434 7.58907 9.76045V13.0125Z",fill:"black"})})}const n0=({className:e})=>G.jsx("svg",{className:`${e}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14",fill:"none",children:G.jsx("path",{d:"M2.81458 7.01458L5.075 9.275C5.18194 9.38194 5.23541 9.51806 5.23541 9.68333C5.23541 9.84861 5.18194 9.98472 5.075 10.0917C4.96805 10.1986 4.83194 10.2521 4.66666 10.2521C4.50139 10.2521 4.36528 10.1986 4.25833 10.0917L1.575 7.40833C1.51666 7.35 1.47535 7.28681 1.45104 7.21875C1.42673 7.15069 1.41458 7.07778 1.41458 7C1.41458 6.92222 1.42673 6.84931 1.45104 6.78125C1.47535 6.71319 1.51666 6.65 1.575 6.59167L4.25833 3.90833C4.375 3.79167 4.51354 3.73333 4.67396 3.73333C4.83437 3.73333 4.97291 3.79167 5.08958 3.90833C5.20625 4.025 5.26458 4.16354 5.26458 4.32396C5.26458 4.48438 5.20625 4.62292 5.08958 4.73958L2.81458 7.01458ZM11.1854 6.98542L8.925 4.725C8.81805 4.61806 8.76458 4.48194 8.76458 4.31667C8.76458 4.15139 8.81805 4.01528 8.925 3.90833C9.03194 3.80139 9.16805 3.74792 9.33333 3.74792C9.49861 3.74792 9.63472 3.80139 9.74166 3.90833L12.425 6.59167C12.4833 6.65 12.5247 6.71319 12.549 6.78125C12.5733 6.84931 12.5854 6.92222 12.5854 7C12.5854 7.07778 12.5733 7.15069 12.549 7.21875C12.5247 7.28681 12.4833 7.35 12.425 7.40833L9.74166 10.0917C9.625 10.2083 9.48889 10.2642 9.33333 10.2594C9.17778 10.2545 9.04166 10.1938 8.925 10.0771C8.80833 9.96042 8.75 9.82188 8.75 9.66146C8.75 9.50104 8.80833 9.3625 8.925 9.24583L11.1854 6.98542Z",fill:"black"})}),r0=({className:e})=>G.jsx("svg",{className:`${e}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14",fill:"none",children:G.jsx("path",{d:"M7 6.41667C8.45833 6.41667 9.69792 6.18819 10.7188 5.73125C11.7396 5.27431 12.25 4.725 12.25 4.08333C12.25 3.44167 11.7396 2.89236 10.7188 2.43542C9.69792 1.97847 8.45833 1.75 7 1.75C5.54167 1.75 4.30208 1.97847 3.28125 2.43542C2.26042 2.89236 1.75 3.44167 1.75 4.08333C1.75 4.725 2.26042 5.27431 3.28125 5.73125C4.30208 6.18819 5.54167 6.41667 7 6.41667ZM7 7.875C7.39861 7.875 7.89687 7.83368 8.49479 7.75104C9.09271 7.6684 9.66875 7.53472 10.2229 7.35C10.7771 7.16528 11.2535 6.92465 11.6521 6.62813C12.0507 6.3316 12.25 5.96944 12.25 5.54167V7C12.25 7.42778 12.0507 7.78993 11.6521 8.08646C11.2535 8.38299 10.7771 8.62361 10.2229 8.80833C9.66875 8.99306 9.09271 9.12674 8.49479 9.20937C7.89687 9.29201 7.39861 9.33333 7 9.33333C6.60139 9.33333 6.10313 9.29201 5.50521 9.20937C4.90729 9.12674 4.33125 8.99306 3.77708 8.80833C3.22292 8.62361 2.74653 8.38299 2.34792 8.08646C1.94931 7.78993 1.75 7.42778 1.75 7V5.54167C1.75 5.96944 1.94931 6.3316 2.34792 6.62813C2.74653 6.92465 3.22292 7.16528 3.77708 7.35C4.33125 7.53472 4.90729 7.6684 5.50521 7.75104C6.10313 7.83368 6.60139 7.875 7 7.875ZM7 10.7917C7.39861 10.7917 7.89687 10.7503 8.49479 10.6677C9.09271 10.5851 9.66875 10.4514 10.2229 10.2667C10.7771 10.0819 11.2535 9.84132 11.6521 9.54479C12.0507 9.24826 12.25 8.88611 12.25 8.45833V9.91667C12.25 10.3444 12.0507 10.7066 11.6521 11.0031C11.2535 11.2997 10.7771 11.5403 10.2229 11.725C9.66875 11.9097 9.09271 12.0434 8.49479 12.126C7.89687 12.2087 7.39861 12.25 7 12.25C6.60139 12.25 6.10313 12.2087 5.50521 12.126C4.90729 12.0434 4.33125 11.9097 3.77708 11.725C3.22292 11.5403 2.74653 11.2997 2.34792 11.0031C1.94931 10.7066 1.75 10.3444 1.75 9.91667V8.45833C1.75 8.88611 1.94931 9.24826 2.34792 9.54479C2.74653 9.84132 3.22292 10.0819 3.77708 10.2667C4.33125 10.4514 4.90729 10.5851 5.50521 10.6677C6.10313 10.7503 6.60139 10.7917 7 10.7917Z",fill:"black"})}),o0=({className:e})=>G.jsx("svg",{className:`${e}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14",fill:"none",children:G.jsx("path",{d:"M4.66667 9.91667H5.83333C5.99861 9.91667 6.13715 9.86076 6.24896 9.74896C6.36076 9.63715 6.41667 9.49861 6.41667 9.33333V8.16667C6.41667 8.00139 6.36076 7.86285 6.24896 7.75104C6.13715 7.63924 5.99861 7.58333 5.83333 7.58333H4.66667C4.50139 7.58333 4.36285 7.63924 4.25104 7.75104C4.13924 7.86285 4.08333 8.00139 4.08333 8.16667V9.33333C4.08333 9.49861 4.13924 9.63715 4.25104 9.74896C4.36285 9.86076 4.50139 9.91667 4.66667 9.91667ZM8.16667 9.91667H9.33333C9.49861 9.91667 9.63715 9.86076 9.74896 9.74896C9.86076 9.63715 9.91667 9.49861 9.91667 9.33333V8.16667C9.91667 8.00139 9.86076 7.86285 9.74896 7.75104C9.63715 7.63924 9.49861 7.58333 9.33333 7.58333H8.16667C8.00139 7.58333 7.86285 7.63924 7.75104 7.75104C7.63924 7.86285 7.58333 8.00139 7.58333 8.16667V9.33333C7.58333 9.49861 7.63924 9.63715 7.75104 9.74896C7.86285 9.86076 8.00139 9.91667 8.16667 9.91667ZM4.66667 6.41667H5.83333C5.99861 6.41667 6.13715 6.36076 6.24896 6.24896C6.36076 6.13715 6.41667 5.99861 6.41667 5.83333V4.66667C6.41667 4.50139 6.36076 4.36285 6.24896 4.25104C6.13715 4.13924 5.99861 4.08333 5.83333 4.08333H4.66667C4.50139 4.08333 4.36285 4.13924 4.25104 4.25104C4.13924 4.36285 4.08333 4.50139 4.08333 4.66667V5.83333C4.08333 5.99861 4.13924 6.13715 4.25104 6.24896C4.36285 6.36076 4.50139 6.41667 4.66667 6.41667ZM8.16667 6.41667H9.33333C9.49861 6.41667 9.63715 6.36076 9.74896 6.24896C9.86076 6.13715 9.91667 5.99861 9.91667 5.83333V4.66667C9.91667 4.50139 9.86076 4.36285 9.74896 4.25104C9.63715 4.13924 9.49861 4.08333 9.33333 4.08333H8.16667C8.00139 4.08333 7.86285 4.13924 7.75104 4.25104C7.63924 4.36285 7.58333 4.50139 7.58333 4.66667V5.83333C7.58333 5.99861 7.63924 6.13715 7.75104 6.24896C7.86285 6.36076 8.00139 6.41667 8.16667 6.41667ZM2.91667 12.25C2.59583 12.25 2.32118 12.1358 2.09271 11.9073C1.86424 11.6788 1.75 11.4042 1.75 11.0833V2.91667C1.75 2.59583 1.86424 2.32118 2.09271 2.09271C2.32118 1.86424 2.59583 1.75 2.91667 1.75H11.0833C11.4042 1.75 11.6788 1.86424 11.9073 2.09271C12.1358 2.32118 12.25 2.59583 12.25 2.91667V11.0833C12.25 11.4042 12.1358 11.6788 11.9073 11.9073C11.6788 12.1358 11.4042 12.25 11.0833 12.25H2.91667Z",fill:"black"})}),i0=({className:e})=>G.jsx("svg",{className:`${e}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 14 14",fill:"none",children:G.jsx("path",{d:"M6.21251 9.1875L9.05626 7.36458C9.19237 7.27708 9.26042 7.15555 9.26042 7C9.26042 6.84444 9.19237 6.72291 9.05626 6.63541L6.21251 4.8125C6.06667 4.71528 5.91841 4.70798 5.76771 4.79062C5.61702 4.87326 5.54167 5.00208 5.54167 5.17708V8.82291C5.54167 8.99791 5.61702 9.12673 5.76771 9.20937C5.91841 9.29201 6.06667 9.28472 6.21251 9.1875ZM7.00001 12.8333C6.19306 12.8333 5.43473 12.6802 4.72501 12.374C4.01528 12.0677 3.39792 11.6521 2.87292 11.1271C2.34792 10.6021 1.9323 9.98472 1.62605 9.275C1.3198 8.56528 1.16667 7.80694 1.16667 7C1.16667 6.19305 1.3198 5.43472 1.62605 4.725C1.9323 4.01528 2.34792 3.39791 2.87292 2.87291C3.39792 2.34791 4.01528 1.93229 4.72501 1.62604C5.43473 1.31979 6.19306 1.16666 7.00001 1.16666C7.80695 1.16666 8.56528 1.31979 9.27501 1.62604C9.98473 1.93229 10.6021 2.34791 11.1271 2.87291C11.6521 3.39791 12.0677 4.01528 12.374 4.725C12.6802 5.43472 12.8333 6.19305 12.8333 7C12.8333 7.80694 12.6802 8.56528 12.374 9.275C12.0677 9.98472 11.6521 10.6021 11.1271 11.1271C10.6021 11.6521 9.98473 12.0677 9.27501 12.374C8.56528 12.6802 7.80695 12.8333 7.00001 12.8333Z",fill:"black"})}),s0="_container_jb5f6_5",a0="_containerIsPill_jb5f6_16",c0="_topBar_jb5f6_21",l0="_selectedNode_jb5f6_35",u0="_vcModeOn_jb5f6_39",f0="_isTrusted_jb5f6_43",d0="_labelContainer_jb5f6_46",h0="_nodeType_jb5f6_50",g0="_nodeLabel_jb5f6_56",p0="_nodeTypeLarge_jb5f6_61",m0="_topBarIsVCNone_jb5f6_79",y0="_badge_jb5f6_84",v0="_iconContainer_jb5f6_91",x0="_icon_jb5f6_91",w0="_displayType_jb5f6_113",C0="_clickableArea_jb5f6_118",b0="_flex_jb5f6_124",se={container:s0,containerIsPill:a0,topBar:c0,selectedNode:l0,vcModeOn:u0,isTrusted:f0,labelContainer:d0,nodeType:h0,nodeLabel:g0,nodeTypeLarge:p0,topBarIsVCNone:m0,badge:y0,iconContainer:v0,icon:x0,displayType:w0,clickableArea:C0,flex:b0};function _0(){this.__data__=[],this.size=0}var S0=_0;function E0(e,t){return e===t||e!==e&&t!==t}var Tn=E0,N0=Tn;function $0(e,t){for(var n=e.length;n--;)if(N0(e[n][0],t))return n;return-1}var An=$0,M0=An,T0=Array.prototype,A0=T0.splice;function k0(e){var t=this.__data__,n=M0(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():A0.call(t,n,1),--this.size,!0}var I0=k0,P0=An;function O0(e){var t=this.__data__,n=P0(t,e);return n<0?void 0:t[n][1]}var R0=O0,L0=An;function D0(e){return L0(this.__data__,e)>-1}var V0=D0,B0=An;function H0(e,t){var n=this.__data__,r=B0(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var z0=H0,F0=S0,j0=I0,G0=R0,U0=V0,Z0=z0;function vt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}vt.prototype.clear=F0;vt.prototype.delete=j0;vt.prototype.get=G0;vt.prototype.has=U0;vt.prototype.set=Z0;var kn=vt,Y0=kn;function X0(){this.__data__=new Y0,this.size=0}var W0=X0;function q0(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var K0=q0;function Q0(e){return this.__data__.get(e)}var J0=Q0;function eh(e){return this.__data__.has(e)}var th=eh,nh=typeof Yt=="object"&&Yt&&Yt.Object===Object&&Yt,Ns=nh,rh=Ns,oh=typeof self=="object"&&self&&self.Object===Object&&self,ih=rh||oh||Function("return this")(),xt=ih,sh=xt,ah=sh.Symbol,$s=ah,To=$s,Ms=Object.prototype,ch=Ms.hasOwnProperty,lh=Ms.toString,It=To?To.toStringTag:void 0;function uh(e){var t=ch.call(e,It),n=e[It];try{e[It]=void 0;var r=!0}catch{}var o=lh.call(e);return r&&(t?e[It]=n:delete e[It]),o}var fh=uh,dh=Object.prototype,hh=dh.toString;function gh(e){return hh.call(e)}var ph=gh,Ao=$s,mh=fh,yh=ph,vh="[object Null]",xh="[object Undefined]",ko=Ao?Ao.toStringTag:void 0;function wh(e){return e==null?e===void 0?xh:vh:ko&&ko in Object(e)?mh(e):yh(e)}var In=wh;function Ch(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Je=Ch,bh=In,_h=Je,Sh="[object AsyncFunction]",Eh="[object Function]",Nh="[object GeneratorFunction]",$h="[object Proxy]";function Mh(e){if(!_h(e))return!1;var t=bh(e);return t==Eh||t==Nh||t==Sh||t==$h}var Ar=Mh,Th=xt,Ah=Th["__core-js_shared__"],kh=Ah,Xn=kh,Io=function(){var e=/[^.]+$/.exec(Xn&&Xn.keys&&Xn.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Ih(e){return!!Io&&Io in e}var Ph=Ih,Oh=Function.prototype,Rh=Oh.toString;function Lh(e){if(e!=null){try{return Rh.call(e)}catch{}try{return e+""}catch{}}return""}var Dh=Lh,Vh=Ar,Bh=Ph,Hh=Je,zh=Dh,Fh=/[\\^$.*+?()[\]{}|]/g,jh=/^\[object .+?Constructor\]$/,Gh=Function.prototype,Uh=Object.prototype,Zh=Gh.toString,Yh=Uh.hasOwnProperty,Xh=RegExp("^"+Zh.call(Yh).replace(Fh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Wh(e){if(!Hh(e)||Bh(e))return!1;var t=Vh(e)?Xh:jh;return t.test(zh(e))}var qh=Wh;function Kh(e,t){return e==null?void 0:e[t]}var Qh=Kh,Jh=qh,e3=Qh;function t3(e,t){var n=e3(e,t);return Jh(n)?n:void 0}var kr=t3,n3=kr,r3=xt,o3=n3(r3,"Map"),Ts=o3,i3=kr,s3=i3(Object,"create"),Pn=s3,Po=Pn;function a3(){this.__data__=Po?Po(null):{},this.size=0}var c3=a3;function l3(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var u3=l3,f3=Pn,d3="__lodash_hash_undefined__",h3=Object.prototype,g3=h3.hasOwnProperty;function p3(e){var t=this.__data__;if(f3){var n=t[e];return n===d3?void 0:n}return g3.call(t,e)?t[e]:void 0}var m3=p3,y3=Pn,v3=Object.prototype,x3=v3.hasOwnProperty;function w3(e){var t=this.__data__;return y3?t[e]!==void 0:x3.call(t,e)}var C3=w3,b3=Pn,_3="__lodash_hash_undefined__";function S3(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=b3&&t===void 0?_3:t,this}var E3=S3,N3=c3,$3=u3,M3=m3,T3=C3,A3=E3;function wt(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}wt.prototype.clear=N3;wt.prototype.delete=$3;wt.prototype.get=M3;wt.prototype.has=T3;wt.prototype.set=A3;var k3=wt,Oo=k3,I3=kn,P3=Ts;function O3(){this.size=0,this.__data__={hash:new Oo,map:new(P3||I3),string:new Oo}}var R3=O3;function L3(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var D3=L3,V3=D3;function B3(e,t){var n=e.__data__;return V3(t)?n[typeof t=="string"?"string":"hash"]:n.map}var On=B3,H3=On;function z3(e){var t=H3(this,e).delete(e);return this.size-=t?1:0,t}var F3=z3,j3=On;function G3(e){return j3(this,e).get(e)}var U3=G3,Z3=On;function Y3(e){return Z3(this,e).has(e)}var X3=Y3,W3=On;function q3(e,t){var n=W3(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var K3=q3,Q3=R3,J3=F3,e2=U3,t2=X3,n2=K3;function Ct(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ct.prototype.clear=Q3;Ct.prototype.delete=J3;Ct.prototype.get=e2;Ct.prototype.has=t2;Ct.prototype.set=n2;var r2=Ct,o2=kn,i2=Ts,s2=r2,a2=200;function c2(e,t){var n=this.__data__;if(n instanceof o2){var r=n.__data__;if(!i2||r.length<a2-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new s2(r)}return n.set(e,t),this.size=n.size,this}var l2=c2,u2=kn,f2=W0,d2=K0,h2=J0,g2=th,p2=l2;function bt(e){var t=this.__data__=new u2(e);this.size=t.size}bt.prototype.clear=f2;bt.prototype.delete=d2;bt.prototype.get=h2;bt.prototype.has=g2;bt.prototype.set=p2;var m2=bt,y2=kr,v2=function(){try{var e=y2(Object,"defineProperty");return e({},"",{}),e}catch{}}(),As=v2,Ro=As;function x2(e,t,n){t=="__proto__"&&Ro?Ro(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var Ir=x2,w2=Ir,C2=Tn;function b2(e,t,n){(n!==void 0&&!C2(e[t],n)||n===void 0&&!(t in e))&&w2(e,t,n)}var ks=b2;function _2(e){return function(t,n,r){for(var o=-1,i=Object(t),s=r(t),a=s.length;a--;){var c=s[e?a:++o];if(n(i[c],c,i)===!1)break}return t}}var S2=_2,E2=S2,N2=E2(),$2=N2,xn={exports:{}};xn.exports;(function(e,t){var n=xt,r=t&&!t.nodeType&&t,o=r&&!0&&e&&!e.nodeType&&e,i=o&&o.exports===r,s=i?n.Buffer:void 0,a=s?s.allocUnsafe:void 0;function c(u,l){if(l)return u.slice();var f=u.length,d=a?a(f):new u.constructor(f);return u.copy(d),d}e.exports=c})(xn,xn.exports);var M2=xn.exports,T2=xt,A2=T2.Uint8Array,k2=A2,Lo=k2;function I2(e){var t=new e.constructor(e.byteLength);return new Lo(t).set(new Lo(e)),t}var P2=I2,O2=P2;function R2(e,t){var n=t?O2(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var L2=R2;function D2(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var V2=D2,B2=Je,Do=Object.create,H2=function(){function e(){}return function(t){if(!B2(t))return{};if(Do)return Do(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),z2=H2;function F2(e,t){return function(n){return e(t(n))}}var j2=F2,G2=j2,U2=G2(Object.getPrototypeOf,Object),Is=U2,Z2=Object.prototype;function Y2(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Z2;return e===n}var Ps=Y2,X2=z2,W2=Is,q2=Ps;function K2(e){return typeof e.constructor=="function"&&!q2(e)?X2(W2(e)):{}}var Q2=K2;function J2(e){return e!=null&&typeof e=="object"}var Zt=J2,eg=In,tg=Zt,ng="[object Arguments]";function rg(e){return tg(e)&&eg(e)==ng}var og=rg,Vo=og,ig=Zt,Os=Object.prototype,sg=Os.hasOwnProperty,ag=Os.propertyIsEnumerable,cg=Vo(function(){return arguments}())?Vo:function(e){return ig(e)&&sg.call(e,"callee")&&!ag.call(e,"callee")},Rs=cg,lg=Array.isArray,Ls=lg,ug=9007199254740991;function fg(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ug}var Ds=fg,dg=Ar,hg=Ds;function gg(e){return e!=null&&hg(e.length)&&!dg(e)}var Pr=gg,pg=Pr,mg=Zt;function yg(e){return mg(e)&&pg(e)}var vg=yg,wn={exports:{}};function xg(){return!1}var wg=xg;wn.exports;(function(e,t){var n=xt,r=wg,o=t&&!t.nodeType&&t,i=o&&!0&&e&&!e.nodeType&&e,s=i&&i.exports===o,a=s?n.Buffer:void 0,c=a?a.isBuffer:void 0,u=c||r;e.exports=u})(wn,wn.exports);var Vs=wn.exports,Cg=In,bg=Is,_g=Zt,Sg="[object Object]",Eg=Function.prototype,Ng=Object.prototype,Bs=Eg.toString,$g=Ng.hasOwnProperty,Mg=Bs.call(Object);function Tg(e){if(!_g(e)||Cg(e)!=Sg)return!1;var t=bg(e);if(t===null)return!0;var n=$g.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Bs.call(n)==Mg}var Ag=Tg,kg=In,Ig=Ds,Pg=Zt,Og="[object Arguments]",Rg="[object Array]",Lg="[object Boolean]",Dg="[object Date]",Vg="[object Error]",Bg="[object Function]",Hg="[object Map]",zg="[object Number]",Fg="[object Object]",jg="[object RegExp]",Gg="[object Set]",Ug="[object String]",Zg="[object WeakMap]",Yg="[object ArrayBuffer]",Xg="[object DataView]",Wg="[object Float32Array]",qg="[object Float64Array]",Kg="[object Int8Array]",Qg="[object Int16Array]",Jg="[object Int32Array]",ep="[object Uint8Array]",tp="[object Uint8ClampedArray]",np="[object Uint16Array]",rp="[object Uint32Array]",K={};K[Wg]=K[qg]=K[Kg]=K[Qg]=K[Jg]=K[ep]=K[tp]=K[np]=K[rp]=!0;K[Og]=K[Rg]=K[Yg]=K[Lg]=K[Xg]=K[Dg]=K[Vg]=K[Bg]=K[Hg]=K[zg]=K[Fg]=K[jg]=K[Gg]=K[Ug]=K[Zg]=!1;function op(e){return Pg(e)&&Ig(e.length)&&!!K[kg(e)]}var ip=op;function sp(e){return function(t){return e(t)}}var ap=sp,Cn={exports:{}};Cn.exports;(function(e,t){var n=Ns,r=t&&!t.nodeType&&t,o=r&&!0&&e&&!e.nodeType&&e,i=o&&o.exports===r,s=i&&n.process,a=function(){try{var c=o&&o.require&&o.require("util").types;return c||s&&s.binding&&s.binding("util")}catch{}}();e.exports=a})(Cn,Cn.exports);var cp=Cn.exports,lp=ip,up=ap,Bo=cp,Ho=Bo&&Bo.isTypedArray,fp=Ho?up(Ho):lp,Hs=fp;function dp(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var zs=dp,hp=Ir,gp=Tn,pp=Object.prototype,mp=pp.hasOwnProperty;function yp(e,t,n){var r=e[t];(!(mp.call(e,t)&&gp(r,n))||n===void 0&&!(t in e))&&hp(e,t,n)}var vp=yp,xp=vp,wp=Ir;function Cp(e,t,n,r){var o=!n;n||(n={});for(var i=-1,s=t.length;++i<s;){var a=t[i],c=r?r(n[a],e[a],a,n,e):void 0;c===void 0&&(c=e[a]),o?wp(n,a,c):xp(n,a,c)}return n}var bp=Cp;function _p(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Sp=_p,Ep=9007199254740991,Np=/^(?:0|[1-9]\d*)$/;function $p(e,t){var n=typeof e;return t=t??Ep,!!t&&(n=="number"||n!="symbol"&&Np.test(e))&&e>-1&&e%1==0&&e<t}var Fs=$p,Mp=Sp,Tp=Rs,Ap=Ls,kp=Vs,Ip=Fs,Pp=Hs,Op=Object.prototype,Rp=Op.hasOwnProperty;function Lp(e,t){var n=Ap(e),r=!n&&Tp(e),o=!n&&!r&&kp(e),i=!n&&!r&&!o&&Pp(e),s=n||r||o||i,a=s?Mp(e.length,String):[],c=a.length;for(var u in e)(t||Rp.call(e,u))&&!(s&&(u=="length"||o&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Ip(u,c)))&&a.push(u);return a}var Dp=Lp;function Vp(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Bp=Vp,Hp=Je,zp=Ps,Fp=Bp,jp=Object.prototype,Gp=jp.hasOwnProperty;function Up(e){if(!Hp(e))return Fp(e);var t=zp(e),n=[];for(var r in e)r=="constructor"&&(t||!Gp.call(e,r))||n.push(r);return n}var Zp=Up,Yp=Dp,Xp=Zp,Wp=Pr;function qp(e){return Wp(e)?Yp(e,!0):Xp(e)}var js=qp,Kp=bp,Qp=js;function Jp(e){return Kp(e,Qp(e))}var e6=Jp,zo=ks,t6=M2,n6=L2,r6=V2,o6=Q2,Fo=Rs,jo=Ls,i6=vg,s6=Vs,a6=Ar,c6=Je,l6=Ag,u6=Hs,Go=zs,f6=e6;function d6(e,t,n,r,o,i,s){var a=Go(e,n),c=Go(t,n),u=s.get(c);if(u){zo(e,n,u);return}var l=i?i(a,c,n+"",e,t,s):void 0,f=l===void 0;if(f){var d=jo(c),h=!d&&s6(c),y=!d&&!h&&u6(c);l=c,d||h||y?jo(a)?l=a:i6(a)?l=r6(a):h?(f=!1,l=t6(c,!0)):y?(f=!1,l=n6(c,!0)):l=[]:l6(c)||Fo(c)?(l=a,Fo(a)?l=f6(a):(!c6(a)||a6(a))&&(l=o6(c))):f=!1}f&&(s.set(c,l),o(l,c,r,i,s),s.delete(c)),zo(e,n,l)}var h6=d6,g6=m2,p6=ks,m6=$2,y6=h6,v6=Je,x6=js,w6=zs;function Gs(e,t,n,r,o){e!==t&&m6(t,function(i,s){if(o||(o=new g6),v6(i))y6(e,t,s,n,Gs,r,o);else{var a=r?r(w6(e,s),i,s+"",e,t,o):void 0;a===void 0&&(a=i),p6(e,s,a)}},x6)}var C6=Gs;function b6(e){return e}var Us=b6;function _6(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var S6=_6,E6=S6,Uo=Math.max;function N6(e,t,n){return t=Uo(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=Uo(r.length-t,0),s=Array(i);++o<i;)s[o]=r[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=r[o];return a[t]=n(s),E6(e,this,a)}}var $6=N6;function M6(e){return function(){return e}}var T6=M6,A6=T6,Zo=As,k6=Us,I6=Zo?function(e,t){return Zo(e,"toString",{configurable:!0,enumerable:!1,value:A6(t),writable:!0})}:k6,P6=I6,O6=800,R6=16,L6=Date.now;function D6(e){var t=0,n=0;return function(){var r=L6(),o=R6-(r-n);if(n=r,o>0){if(++t>=O6)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var V6=D6,B6=P6,H6=V6,z6=H6(B6),F6=z6,j6=Us,G6=$6,U6=F6;function Z6(e,t){return U6(G6(e,t,j6),e+"")}var Y6=Z6,X6=Tn,W6=Pr,q6=Fs,K6=Je;function Q6(e,t,n){if(!K6(n))return!1;var r=typeof t;return(r=="number"?W6(n)&&q6(t,n.length):r=="string"&&t in n)?X6(n[t],e):!1}var J6=Q6,e7=Y6,t7=J6;function n7(e){return e7(function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(o--,i):void 0,s&&t7(n[0],n[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);++r<o;){var a=n[r];a&&e(t,a,r,i)}return t})}var r7=n7,o7=C6,i7=r7,s7=i7(function(e,t,n){o7(e,t,n)}),a7=s7;const c7=qo(a7),{useDebugValue:l7}=L,{useSyncExternalStoreWithSelector:u7}=ri;function f7(e,t=e.getState,n){const r=u7(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return l7(r),r}const Yo=e=>{const t=typeof e=="function"?oi(e):e,n=(r,o)=>f7(t,r,o);return Object.assign(n,t),n},d7=e=>e?Yo(e):Yo,h7=d7()((e,t)=>({graphName:"",nodes:[],edges:[],allNodes:[],graphState:"vc-off",governanceFilter:null,vcs:new Map,vcsToGraph:new Map,sinks:{},activeSink:null,showBenchmarks:!1,hasMeasured:!1,pretty:!0,setGraphName:n=>e({graphName:n}),setGovernanceFilter:n=>e({governanceFilter:n}),setAllNodes:n=>e({allNodes:n}),setNodes:n=>{const r=new Map(t().nodes.map(i=>[i.id,i]));let o=[];for(const i of n){let s=r.get(i.id);o.push(s?c7(i,s):i)}e({nodes:o})},setEdges:n=>e({edges:n}),setGraphState:n=>{e({graphState:n})},setVcs:n=>e({vcs:n}),setVcsToGraph:n=>e({vcsToGraph:n}),setSinkMap:n=>e({sinks:n}),setActiveSink:n=>e({activeSink:n}),setShowBenchmarks:n=>{e({showBenchmarks:n})},setPretty:n=>e({pretty:n}),setHasMeasured:n=>e({hasMeasured:n}),setGraph:n=>e({graph:n}),setNoBenchmarksGraph:n=>e({noBenchmarksGraph:n}),onNodesChange:n=>{const r=us(n,t().nodes);e({nodes:r})},onEdgesChange:n=>{e({edges:Kf(n,t().edges)})},onConnect:n=>{e({edges:Fi(n,t().edges)})},getNodeById:n=>t().nodes.find(r=>r.id===n),getNodeFromFullGraph:n=>t().allNodes.find(r=>r.id===n)})),g7=({className:e})=>G.jsx("svg",{className:`${e}`,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:G.jsx("path",{d:"M2.94604 11.3881H8.77938C8.94465 11.3881 9.0832 11.444 9.195 11.5558C9.30681 11.6676 9.36271 11.8061 9.36271 11.9714C9.36271 12.1367 9.30681 12.2752 9.195 12.387C9.0832 12.4988 8.94465 12.5548 8.77938 12.5548H2.94604C2.78076 12.5548 2.64222 12.4988 2.53042 12.387C2.41861 12.2752 2.36271 12.1367 2.36271 11.9714C2.36271 11.8061 2.41861 11.6676 2.53042 11.5558C2.64222 11.444 2.78076 11.3881 2.94604 11.3881ZM4.82729 8.89434L3.17938 7.24642C2.95576 7.02281 2.84153 6.74815 2.83667 6.42246C2.83181 6.09677 2.94118 5.82211 3.16479 5.5985L3.58771 5.17558L6.91271 8.47142L6.48979 8.89434C6.26618 9.11795 5.9891 9.22975 5.65854 9.22975C5.32799 9.22975 5.0509 9.11795 4.82729 8.89434ZM9.36271 6.02142L6.06688 2.69642L6.48979 2.2735C6.7134 2.04989 6.98806 1.94051 7.31375 1.94538C7.63945 1.95024 7.9141 2.06447 8.13771 2.28808L9.78563 3.936C10.0092 4.15961 10.121 4.4367 10.121 4.76725C10.121 5.09781 10.0092 5.37489 9.78563 5.5985L9.36271 6.02142ZM11.6377 11.5631L4.43354 4.35892L5.25021 3.54225L12.4544 10.7464C12.5613 10.8534 12.6148 10.9895 12.6148 11.1548C12.6148 11.32 12.5613 11.4561 12.4544 11.5631C12.3474 11.67 12.2113 11.7235 12.046 11.7235C11.8808 11.7235 11.7447 11.67 11.6377 11.5631Z",fill:"black"})}),p7="_titleContainer_1p5wf_1",m7="_title_1p5wf_1",y7="_closeButton_1p5wf_15",v7="_govButton_1p5wf_22",x7="_iconButton_1p5wf_28",w7="_icon_1p5wf_28",at={titleContainer:p7,title:m7,closeButton:y7,govButton:v7,iconButton:x7,icon:w7},C7=({governanceNodes:e,onGovernanceSelect:t,onGovernanceClose:n,governanceFilter:r})=>{const[o,i]=b.useState(!1),s=()=>{i(!o)},a=G.jsx("div",{children:e.map(f=>{var y;const h=(r==null?void 0:r.find(p=>p===f.id))?{backgroundColor:"#E2CCFF",color:"#000000"}:{};return G.jsx(Ma,{style:h,onClick:()=>{},className:at.govButton,type:"text",children:((y=f.data.enrichments.governance)==null?void 0:y.name)||f.data.label},f.id)})}),c=()=>{i(!1),n()},u=()=>{c()},l=()=>G.jsxs("div",{className:at.titleContainer,children:[G.jsx("span",{className:at.title,children:"Governance "}),G.jsx("button",{onClick:u,className:at.closeButton,children:G.jsx(Ta,{})})]});return G.jsx(Ja,{content:a,title:l,trigger:"click",open:o,getTooltipContainer:f=>f,children:G.jsx("div",{children:G.jsx("button",{className:at.iconButton,onClick:s,children:G.jsx(g7,{className:at.icon})})})})},Xo={untrusted:"#FFCCD5",none:"white",trusted:"#CEFFDC",unknown:"#E2E8F0",waiting:"orange"},H7={untrusted:"#FF6682",none:"black",trusted:"#26D958",unknown:"#a7a9b3",waiting:"orange"};function z7(e){let t="DataIcon",n="governance",r=null;switch(e?e.toLowerCase():""){case"attribution":t="AttributionIcon",r=ge.certificate,n="Attribution";break;case"benchmark":t="BenchmarkIcon",r=ge.benchmark,n="benchmark";break;case"benchmark_result":t="Benchmark_resultIcon",r=ge.benchmark,n="benchmark result";break;case"certificate":t="CertificateIcon",r=ge.certificate,n="certificate";break;case"database":t="DatabaseIcon",r=ge.data,n="database";break;case"dataset":t="DatasetIcon",r=ge.data,n="dataset";break;case"data":t="DataIcon",r=Vr.grey400,n="data";break;case"document":t="DocumentIcon",r=ge.data,n="document";break;case"media_file":t="Media_fileIcon",r=ge.data,n="media file";break;case"computation":t="ComputationIcon",r=ge.computation,n="computation";break;case"model":t="ModelIcon",r=ge.model,n="model";break;case"token":t="TokenIcon",r=ge.tokens,n="token";break;case"code":t="DataIcon",r=ge.code,n="code";break;case"governance":t="DataIcon",r=Vr.blue,n="Governance";break;default:r="#AAEEDD",n="Unknown"}return{iconId:t,color:r,displayType:n}}function b7(e,t){if(!t)return"waiting";const n=[];for(const[o,{nodes:i,vc:s}]of t)i.some(a=>a.node.id==e)&&n.push(s);const r=n.map(o=>o.issuerStatus);return Zs(r)}function F7(e,t){if(!t)return"waiting";const n=[];for(const[o,{edges:i,vc:s}]of t)i.some(a=>a.edge.id==e)&&n.push(s);const r=n.map(o=>o.issuerStatus);return Zs(r)}function Zs(e){let t="none";return e.some(r=>r.toLocaleLowerCase()==="trusted")?t="trusted":e.some(r=>r.toLocaleLowerCase()==="untrusted")?t="untrusted":e.some(r=>r.toLocaleLowerCase()==="unknown")&&(t="unknown"),t}const _7={DataIcon:Yd,ModelIcon:Xd,ComputationIcon:qd,DocumentIcon:Wd,TokenIcon:t0,AttributionIcon:Kd,BenchmarkIcon:Qd,Benchmark_resultIcon:Jd,CertificateIcon:e0,CodeIcon:n0,DatabaseIcon:r0,DatasetIcon:o0,Media_fileIcon:i0},S7=e=>_7[e]||null,E7=({top:e,bottom:t})=>({"--node-color-top":e,"--node-color-bottom":t}),N7=e=>e.transform[2]>=za,$7=e=>e.transform[2]>=Fa,M7=({id:e,data:t,...n})=>{const{nodeColor:r,label:o,icon:i,sourcePosition:s,displayType:a,typeLabel:c,governanceNodes:u,isSourceForConnection:l,isTargetForConnection:f}=t,d=Aa(),h=ka(),[y,p]=Ia(),w=h.nodeCid,{graphState:m,vcsToGraph:_,governanceFilter:$,setGovernanceFilter:v,sinks:M,activeSink:O,getNodeFromFullGraph:R}=h7(B=>({graphState:B.graphState,vcsToGraph:B.vcsToGraph,governanceFilter:B.governanceFilter,setGovernanceFilter:B.setGovernanceFilter,sinks:B.sinks,activeSink:B.activeSink,getNodeFromFullGraph:B.getNodeFromFullGraph})),I=w===e,k=O?M[O]:null,F=k?k.nodes.has(e)||O===e:!1,D=b7(e,_),z=B=>{var U;let H=1;if(k&&!w&&(H=F?1:.1),k&&w){const Y=R(w),W=(U=Y==null?void 0:Y.data.model)!=null&&U.id?`${Y.data.model.id}-benchmarks`:w;k.nodes.has(W)||O===W?F?W===B?H=1:H=.5:H=.1:H=W!==B?.1:1}return!k&&w&&(H=w!==B?.1:1),$?{opacity:$.find(W=>u.some(q=>q.id===W))?1:.2}:{opacity:H}},E=B=>{B.altKey?p(H=>({...H,sourceNode:e})):I||d(Ha(`${h.owner}/${h.repo}`)+"/"+e+`?${y.toString()}`)},g={"vc-off":{top:r,bottom:"white"},"vc-on":{top:Xo[D],bottom:Xo[D]}},S={...E7(g[m])},C=Rt(se.container,{[se.vcModeOn]:m==="vc-on",[se.selectedNode]:I}),T=Rt(se.topBar,{[se.topBarIsVCUnknown]:D==="unknown"&&m==="vc-on",[se.topBarIsVCNone]:D==="none"&&m==="vc-on",[se.isTrusted]:D==="trusted"&&m==="vc-on"}),P=S7(i),x=o,N=B=>{const H=[...$||[]],U=H.indexOf(B);U>-1?H.splice(U,1):H.push(B),H.length===0?v(null):v(H)},A=()=>{v(null)};b.useEffect(()=>{w&&v(null)},[w]);const V=J(N7);return J($7),G.jsxs(Pa.div,{style:S,className:C,animate:{...z(e)},initial:{opacity:0},transition:{duration:1},children:[G.jsx("div",{className:"popup-container"}),G.jsx("div",{className:se.badge,children:u.length>0&&G.jsx(C7,{governanceNodes:u,onGovernanceSelect:N,onGovernanceClose:A,governanceFilter:$})}),G.jsx("div",{className:se.clickableArea,onClick:E,children:G.jsxs("div",{className:T,children:[G.jsx("span",{className:se.iconContainer,children:P&&G.jsx(P,{className:se.icon})}),G.jsxs("div",{className:se.labelContainer,children:[G.jsx("div",{className:se.nodeType,style:{visibility:V?"visible":"hidden"},children:a}),G.jsx("div",{className:se.nodeLabel,style:{visibility:V?"visible":"hidden"},children:x}),G.jsx("div",{className:se.nodeTypeLarge,style:{display:V?"none":"flex"},children:a})]})]})}),G.jsx(yt,{type:"target",position:j.Left,id:"left",style:{opacity:f?1:0}}),G.jsx(yt,{type:"source",position:j.Right,id:"source",style:{opacity:l?1:0}})]})},j7=b.memo(M7);function G7(e,t){return e.startsWith(t)?e.slice(t.length):e}export{Kd as A,Qd as B,qd as C,Yd as D,H7 as E,R7 as F,C7 as G,yt as H,L7 as I,G7 as J,bs as K,Zd as L,Xd as M,Xo as N,O7 as O,j as P,D7 as Q,jd as R,B7 as S,t0 as T,S7 as U,Ss as a,V7 as b,me as c,I7 as d,h7 as e,b7 as f,Es as g,Wd as h,Jd as i,e0 as j,n0 as k,r0 as l,o0 as m,i0 as n,zi as o,F7 as p,Ut as q,Zs as r,ue as s,yn as t,J as u,cs as v,P7 as w,oe as x,j7 as y,z7 as z}; | |