@lunora/studio 1.0.0-alpha.63 → 1.0.0-alpha.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/packem_chunks/MetricsPanel.js +1 -1
  3. package/dist/packem_chunks/issues-panel.js +1 -1
  4. package/dist/packem_chunks/payments-panel.js +1 -1
  5. package/dist/standalone/{chunk-SM67QXQI.js → chunk-2F7G7IWQ.js} +1 -1
  6. package/dist/standalone/chunk-34UVAASH.js +1 -0
  7. package/dist/standalone/chunk-35II7U25.js +11 -0
  8. package/dist/standalone/{chunk-UVDPQU7J.js → chunk-3FUFEZ65.js} +1 -1
  9. package/dist/standalone/{chunk-VSS7NFZJ.js → chunk-3QRTYSSX.js} +1 -1
  10. package/dist/standalone/{chunk-PZPFWABF.js → chunk-4WLYA3XE.js} +1 -1
  11. package/dist/standalone/{chunk-TDE4AR5O.js → chunk-5OWIOACV.js} +1 -1
  12. package/dist/standalone/{chunk-ZSWWTXVW.js → chunk-5U2THBI7.js} +1 -1
  13. package/dist/standalone/{chunk-DY7CLL2H.js → chunk-65OTWFS3.js} +1 -1
  14. package/dist/standalone/chunk-6DWCIIHE.js +1 -0
  15. package/dist/standalone/{chunk-IJFCOWEQ.js → chunk-7J5N6DGQ.js} +1 -1
  16. package/dist/standalone/{chunk-M7QCL3ZP.js → chunk-B43FTQJ7.js} +1 -1
  17. package/dist/standalone/{chunk-TCQEDMAQ.js → chunk-BNUJ7QMG.js} +1 -1
  18. package/dist/standalone/{chunk-RLEENOIX.js → chunk-C43X4M5U.js} +1 -1
  19. package/dist/standalone/{chunk-JGY4NGFW.js → chunk-D7XXWV4E.js} +1 -1
  20. package/dist/standalone/{chunk-4MSKCWUL.js → chunk-DVOBKIUX.js} +1 -1
  21. package/dist/standalone/{chunk-K7M4SMQ7.js → chunk-EKRN4ZQM.js} +1 -1
  22. package/dist/standalone/{chunk-IGBEXNXY.js → chunk-EVN46TVV.js} +1 -1
  23. package/dist/standalone/{chunk-NPIULIRO.js → chunk-EXFBIISG.js} +1 -1
  24. package/dist/standalone/{chunk-OZGWNJXD.js → chunk-F5QWLENA.js} +1 -1
  25. package/dist/standalone/chunk-F6GOKFMU.js +3 -0
  26. package/dist/standalone/{chunk-PYXZLNG2.js → chunk-FGTK44LR.js} +1 -1
  27. package/dist/standalone/{chunk-XBGJVK32.js → chunk-GSPTEMYN.js} +1 -1
  28. package/dist/standalone/{chunk-XITDHIVL.js → chunk-HP2UCWND.js} +1 -1
  29. package/dist/standalone/{chunk-WQTUQZUM.js → chunk-IDNNI63H.js} +1 -1
  30. package/dist/standalone/{chunk-ZKEVSU66.js → chunk-KDOC2DP5.js} +1 -1
  31. package/dist/standalone/{chunk-P4J3Z3SA.js → chunk-L7N7F3DA.js} +1 -1
  32. package/dist/standalone/{chunk-IPHXIGYP.js → chunk-LJDP7NRB.js} +1 -1
  33. package/dist/standalone/{chunk-GBQHGYGH.js → chunk-OHKRN65U.js} +1 -1
  34. package/dist/standalone/{chunk-LA3HEESS.js → chunk-P24JBHEZ.js} +1 -1
  35. package/dist/standalone/chunk-PWWHP76O.js +1 -0
  36. package/dist/standalone/{chunk-IUW24D4X.js → chunk-QGKAJTQQ.js} +1 -1
  37. package/dist/standalone/{chunk-AX4PAEGP.js → chunk-QVEHPYA5.js} +1 -1
  38. package/dist/standalone/{chunk-7YAUSG6S.js → chunk-QWJ3NPE3.js} +1 -1
  39. package/dist/standalone/{chunk-H3V2QQ4K.js → chunk-RAA2RGG6.js} +1 -1
  40. package/dist/standalone/chunk-RBU52M5T.js +1 -0
  41. package/dist/standalone/{chunk-RWZKO2P6.js → chunk-SA3MDZC3.js} +1 -1
  42. package/dist/standalone/{chunk-66TS6K5F.js → chunk-T2JIUFOD.js} +1 -1
  43. package/dist/standalone/chunk-TJ2WZ5OP.js +1 -0
  44. package/dist/standalone/{chunk-37RIZFJ4.js → chunk-TLHJRWNK.js} +1 -1
  45. package/dist/standalone/{chunk-YQP2EYOC.js → chunk-UIS34ZPB.js} +1 -1
  46. package/dist/standalone/{chunk-P4DHFWH7.js → chunk-VPAXCQ2Y.js} +1 -1
  47. package/dist/standalone/{chunk-V4RWA7QI.js → chunk-XEDU5FO4.js} +1 -1
  48. package/dist/standalone/{chunk-M2B3MDFJ.js → chunk-XQBTNJUQ.js} +1 -1
  49. package/dist/standalone/{chunk-OWADN6BI.js → chunk-XSD4Y6SQ.js} +1 -1
  50. package/dist/standalone/{chunk-BY4QROKU.js → chunk-YD5NF6UT.js} +1 -1
  51. package/dist/standalone/{chunk-DCJKCERP.js → chunk-YI3WYUXK.js} +1 -1
  52. package/dist/standalone/{chunk-26TQSVUV.js → chunk-ZNNAGR6N.js} +1 -1
  53. package/dist/standalone/studio.js +1 -1
  54. package/package.json +4 -4
  55. package/dist/standalone/chunk-3NHORZCK.js +0 -1
  56. package/dist/standalone/chunk-B5E7GQHG.js +0 -1
  57. package/dist/standalone/chunk-F6LUZVVI.js +0 -1
  58. package/dist/standalone/chunk-GHUPW2Y5.js +0 -1
  59. package/dist/standalone/chunk-LWECXQWP.js +0 -11
  60. package/dist/standalone/chunk-TRHTFGFW.js +0 -3
@@ -1,4 +1,4 @@
1
- "use client";import{a as Ye,b as fo}from"./chunk-GMR677FL.js";import{a as Cs,b as _s,c as Ns,f as ho}from"./chunk-XQGANNLS.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import"./chunk-KYF2E5CJ.js";import"./chunk-7YEFOSPH.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import{a as lr,b as cr,c as ys,d as xs,e as uo,g as ws,h as bs,i as Ut}from"./chunk-4UOFSGUS.js";import{e as hs}from"./chunk-SMIESS7P.js";import{a as Es}from"./chunk-LFKCLLPT.js";import{b as nu}from"./chunk-T6VMSOBB.js";import{a as io,b as so,c as ao,d as lo,e as co}from"./chunk-UZERI5YC.js";import{a as Ge}from"./chunk-5Y3QLNWX.js";import{e as ps,k as ms}from"./chunk-QBWRC5YX.js";import{a as Ss}from"./chunk-LFXFP4IF.js";import{b as vs}from"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as Mt}from"./chunk-CFPZYHPY.js";import{a as eu}from"./chunk-7QIFDWQV.js";import{c as Ie}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as qe}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as Nn}from"./chunk-GXZAXNZI.js";import{f as fs}from"./chunk-LWECXQWP.js";import"./chunk-XBDKZZ67.js";import{a as gs}from"./chunk-XQCVZAGU.js";import{d as It,f as En,g as Cn,h as _n,m as De}from"./chunk-4CGALXS3.js";import{b as us}from"./chunk-LE56LPNH.js";import{a as o,e as mt,f as ar,g as tu,h as ds,j as Zt}from"./chunk-3XIESWL4.js";var Be=mt(tu(),1);var re=mt(ar(),1);var z=mt(ds()),D=mt(ar());function ge(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=ge(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}o(ge,"cc");var ou={value:o(()=>{},"value")};function Ms(){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 po(n)}o(Ms,"dispatch");function po(e){this._=e}o(po,"Dispatch");function ru(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}o(ru,"parseTypenames");po.prototype=Ms.prototype={constructor:po,on:o(function(e,t){var n=this._,r=ru(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=iu(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Is(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Is(n[i],e.name,null);return this},"on"),copy:o(function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new po(e)},"copy"),call:o(function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},"call"),apply:o(function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)},"apply")};function iu(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}o(iu,"get");function Is(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=ou,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}o(Is,"set");var kt=Ms;var mo="http://www.w3.org/1999/xhtml",ur={svg:"http://www.w3.org/2000/svg",xhtml:mo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ze(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ur.hasOwnProperty(t)?{space:ur[t],local:e}:e}o(Ze,"default");function su(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===mo&&t.documentElement.namespaceURI===mo?t.createElement(e):t.createElementNS(n,e)}}o(su,"creatorInherit");function au(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}o(au,"creatorFixed");function In(e){var t=Ze(e);return(t.local?au:su)(t)}o(In,"default");function lu(){}o(lu,"none");function gt(e){return e==null?lu:function(){return this.querySelector(e)}}o(gt,"default");function dr(e){typeof e!="function"&&(e=gt(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=r[i]=new Array(a),c,u,d=0;d<a;++d)(c=s[d])&&(u=e.call(c,c.__data__,d,s))&&("__data__"in c&&(u.__data__=c.__data__),l[d]=u);return new ye(r,this._parents)}o(dr,"default");function fr(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}o(fr,"array");function cu(){return[]}o(cu,"empty");function qt(e){return e==null?cu:function(){return this.querySelectorAll(e)}}o(qt,"default");function uu(e){return function(){return fr(e.apply(this,arguments))}}o(uu,"arrayAll");function hr(e){typeof e=="function"?e=uu(e):e=qt(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],l=a.length,c,u=0;u<l;++u)(c=a[u])&&(r.push(e.call(c,c.__data__,u,a)),i.push(c));return new ye(r,i)}o(hr,"default");function Gt(e){return function(){return this.matches(e)}}o(Gt,"default");function go(e){return function(t){return t.matches(e)}}o(go,"childMatcher");var du=Array.prototype.find;function fu(e){return function(){return du.call(this.children,e)}}o(fu,"childFind");function hu(){return this.firstElementChild}o(hu,"childFirst");function pr(e){return this.select(e==null?hu:fu(typeof e=="function"?e:go(e)))}o(pr,"default");var pu=Array.prototype.filter;function mu(){return Array.from(this.children)}o(mu,"children");function gu(e){return function(){return pu.call(this.children,e)}}o(gu,"childrenFilter");function mr(e){return this.selectAll(e==null?mu:gu(typeof e=="function"?e:go(e)))}o(mr,"default");function gr(e){typeof e!="function"&&(e=Gt(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=r[i]=[],c,u=0;u<a;++u)(c=s[u])&&e.call(c,c.__data__,u,s)&&l.push(c);return new ye(r,this._parents)}o(gr,"default");function Mn(e){return new Array(e.length)}o(Mn,"default");function yr(){return new ye(this._enter||this._groups.map(Mn),this._parents)}o(yr,"default");function kn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}o(kn,"EnterNode");kn.prototype={constructor:kn,appendChild:o(function(e){return this._parent.insertBefore(e,this._next)},"appendChild"),insertBefore:o(function(e,t){return this._parent.insertBefore(e,t)},"insertBefore"),querySelector:o(function(e){return this._parent.querySelector(e)},"querySelector"),querySelectorAll:o(function(e){return this._parent.querySelectorAll(e)},"querySelectorAll")};function xr(e){return function(){return e}}o(xr,"default");function yu(e,t,n,r,i,s){for(var a=0,l,c=t.length,u=s.length;a<u;++a)(l=t[a])?(l.__data__=s[a],r[a]=l):n[a]=new kn(e,s[a]);for(;a<c;++a)(l=t[a])&&(i[a]=l)}o(yu,"bindIndex");function xu(e,t,n,r,i,s,a){var l,c,u=new Map,d=t.length,f=s.length,h=new Array(d),p;for(l=0;l<d;++l)(c=t[l])&&(h[l]=p=a.call(c,c.__data__,l,t)+"",u.has(p)?i[l]=c:u.set(p,c));for(l=0;l<f;++l)p=a.call(e,s[l],l,s)+"",(c=u.get(p))?(r[l]=c,c.__data__=s[l],u.delete(p)):n[l]=new kn(e,s[l]);for(l=0;l<d;++l)(c=t[l])&&u.get(h[l])===c&&(i[l]=c)}o(xu,"bindKey");function wu(e){return e.__data__}o(wu,"datum");function wr(e,t){if(!arguments.length)return Array.from(this,wu);var n=t?xu:yu,r=this._parents,i=this._groups;typeof e!="function"&&(e=xr(e));for(var s=i.length,a=new Array(s),l=new Array(s),c=new Array(s),u=0;u<s;++u){var d=r[u],f=i[u],h=f.length,p=bu(e.call(d,d&&d.__data__,u,r)),m=p.length,v=l[u]=new Array(m),b=a[u]=new Array(m),y=c[u]=new Array(h);n(d,f,v,b,y,p,t);for(var E=0,g=0,w,M;E<m;++E)if(w=v[E]){for(E>=g&&(g=E+1);!(M=b[g])&&++g<m;);w._next=M||null}}return a=new ye(a,r),a._enter=l,a._exit=c,a}o(wr,"default");function bu(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}o(bu,"arraylike");function br(){return new ye(this._exit||this._groups.map(Mn),this._parents)}o(br,"default");function vr(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}o(vr,"default");function Sr(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),l=new Array(i),c=0;c<a;++c)for(var u=n[c],d=r[c],f=u.length,h=l[c]=new Array(f),p,m=0;m<f;++m)(p=u[m]||d[m])&&(h[m]=p);for(;c<i;++c)l[c]=n[c];return new ye(l,this._parents)}o(Sr,"default");function Er(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}o(Er,"default");function Cr(e){e||(e=vu);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}o(t,"compareNode");for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],l=a.length,c=i[s]=new Array(l),u,d=0;d<l;++d)(u=a[d])&&(c[d]=u);c.sort(t)}return new ye(i,this._parents).order()}o(Cr,"default");function vu(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}o(vu,"ascending");function _r(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}o(_r,"default");function Nr(){return Array.from(this)}o(Nr,"default");function Ir(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}o(Ir,"default");function Mr(){let e=0;for(let t of this)++e;return e}o(Mr,"default");function kr(){return!this.node()}o(kr,"default");function Pr(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,l;s<a;++s)(l=i[s])&&e.call(l,l.__data__,s,i);return this}o(Pr,"default");function Su(e){return function(){this.removeAttribute(e)}}o(Su,"attrRemove");function Eu(e){return function(){this.removeAttributeNS(e.space,e.local)}}o(Eu,"attrRemoveNS");function Cu(e,t){return function(){this.setAttribute(e,t)}}o(Cu,"attrConstant");function _u(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}o(_u,"attrConstantNS");function Nu(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}o(Nu,"attrFunction");function Iu(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)}}o(Iu,"attrFunctionNS");function Tr(e,t){var n=Ze(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?Eu:Su:typeof t=="function"?n.local?Iu:Nu:n.local?_u:Cu)(n,t))}o(Tr,"default");function Pn(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}o(Pn,"default");function Mu(e){return function(){this.style.removeProperty(e)}}o(Mu,"styleRemove");function ku(e,t,n){return function(){this.style.setProperty(e,t,n)}}o(ku,"styleConstant");function Pu(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}o(Pu,"styleFunction");function Ar(e,t,n){return arguments.length>1?this.each((t==null?Mu:typeof t=="function"?Pu:ku)(e,t,n??"")):yt(this.node(),e)}o(Ar,"default");function yt(e,t){return e.style.getPropertyValue(t)||Pn(e).getComputedStyle(e,null).getPropertyValue(t)}o(yt,"styleValue");function Tu(e){return function(){delete this[e]}}o(Tu,"propertyRemove");function Au(e,t){return function(){this[e]=t}}o(Au,"propertyConstant");function Du(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}o(Du,"propertyFunction");function Dr(e,t){return arguments.length>1?this.each((t==null?Tu:typeof t=="function"?Du:Au)(e,t)):this.node()[e]}o(Dr,"default");function ks(e){return e.trim().split(/^|\s+/)}o(ks,"classArray");function zr(e){return e.classList||new Ps(e)}o(zr,"classList");function Ps(e){this._node=e,this._names=ks(e.getAttribute("class")||"")}o(Ps,"ClassList");Ps.prototype={add:o(function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},"add"),remove:o(function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},"remove"),contains:o(function(e){return this._names.indexOf(e)>=0},"contains")};function Ts(e,t){for(var n=zr(e),r=-1,i=t.length;++r<i;)n.add(t[r])}o(Ts,"classedAdd");function As(e,t){for(var n=zr(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}o(As,"classedRemove");function zu(e){return function(){Ts(this,e)}}o(zu,"classedTrue");function Ou(e){return function(){As(this,e)}}o(Ou,"classedFalse");function $u(e,t){return function(){(t.apply(this,arguments)?Ts:As)(this,e)}}o($u,"classedFunction");function Or(e,t){var n=ks(e+"");if(arguments.length<2){for(var r=zr(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?$u:t?zu:Ou)(n,t))}o(Or,"default");function Ru(){this.textContent=""}o(Ru,"textRemove");function Lu(e){return function(){this.textContent=e}}o(Lu,"textConstant");function Hu(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}o(Hu,"textFunction");function $r(e){return arguments.length?this.each(e==null?Ru:(typeof e=="function"?Hu:Lu)(e)):this.node().textContent}o($r,"default");function Bu(){this.innerHTML=""}o(Bu,"htmlRemove");function Vu(e){return function(){this.innerHTML=e}}o(Vu,"htmlConstant");function Fu(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}o(Fu,"htmlFunction");function Rr(e){return arguments.length?this.each(e==null?Bu:(typeof e=="function"?Fu:Vu)(e)):this.node().innerHTML}o(Rr,"default");function Wu(){this.nextSibling&&this.parentNode.appendChild(this)}o(Wu,"raise");function Lr(){return this.each(Wu)}o(Lr,"default");function Xu(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}o(Xu,"lower");function Hr(){return this.each(Xu)}o(Hr,"default");function Br(e){var t=typeof e=="function"?e:In(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}o(Br,"default");function Yu(){return null}o(Yu,"constantNull");function Vr(e,t){var n=typeof e=="function"?e:In(e),r=t==null?Yu:typeof t=="function"?t:gt(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}o(Vr,"default");function Zu(){var e=this.parentNode;e&&e.removeChild(this)}o(Zu,"remove");function Fr(){return this.each(Zu)}o(Fr,"default");function Uu(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}o(Uu,"selection_cloneShallow");function qu(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}o(qu,"selection_cloneDeep");function Wr(e){return this.select(e?qu:Uu)}o(Wr,"default");function Xr(e){return arguments.length?this.property("__data__",e):this.node().__data__}o(Xr,"default");function Gu(e){return function(t){e.call(this,t,this.__data__)}}o(Gu,"contextListener");function Ku(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}})}o(Ku,"parseTypenames");function Qu(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}o(Qu,"onRemove");function Ju(e,t,n){return function(){var r=this.__on,i,s=Gu(t);if(r){for(var a=0,l=r.length;a<l;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}o(Ju,"onAdd");function Yr(e,t,n){var r=Ku(e+""),i,s=r.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,u=l.length,d;c<u;++c)for(i=0,d=l[c];i<s;++i)if((a=r[i]).type===d.type&&a.name===d.name)return d.value}return}for(l=t?Ju:Qu,i=0;i<s;++i)this.each(l(r[i],t,n));return this}o(Yr,"default");function Ds(e,t,n){var r=Pn(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}o(Ds,"dispatchEvent");function ju(e,t){return function(){return Ds(this,e,t)}}o(ju,"dispatchConstant");function ed(e,t){return function(){return Ds(this,e,t.apply(this,arguments))}}o(ed,"dispatchFunction");function Zr(e,t){return this.each((typeof t=="function"?ed:ju)(e,t))}o(Zr,"default");function*Ur(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}o(Ur,"default");var qr=[null];function ye(e,t){this._groups=e,this._parents=t}o(ye,"Selection");function zs(){return new ye([[document.documentElement]],qr)}o(zs,"selection");function td(){return this}o(td,"selection_selection");ye.prototype=zs.prototype={constructor:ye,select:dr,selectAll:hr,selectChild:pr,selectChildren:mr,filter:gr,data:wr,enter:yr,exit:br,join:vr,merge:Sr,selection:td,order:Er,sort:Cr,call:_r,nodes:Nr,node:Ir,size:Mr,empty:kr,each:Pr,attr:Tr,style:Ar,property:Dr,classed:Or,text:$r,html:Rr,raise:Lr,lower:Hr,append:Br,insert:Vr,remove:Fr,clone:Wr,datum:Xr,on:Yr,dispatch:Zr,[Symbol.iterator]:Ur};var Ke=zs;function Ee(e){return typeof e=="string"?new ye([[document.querySelector(e)]],[document.documentElement]):new ye([[e]],qr)}o(Ee,"default");function Gr(e){let t;for(;t=e.sourceEvent;)e=t;return e}o(Gr,"default");function Me(e,t){if(e=Gr(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}o(Me,"default");var Os={passive:!1},Pt={capture:!0,passive:!1};function yo(e){e.stopImmediatePropagation()}o(yo,"nopropagation");function Qe(e){e.preventDefault(),e.stopImmediatePropagation()}o(Qe,"default");function Kt(e){var t=e.document.documentElement,n=Ee(e).on("dragstart.drag",Qe,Pt);"onselectstart"in t?n.on("selectstart.drag",Qe,Pt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}o(Kt,"default");function Tn(e,t){var n=e.document.documentElement,r=Ee(e).on("dragstart.drag",null);t&&(r.on("click.drag",Qe,Pt),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}o(Tn,"yesdrag");var An=o(e=>()=>e,"default");function Dn(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:s,x:a,y:l,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}o(Dn,"DragEvent");Dn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function nd(e){return!e.ctrlKey&&!e.button}o(nd,"defaultFilter");function od(){return this.parentNode}o(od,"defaultContainer");function rd(e,t){return t??{x:e.x,y:e.y}}o(rd,"defaultSubject");function id(){return navigator.maxTouchPoints||"ontouchstart"in this}o(id,"defaultTouchable");function zn(){var e=nd,t=od,n=rd,r=id,i={},s=kt("start","drag","end"),a=0,l,c,u,d,f=0;function h(w){w.on("mousedown.drag",p).filter(r).on("touchstart.drag",b).on("touchmove.drag",y,Os).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}o(h,"drag");function p(w,M){if(!(d||!e.call(this,w,M))){var _=g(this,t.call(this,w,M),w,M,"mouse");_&&(Ee(w.view).on("mousemove.drag",m,Pt).on("mouseup.drag",v,Pt),Kt(w.view),yo(w),u=!1,l=w.clientX,c=w.clientY,_("start",w))}}o(p,"mousedowned");function m(w){if(Qe(w),!u){var M=w.clientX-l,_=w.clientY-c;u=M*M+_*_>f}i.mouse("drag",w)}o(m,"mousemoved");function v(w){Ee(w.view).on("mousemove.drag mouseup.drag",null),Tn(w.view,u),Qe(w),i.mouse("end",w)}o(v,"mouseupped");function b(w,M){if(e.call(this,w,M)){var _=w.changedTouches,k=t.call(this,w,M),P=_.length,T,W;for(T=0;T<P;++T)(W=g(this,k,w,M,_[T].identifier,_[T]))&&(yo(w),W("start",w,_[T]))}}o(b,"touchstarted");function y(w){var M=w.changedTouches,_=M.length,k,P;for(k=0;k<_;++k)(P=i[M[k].identifier])&&(Qe(w),P("drag",w,M[k]))}o(y,"touchmoved");function E(w){var M=w.changedTouches,_=M.length,k,P;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),k=0;k<_;++k)(P=i[M[k].identifier])&&(yo(w),P("end",w,M[k]))}o(E,"touchended");function g(w,M,_,k,P,T){var W=s.copy(),$=Me(T||_,M),V,L,x;if((x=n.call(w,new Dn("beforestart",{sourceEvent:_,target:h,identifier:P,active:a,x:$[0],y:$[1],dx:0,dy:0,dispatch:W}),k))!=null)return V=x.x-$[0]||0,L=x.y-$[1]||0,o(function S(C,I,O){var A=$,B;switch(C){case"start":i[P]=S,B=a++;break;case"end":delete i[P],--a;case"drag":$=Me(O||I,M),B=a;break}W.call(C,w,new Dn(C,{sourceEvent:I,subject:x,target:h,identifier:P,active:B,x:$[0]+V,y:$[1]+L,dx:$[0]-A[0],dy:$[1]-A[1],dispatch:W}),k)},"gesture")}return o(g,"beforestart"),h.filter=function(w){return arguments.length?(e=typeof w=="function"?w:An(!!w),h):e},h.container=function(w){return arguments.length?(t=typeof w=="function"?w:An(w),h):t},h.subject=function(w){return arguments.length?(n=typeof w=="function"?w:An(w),h):n},h.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:An(!!w),h):r},h.on=function(){var w=s.on.apply(s,arguments);return w===s?h:w},h.clickDistance=function(w){return arguments.length?(f=(w=+w)*w,h):Math.sqrt(f)},h}o(zn,"default");var Qt=0,$n=0,On=0,Rs=1e3,xo,Rn,wo=0,Tt=0,bo=0,Ln=typeof performance=="object"&&performance.now?performance:Date,Ls=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Bn(){return Tt||(Ls(sd),Tt=Ln.now()+bo)}o(Bn,"now");function sd(){Tt=0}o(sd,"clearNow");function Hn(){this._call=this._time=this._next=null}o(Hn,"Timer");Hn.prototype=vo.prototype={constructor:Hn,restart:o(function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Bn():+n)+(t==null?0:+t),!this._next&&Rn!==this&&(Rn?Rn._next=this:xo=this,Rn=this),this._call=e,this._time=n,Kr()},"restart"),stop:o(function(){this._call&&(this._call=null,this._time=1/0,Kr())},"stop")};function vo(e,t,n){var r=new Hn;return r.restart(e,t,n),r}o(vo,"timer");function Hs(){Bn(),++Qt;for(var e=xo,t;e;)(t=Tt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Qt}o(Hs,"timerFlush");function $s(){Tt=(wo=Ln.now())+bo,Qt=$n=0;try{Hs()}finally{Qt=0,ld(),Tt=0}}o($s,"wake");function ad(){var e=Ln.now(),t=e-wo;t>Rs&&(bo-=t,wo=e)}o(ad,"poke");function ld(){for(var e,t=xo,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:xo=n);Rn=e,Kr(r)}o(ld,"nap");function Kr(e){if(!Qt){$n&&($n=clearTimeout($n));var t=e-Tt;t>24?(e<1/0&&($n=setTimeout($s,e-Ln.now()-bo)),On&&(On=clearInterval(On))):(On||(wo=Ln.now(),On=setInterval(ad,Rs)),Qt=1,Ls($s))}}o(Kr,"sleep");function Vn(e,t,n){var r=new Hn;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}o(Vn,"default");var cd=kt("start","end","cancel","interrupt"),ud=[],Fs=0,Bs=1,Eo=2,So=3,Vs=4,Co=5,Fn=6;function Je(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;dd(e,n,{name:t,index:r,group:i,on:cd,tween:ud,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Fs})}o(Je,"default");function Wn(e,t){var n=Ce(e,t);if(n.state>Fs)throw new Error("too late; already scheduled");return n}o(Wn,"init");function Ne(e,t){var n=Ce(e,t);if(n.state>So)throw new Error("too late; already running");return n}o(Ne,"set");function Ce(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}o(Ce,"get");function dd(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=vo(s,0,n.time);function s(u){n.state=Bs,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}o(s,"schedule");function a(u){var d,f,h,p;if(n.state!==Bs)return c();for(d in r)if(p=r[d],p.name===n.name){if(p.state===So)return Vn(a);p.state===Vs?(p.state=Fn,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+d<t&&(p.state=Fn,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[d])}if(Vn(function(){n.state===So&&(n.state=Vs,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=Eo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Eo){for(n.state=So,i=new Array(h=n.tween.length),d=0,f=-1;d<h;++d)(p=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}o(a,"start");function l(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(c),n.state=Co,1),f=-1,h=i.length;++f<h;)i[f].call(e,d);n.state===Co&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}o(l,"tick");function c(){n.state=Fn,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}o(c,"stop")}o(dd,"create");function xt(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>Eo&&r.state<Co,r.state=Fn,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}o(xt,"default");function Qr(e){return this.each(function(){xt(this,e)})}o(Qr,"default");function fd(e,t){var n,r;return function(){var i=Ne(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,l=r.length;a<l;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}o(fd,"tweenRemove");function hd(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=Ne(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var l={name:t,value:n},c=0,u=i.length;c<u;++c)if(i[c].name===t){i[c]=l;break}c===u&&i.push(l)}s.tween=i}}o(hd,"tweenFunction");function Jr(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ce(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?fd:hd)(n,e,t))}o(Jr,"default");function Jt(e,t,n){var r=e._id;return e.each(function(){var i=Ne(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ce(i,r).value[t]}}o(Jt,"tweenValue");function Xn(e,t){var n;return(typeof t=="number"?ys:t instanceof lr?cr:(n=lr(t))?(t=n,cr):xs)(e,t)}o(Xn,"default");function pd(e){return function(){this.removeAttribute(e)}}o(pd,"attrRemove");function md(e){return function(){this.removeAttributeNS(e.space,e.local)}}o(md,"attrRemoveNS");function gd(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}o(gd,"attrConstant");function yd(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}o(yd,"attrConstantNS");function xd(e,t,n){var r,i,s;return function(){var a,l=n(this),c;return l==null?void this.removeAttribute(e):(a=this.getAttribute(e),c=l+"",a===c?null:a===r&&c===i?s:(i=c,s=t(r=a,l)))}}o(xd,"attrFunction");function wd(e,t,n){var r,i,s;return function(){var a,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),c=l+"",a===c?null:a===r&&c===i?s:(i=c,s=t(r=a,l)))}}o(wd,"attrFunctionNS");function jr(e,t){var n=Ze(e),r=n==="transform"?bs:Xn;return this.attrTween(e,typeof t=="function"?(n.local?wd:xd)(n,r,Jt(this,"attr."+e,t)):t==null?(n.local?md:pd)(n):(n.local?yd:gd)(n,r,t))}o(jr,"default");function bd(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}o(bd,"attrInterpolate");function vd(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}o(vd,"attrInterpolateNS");function Sd(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&vd(e,s)),n}return o(i,"tween"),i._value=t,i}o(Sd,"attrTweenNS");function Ed(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&bd(e,s)),n}return o(i,"tween"),i._value=t,i}o(Ed,"attrTween");function ei(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=Ze(e);return this.tween(n,(r.local?Sd:Ed)(r,t))}o(ei,"default");function Cd(e,t){return function(){Wn(this,e).delay=+t.apply(this,arguments)}}o(Cd,"delayFunction");function _d(e,t){return t=+t,function(){Wn(this,e).delay=t}}o(_d,"delayConstant");function ti(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Cd:_d)(t,e)):Ce(this.node(),t).delay}o(ti,"default");function Nd(e,t){return function(){Ne(this,e).duration=+t.apply(this,arguments)}}o(Nd,"durationFunction");function Id(e,t){return t=+t,function(){Ne(this,e).duration=t}}o(Id,"durationConstant");function ni(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Nd:Id)(t,e)):Ce(this.node(),t).duration}o(ni,"default");function Md(e,t){if(typeof t!="function")throw new Error;return function(){Ne(this,e).ease=t}}o(Md,"easeConstant");function oi(e){var t=this._id;return arguments.length?this.each(Md(t,e)):Ce(this.node(),t).ease}o(oi,"default");function kd(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ne(this,e).ease=n}}o(kd,"easeVarying");function ri(e){if(typeof e!="function")throw new Error;return this.each(kd(this._id,e))}o(ri,"default");function ii(e){typeof e!="function"&&(e=Gt(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=r[i]=[],c,u=0;u<a;++u)(c=s[u])&&e.call(c,c.__data__,u,s)&&l.push(c);return new Ae(r,this._parents,this._name,this._id)}o(ii,"default");function si(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),l=0;l<s;++l)for(var c=t[l],u=n[l],d=c.length,f=a[l]=new Array(d),h,p=0;p<d;++p)(h=c[p]||u[p])&&(f[p]=h);for(;l<r;++l)a[l]=t[l];return new Ae(a,this._parents,this._name,this._id)}o(si,"default");function Pd(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}o(Pd,"start");function Td(e,t,n){var r,i,s=Pd(t)?Wn:Ne;return function(){var a=s(this,e),l=a.on;l!==r&&(i=(r=l).copy()).on(t,n),a.on=i}}o(Td,"onFunction");function ai(e,t){var n=this._id;return arguments.length<2?Ce(this.node(),n).on.on(e):this.each(Td(n,e,t))}o(ai,"default");function Ad(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}o(Ad,"removeFunction");function li(){return this.on("end.remove",Ad(this._id))}o(li,"default");function ci(e){var t=this._name,n=this._id;typeof e!="function"&&(e=gt(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var l=r[a],c=l.length,u=s[a]=new Array(c),d,f,h=0;h<c;++h)(d=l[h])&&(f=e.call(d,d.__data__,h,l))&&("__data__"in d&&(f.__data__=d.__data__),u[h]=f,Je(u[h],t,n,h,u,Ce(d,n)));return new Ae(s,this._parents,t,n)}o(ci,"default");function ui(e){var t=this._name,n=this._id;typeof e!="function"&&(e=qt(e));for(var r=this._groups,i=r.length,s=[],a=[],l=0;l<i;++l)for(var c=r[l],u=c.length,d,f=0;f<u;++f)if(d=c[f]){for(var h=e.call(d,d.__data__,f,c),p,m=Ce(d,n),v=0,b=h.length;v<b;++v)(p=h[v])&&Je(p,t,n,v,h,m);s.push(h),a.push(d)}return new Ae(s,a,t,n)}o(ui,"default");var Dd=Ke.prototype.constructor;function di(){return new Dd(this._groups,this._parents)}o(di,"default");function zd(e,t){var n,r,i;return function(){var s=yt(this,e),a=(this.style.removeProperty(e),yt(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}o(zd,"styleNull");function Ws(e){return function(){this.style.removeProperty(e)}}o(Ws,"styleRemove");function Od(e,t,n){var r,i=n+"",s;return function(){var a=yt(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}o(Od,"styleConstant");function $d(e,t,n){var r,i,s;return function(){var a=yt(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),yt(this,e))),a===c?null:a===r&&c===i?s:(i=c,s=t(r=a,l))}}o($d,"styleFunction");function Rd(e,t){var n,r,i,s="style."+t,a="end."+s,l;return function(){var c=Ne(this,e),u=c.on,d=c.value[s]==null?l||(l=Ws(t)):void 0;(u!==n||i!==d)&&(r=(n=u).copy()).on(a,i=d),c.on=r}}o(Rd,"styleMaybeRemove");function fi(e,t,n){var r=(e+="")=="transform"?ws:Xn;return t==null?this.styleTween(e,zd(e,r)).on("end.style."+e,Ws(e)):typeof t=="function"?this.styleTween(e,$d(e,r,Jt(this,"style."+e,t))).each(Rd(this._id,e)):this.styleTween(e,Od(e,r,t),n).on("end.style."+e,null)}o(fi,"default");function Ld(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}o(Ld,"styleInterpolate");function Hd(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Ld(e,a,n)),r}return o(s,"tween"),s._value=t,s}o(Hd,"styleTween");function hi(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,Hd(e,t,n??""))}o(hi,"default");function Bd(e){return function(){this.textContent=e}}o(Bd,"textConstant");function Vd(e){return function(){var t=e(this);this.textContent=t??""}}o(Vd,"textFunction");function pi(e){return this.tween("text",typeof e=="function"?Vd(Jt(this,"text",e)):Bd(e==null?"":e+""))}o(pi,"default");function Fd(e){return function(t){this.textContent=e.call(this,t)}}o(Fd,"textInterpolate");function Wd(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Fd(i)),t}return o(r,"tween"),r._value=e,r}o(Wd,"textTween");function mi(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,Wd(e))}o(mi,"default");function gi(){for(var e=this._name,t=this._id,n=_o(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],l=a.length,c,u=0;u<l;++u)if(c=a[u]){var d=Ce(c,t);Je(c,e,n,u,a,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Ae(r,this._parents,e,n)}o(gi,"default");function yi(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var l={value:a},c={value:o(function(){--i===0&&s()},"value")};n.each(function(){var u=Ne(this,r),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),u.on=t}),i===0&&s()})}o(yi,"default");var Xd=0;function Ae(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}o(Ae,"Transition");function Xs(e){return Ke().transition(e)}o(Xs,"transition");function _o(){return++Xd}o(_o,"newId");var je=Ke.prototype;Ae.prototype=Xs.prototype={constructor:Ae,select:ci,selectAll:ui,selectChild:je.selectChild,selectChildren:je.selectChildren,filter:ii,merge:si,selection:di,transition:gi,call:je.call,nodes:je.nodes,node:je.node,size:je.size,empty:je.empty,each:je.each,on:ai,attr:jr,attrTween:ei,style:fi,styleTween:hi,text:pi,textTween:mi,remove:li,tween:Jr,delay:ti,duration:ni,ease:oi,easeVarying:ri,end:yi,[Symbol.iterator]:je[Symbol.iterator]};function No(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}o(No,"cubicInOut");var Yd={time:null,delay:0,duration:250,ease:No};function Zd(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}o(Zd,"inherit");function xi(e){var t,n;e instanceof Ae?(t=e._id,e=e._name):(t=_o(),(n=Yd).time=Bn(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],l=a.length,c,u=0;u<l;++u)(c=a[u])&&Je(c,e,t,u,a,n||Zd(c,t));return new Ae(r,this._parents,e,t)}o(xi,"default");Ke.prototype.interrupt=Qr;Ke.prototype.transition=xi;var Yn=o(e=>()=>e,"default");function wi(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}o(wi,"ZoomEvent");function Ve(e,t,n){this.k=e,this.x=t,this.y=n}o(Ve,"Transform");Ve.prototype={constructor:Ve,scale:o(function(e){return e===1?this:new Ve(this.k*e,this.x,this.y)},"scale"),translate:o(function(e,t){return e===0&t===0?this:new Ve(this.k,this.x+this.k*e,this.y+this.k*t)},"translate"),apply:o(function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},"apply"),applyX:o(function(e){return e*this.k+this.x},"applyX"),applyY:o(function(e){return e*this.k+this.y},"applyY"),invert:o(function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},"invert"),invertX:o(function(e){return(e-this.x)/this.k},"invertX"),invertY:o(function(e){return(e-this.y)/this.k},"invertY"),rescaleX:o(function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},"rescaleX"),rescaleY:o(function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},"rescaleY"),toString:o(function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"},"toString")};var At=new Ve(1,0,0);Zn.prototype=Ve.prototype;function Zn(e){for(;!e.__zoom;)if(!(e=e.parentNode))return At;return e.__zoom}o(Zn,"transform");function Io(e){e.stopImmediatePropagation()}o(Io,"nopropagation");function Dt(e){e.preventDefault(),e.stopImmediatePropagation()}o(Dt,"default");function Ud(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}o(Ud,"defaultFilter");function qd(){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]]}o(qd,"defaultExtent");function Ys(){return this.__zoom||At}o(Ys,"defaultTransform");function Gd(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}o(Gd,"defaultWheelDelta");function Kd(){return navigator.maxTouchPoints||"ontouchstart"in this}o(Kd,"defaultTouchable");function Qd(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}o(Qd,"defaultConstrain");function Un(){var e=Ud,t=qd,n=Qd,r=Gd,i=Kd,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Ut,u=kt("start","zoom","end"),d,f,h,p=500,m=150,v=0,b=10;function y(x){x.property("__zoom",Ys).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",W).filter(i).on("touchstart.zoom",$).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}o(y,"zoom"),y.transform=function(x,S,C,I){var O=x.selection?x.selection():x;O.property("__zoom",Ys),x!==O?M(x,S,C,I):O.interrupt().each(function(){_(this,arguments).event(I).start().zoom(null,typeof S=="function"?S.apply(this,arguments):S).end()})},y.scaleBy=function(x,S,C,I){y.scaleTo(x,function(){var O=this.__zoom.k,A=typeof S=="function"?S.apply(this,arguments):S;return O*A},C,I)},y.scaleTo=function(x,S,C,I){y.transform(x,function(){var O=t.apply(this,arguments),A=this.__zoom,B=C==null?w(O):typeof C=="function"?C.apply(this,arguments):C,F=A.invert(B),H=typeof S=="function"?S.apply(this,arguments):S;return n(g(E(A,H),B,F),O,a)},C,I)},y.translateBy=function(x,S,C,I){y.transform(x,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),a)},null,I)},y.translateTo=function(x,S,C,I,O){y.transform(x,function(){var A=t.apply(this,arguments),B=this.__zoom,F=I==null?w(A):typeof I=="function"?I.apply(this,arguments):I;return n(At.translate(F[0],F[1]).scale(B.k).translate(typeof S=="function"?-S.apply(this,arguments):-S,typeof C=="function"?-C.apply(this,arguments):-C),A,a)},I,O)};function E(x,S){return S=Math.max(s[0],Math.min(s[1],S)),S===x.k?x:new Ve(S,x.x,x.y)}o(E,"scale");function g(x,S,C){var I=S[0]-C[0]*x.k,O=S[1]-C[1]*x.k;return I===x.x&&O===x.y?x:new Ve(x.k,I,O)}o(g,"translate");function w(x){return[(+x[0][0]+ +x[1][0])/2,(+x[0][1]+ +x[1][1])/2]}o(w,"centroid");function M(x,S,C,I){x.on("start.zoom",function(){_(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(I).end()}).tween("zoom",function(){var O=this,A=arguments,B=_(O,A).event(I),F=t.apply(O,A),H=C==null?w(F):typeof C=="function"?C.apply(O,A):C,U=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),Z=O.__zoom,X=typeof S=="function"?S.apply(O,A):S,j=c(Z.invert(H).concat(U/Z.k),X.invert(H).concat(U/X.k));return function(K){if(K===1)K=X;else{var R=j(K),Y=U/R[2];K=new Ve(Y,H[0]-R[0]*Y,H[1]-R[1]*Y)}B.zoom(null,K)}})}o(M,"schedule");function _(x,S,C){return!C&&x.__zooming||new k(x,S)}o(_,"gesture");function k(x,S){this.that=x,this.args=S,this.active=0,this.sourceEvent=null,this.extent=t.apply(x,S),this.taps=0}o(k,"Gesture"),k.prototype={event:o(function(x){return x&&(this.sourceEvent=x),this},"event"),start:o(function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},"start"),zoom:o(function(x,S){return this.mouse&&x!=="mouse"&&(this.mouse[1]=S.invert(this.mouse[0])),this.touch0&&x!=="touch"&&(this.touch0[1]=S.invert(this.touch0[0])),this.touch1&&x!=="touch"&&(this.touch1[1]=S.invert(this.touch1[0])),this.that.__zoom=S,this.emit("zoom"),this},"zoom"),end:o(function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},"end"),emit:o(function(x){var S=Ee(this.that).datum();u.call(x,this.that,new wi(x,{sourceEvent:this.sourceEvent,target:y,type:x,transform:this.that.__zoom,dispatch:u}),S)},"emit")};function P(x,...S){if(!e.apply(this,arguments))return;var C=_(this,S).event(x),I=this.__zoom,O=Math.max(s[0],Math.min(s[1],I.k*Math.pow(2,r.apply(this,arguments)))),A=Me(x);if(C.wheel)(C.mouse[0][0]!==A[0]||C.mouse[0][1]!==A[1])&&(C.mouse[1]=I.invert(C.mouse[0]=A)),clearTimeout(C.wheel);else{if(I.k===O)return;C.mouse=[A,I.invert(A)],xt(this),C.start()}Dt(x),C.wheel=setTimeout(B,m),C.zoom("mouse",n(g(E(I,O),C.mouse[0],C.mouse[1]),C.extent,a));function B(){C.wheel=null,C.end()}o(B,"wheelidled")}o(P,"wheeled");function T(x,...S){if(h||!e.apply(this,arguments))return;var C=x.currentTarget,I=_(this,S,!0).event(x),O=Ee(x.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",U,!0),A=Me(x,C),B=x.clientX,F=x.clientY;Kt(x.view),Io(x),I.mouse=[A,this.__zoom.invert(A)],xt(this),I.start();function H(Z){if(Dt(Z),!I.moved){var X=Z.clientX-B,j=Z.clientY-F;I.moved=X*X+j*j>v}I.event(Z).zoom("mouse",n(g(I.that.__zoom,I.mouse[0]=Me(Z,C),I.mouse[1]),I.extent,a))}o(H,"mousemoved");function U(Z){O.on("mousemove.zoom mouseup.zoom",null),Tn(Z.view,I.moved),Dt(Z),I.event(Z).end()}o(U,"mouseupped")}o(T,"mousedowned");function W(x,...S){if(e.apply(this,arguments)){var C=this.__zoom,I=Me(x.changedTouches?x.changedTouches[0]:x,this),O=C.invert(I),A=C.k*(x.shiftKey?.5:2),B=n(g(E(C,A),I,O),t.apply(this,S),a);Dt(x),l>0?Ee(this).transition().duration(l).call(M,B,I,x):Ee(this).call(y.transform,B,I,x)}}o(W,"dblclicked");function $(x,...S){if(e.apply(this,arguments)){var C=x.touches,I=C.length,O=_(this,S,x.changedTouches.length===I).event(x),A,B,F,H;for(Io(x),B=0;B<I;++B)F=C[B],H=Me(F,this),H=[H,this.__zoom.invert(H),F.identifier],O.touch0?!O.touch1&&O.touch0[2]!==H[2]&&(O.touch1=H,O.taps=0):(O.touch0=H,A=!0,O.taps=1+!!d);d&&(d=clearTimeout(d)),A&&(O.taps<2&&(f=H[0],d=setTimeout(function(){d=null},p)),xt(this),O.start())}}o($,"touchstarted");function V(x,...S){if(this.__zooming){var C=_(this,S).event(x),I=x.changedTouches,O=I.length,A,B,F,H;for(Dt(x),A=0;A<O;++A)B=I[A],F=Me(B,this),C.touch0&&C.touch0[2]===B.identifier?C.touch0[0]=F:C.touch1&&C.touch1[2]===B.identifier&&(C.touch1[0]=F);if(B=C.that.__zoom,C.touch1){var U=C.touch0[0],Z=C.touch0[1],X=C.touch1[0],j=C.touch1[1],K=(K=X[0]-U[0])*K+(K=X[1]-U[1])*K,R=(R=j[0]-Z[0])*R+(R=j[1]-Z[1])*R;B=E(B,Math.sqrt(K/R)),F=[(U[0]+X[0])/2,(U[1]+X[1])/2],H=[(Z[0]+j[0])/2,(Z[1]+j[1])/2]}else if(C.touch0)F=C.touch0[0],H=C.touch0[1];else return;C.zoom("touch",n(g(B,F,H),C.extent,a))}}o(V,"touchmoved");function L(x,...S){if(this.__zooming){var C=_(this,S).event(x),I=x.changedTouches,O=I.length,A,B;for(Io(x),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),A=0;A<O;++A)B=I[A],C.touch0&&C.touch0[2]===B.identifier?delete C.touch0:C.touch1&&C.touch1[2]===B.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&&(B=Me(B,this),Math.hypot(f[0]-B[0],f[1]-B[1])<b)){var F=Ee(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return o(L,"touchended"),y.wheelDelta=function(x){return arguments.length?(r=typeof x=="function"?x:Yn(+x),y):r},y.filter=function(x){return arguments.length?(e=typeof x=="function"?x:Yn(!!x),y):e},y.touchable=function(x){return arguments.length?(i=typeof x=="function"?x:Yn(!!x),y):i},y.extent=function(x){return arguments.length?(t=typeof x=="function"?x:Yn([[+x[0][0],+x[0][1]],[+x[1][0],+x[1][1]]]),y):t},y.scaleExtent=function(x){return arguments.length?(s[0]=+x[0],s[1]=+x[1],y):[s[0],s[1]]},y.translateExtent=function(x){return arguments.length?(a[0][0]=+x[0][0],a[1][0]=+x[1][0],a[0][1]=+x[0][1],a[1][1]=+x[1][1],y):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},y.constrain=function(x){return arguments.length?(n=x,y):n},y.duration=function(x){return arguments.length?(l=+x,y):l},y.interpolate=function(x){return arguments.length?(c=x,y):c},y.on=function(){var x=u.on.apply(u,arguments);return x===u?y:x},y.clickDistance=function(x){return arguments.length?(v=(x=+x)*x,y):Math.sqrt(v)},y.tapDistance=function(x){return arguments.length?(b=+x,y):b},y}o(Un,"default");var ze={error001:o((e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,"error001"),error002:o(()=>"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.","error002"),error003:o(e=>`Node type "${e}" not found. Using fallback type "default".`,"error003"),error004:o(()=>"The parent container needs a width and a height to render the graph.","error004"),error005:o(()=>"Only child nodes can use a parent extent.","error005"),error006:o(()=>"Can't create edge. An edge needs a source and a target.","error006"),error007:o(e=>`The old edge with id=${e} does not exist.`,"error007"),error009:o(e=>`Marker type "${e}" doesn't exist.`,"error009"),error008:o((e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,"error008"),error010:o(()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.","error010"),error011:o(e=>`Edge type "${e}" not found. Using fallback type "default".`,"error011"),error012:o(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.`,"error012"),error013:o((e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,"error013"),error014:o(()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.","error014"),error015:o(()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.","error015"),error016:o(e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`,"error016")},on=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ci=["Enter"," ","Escape"],_i={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":o(({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"node.a11yDescription.ariaLiveMessage"),"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"},vt;(function(e){e.Strict="strict",e.Loose="loose"})(vt||(vt={}));var et;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(et||(et={}));var zt;(function(e){e.Partial="partial",e.Full="full"})(zt||(zt={}));var Ni={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},Ue;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ue||(Ue={}));var tn;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(tn||(tn={}));var J;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(J||(J={}));var Zs={[J.Left]:J.Right,[J.Right]:J.Left,[J.Top]:J.Bottom,[J.Bottom]:J.Top};function Ii(e){return e===null?null:e?"valid":"invalid"}o(Ii,"getConnectionStatus");var Mi=o(e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,"isEdgeBase"),ia=o(e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),"isNodeBase"),ki=o(e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),"isInternalNodeBase");var Gn=o((e,t=[0,0])=>{let{width:n,height:r}=Fe(e),i=e.origin??t,s=n*i[0],a=r*i[1];return{x:e.position.x-s,y:e.position.y-a}},"getNodePositionWithOrigin"),Kn=o((e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=e.reduce((r,i)=>{let s=typeof i=="string",a=!t.nodeLookup&&!s?i:void 0;t.nodeLookup&&(a=s?t.nodeLookup.get(i):ki(i)?i:t.nodeLookup.get(i.id));let l=a?Po(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Do(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return zo(n)},"getNodesBounds"),rn=o((e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=Do(n,Po(i)),r=!0)}),r?zo(n):{x:0,y:0,width:0,height:0}},"getInternalNodesBounds"),To=o((e,t,[n,r,i]=[0,0,1],s=!1,a=!1)=>{let l=(t.x-n)/i,c=(t.y-r)/i,u=t.width/i,d=t.height/i,f=[];for(let h of e.values()){let{measured:p,selectable:m=!0,hidden:v=!1}=h;if(a&&!m||v)continue;let b=p.width??h.width??h.initialWidth??0,y=p.height??h.height??h.initialHeight??0,{x:E,y:g}=h.internals.positionAbsolute,w=ua(l,c,u,d,E,g,b,y),M=b*y,_=s&&w>0;(!h.internals.handleBounds||_||w>=M||h.dragging)&&f.push(h)}return f},"getNodesInside"),sa=o((e,t)=>{let n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))},"getConnectedEdges");function Jd(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{let s;if(t?.includeHiddenNodes){let{width:a,height:l}=Fe(i);s=a>0&&l>0}else s=!!(i.measured.width&&i.measured.height&&!i.hidden);s&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}o(Jd,"getFitViewNodes");async function aa({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:s},a){if(e.size===0)return!0;let l=Jd(e,a),c=rn(l),u=Lt(c,t,n,a?.minZoom??i,a?.maxZoom??s,a?.padding??.1);return await r.setViewport(u,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),!0}o(aa,"fitViewport");function Pi({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){let a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=a.origin??r,f=a.extent||i;if(a.extent==="parent"&&!a.expandParent)if(!l)s?.("005",ze.error005());else{let p=l.measured.width,m=l.measured.height;p&&m&&(f=[[c,u],[c+p,u+m]])}else l&&Rt(a.extent)&&(f=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);let h=Rt(f)?Ot(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&s?.("015",ze.error015()),{position:{x:h.x-c+(a.measured.width??0)*d[0],y:h.y-u+(a.measured.height??0)*d[1]},positionAbsolute:h}}o(Pi,"calculateNodePosition");async function la({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let s=new Set(e.map(h=>h.id)),a=[];for(let h of n){if(h.deletable===!1)continue;let p=s.has(h.id),m=!p&&h.parentId&&a.find(v=>v.id===h.parentId);(p||m)&&a.push(h)}let l=new Set(t.map(h=>h.id)),c=r.filter(h=>h.deletable!==!1),d=sa(a,c);for(let h of c)l.has(h.id)&&!d.find(m=>m.id===h.id)&&d.push(h);if(!i)return{edges:d,nodes:a};let f=await i({nodes:a,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:a}:{edges:[],nodes:[]}:f}o(la,"getElementsToRemove");var nn=o((e,t=0,n=1)=>Math.min(Math.max(e,t),n),"clamp"),Ot=o((e={x:0,y:0},t,n)=>({x:nn(e.x,t[0][0],t[1][0]-(n?.width??0)),y:nn(e.y,t[0][1],t[1][1]-(n?.height??0))}),"clampPosition");function ca(e,t,n){let{width:r,height:i}=Fe(n),{x:s,y:a}=n.internals.positionAbsolute;return Ot(e,[[s,a],[s+r,a+i]],t)}o(ca,"clampPositionToParent");var Us=o((e,t,n)=>e<t?nn(Math.abs(e-t),1,t)/t:e>n?-nn(Math.abs(e-n),1,t)/t:0,"calcAutoPanVelocity"),Ao=o((e,t,n=15,r=40)=>{let i=Us(e.x,r,t.width-r)*n,s=Us(e.y,r,t.height-r)*n;return[i,s]},"calcAutoPan"),Do=o((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)}),"getBoundsOfBoxes"),Ei=o(({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),"rectToBox"),zo=o(({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),"boxToRect"),sn=o((e,t=[0,0])=>{let{x:n,y:r}=ki(e)?e.internals.positionAbsolute:Gn(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},"nodeToRect"),Po=o((e,t=[0,0])=>{let{x:n,y:r}=ki(e)?e.internals.positionAbsolute:Gn(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},"nodeToBox"),Ti=o((e,t)=>zo(Do(Ei(e),Ei(t))),"getBoundsOfRects"),ua=o((e,t,n,r,i,s,a,l)=>{let c=Math.max(0,Math.min(e+n,i+a)-Math.max(e,i)),u=Math.max(0,Math.min(t+r,s+l)-Math.max(t,s));return Math.ceil(c*u)},"getRectsOverlappingArea"),Qn=o((e,t)=>ua(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),"getOverlappingArea"),Ai=o(e=>Le(e.width)&&Le(e.height)&&Le(e.x)&&Le(e.y),"isRectObject"),Le=o(e=>!isNaN(e)&&isFinite(e),"isNumeric"),Di=o((e,t)=>(n,r)=>{},"createDevWarn"),an=o((e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),"snapPosition"),ln=o(({x:e,y:t},[n,r,i],s=!1,a=[1,1])=>{let l={x:(e-n)/i,y:(t-r)/i};return s?an(l,a):l},"pointToRendererPoint"),$t=o(({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),"rendererPointToPoint");function jt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}o(jt,"parsePadding");function jd(e,t,n){if(typeof e=="string"||typeof e=="number"){let r=jt(e,n),i=jt(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){let r=jt(e.top??e.y??0,n),i=jt(e.bottom??e.y??0,n),s=jt(e.left??e.x??0,t),a=jt(e.right??e.x??0,t);return{top:r,right:a,bottom:i,left:s,x:s+a,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}o(jd,"parsePaddings");function ef(e,t,n,r,i,s){let{x:a,y:l}=$t(e,[t,n,r]),{x:c,y:u}=$t({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=i-c,f=s-u;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}o(ef,"calculateAppliedPaddings");var Lt=o((e,t,n,r,i,s)=>{let a=jd(s,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=nn(u,r,i),f=e.x+e.width/2,h=e.y+e.height/2,p=t/2-f*d,m=n/2-h*d,v=ef(e,p,m,d,t,n),b={left:Math.min(v.left-a.left,0),top:Math.min(v.top-a.top,0),right:Math.min(v.right-a.right,0),bottom:Math.min(v.bottom-a.bottom,0)};return{x:p-b.left+b.right,y:m-b.top+b.bottom,zoom:d}},"getViewportForBounds"),cn=o(()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,"isMacOs");function Rt(e){return e!=null&&e!=="parent"}o(Rt,"isCoordinateExtent");function Fe(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}o(Fe,"getNodeDimensions");function zi(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}o(zi,"nodeHasDimensions");function Oi(e,t={width:0,height:0},n,r,i){let s={...e},a=r.get(n);if(a){let l=a.origin||i;s.x+=a.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=a.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}o(Oi,"evaluateAbsolutePosition");function $i(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}o($i,"areSetsEqual");function da(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}o(da,"withResolvers");function fa(e){return{..._i,...e||{}}}o(fa,"mergeAriaLabelConfig");function qn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:s,y:a}=He(e),l=ln({x:s-(i?.left??0),y:a-(i?.top??0)},r),{x:c,y:u}=n?an(l,t):l;return{xSnapped:c,ySnapped:u,...l}}o(qn,"getPointerPosition");var Oo=o(e=>({width:e.offsetWidth,height:e.offsetHeight}),"getDimensions"),Ri=o(e=>e?.getRootNode?.()||window?.document,"getHostForElement"),tf=["INPUT","SELECT","TEXTAREA"];function Li(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:tf.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}o(Li,"isInputDOMNode");var Hi=o(e=>"clientX"in e,"isMouseEvent"),He=o((e,t)=>{let n=Hi(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},"getEventPosition"),qs=o((e,t,n,r,i)=>{let s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(a=>{let l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:i,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...Oo(a)}})},"getHandleBounds");function $o({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:a,targetControlY:l}){let c=e*.125+i*.375+a*.375+n*.125,u=t*.125+s*.375+l*.375+r*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}o($o,"getBezierEdgeCenter");function Mo(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}o(Mo,"calculateControlOffset");function Gs({pos:e,x1:t,y1:n,x2:r,y2:i,c:s}){switch(e){case J.Left:return[t-Mo(t-r,s),n];case J.Right:return[t+Mo(r-t,s),n];case J.Top:return[t,n-Mo(n-i,s)];case J.Bottom:return[t,n+Mo(i-n,s)]}}o(Gs,"getControlWithCurvature");function Ro({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:r,targetY:i,targetPosition:s=J.Top,curvature:a=.25}){let[l,c]=Gs({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[u,d]=Gs({pos:s,x1:r,y1:i,x2:e,y2:t,c:a}),[f,h,p,m]=$o({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${r},${i}`,f,h,p,m]}o(Ro,"getBezierPath");function Bi({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,s=n<e?n+i:n-i,a=Math.abs(r-t)/2,l=r<t?r+a:r-a;return[s,l,i,a]}o(Bi,"getEdgeCenter");function ha({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:s="basic"}){if(s==="manual")return r;let a=i&&n?r+1e3:r,l=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return a+l}o(ha,"getElevatedEdgeZIndex");function pa({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let s=Do(Po(e),Po(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);let a={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return Qn(a,zo(s))>0}o(pa,"isEdgeVisible");var nf=o(({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,"getEdgeId"),of=o((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)),"connectionExists"),ma=o((e,t,n={})=>{if(!e.source||!e.target)return n.onError?.("006",ze.error006()),t;let r=n.getEdgeId||nf,i;return Mi(e)?i={...e}:i={...e,id:r(e)},of(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))},"addEdge");function Lo({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,s,a,l]=Bi({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,s,a,l]}o(Lo,"getStraightPath");var Ks={[J.Left]:{x:-1,y:0},[J.Right]:{x:1,y:0},[J.Top]:{x:0,y:-1},[J.Bottom]:{x:0,y:1}},rf=o(({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},"getDirection"),Qs=o((e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)),"distance");function sf({source:e,sourcePosition:t=J.Bottom,target:n,targetPosition:r=J.Top,center:i,offset:s,stepPosition:a}){let l=Ks[t],c=Ks[r],u={x:e.x+l.x*s,y:e.y+l.y*s},d={x:n.x+c.x*s,y:n.y+c.y*s},f=rf({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h],m=[],v,b,y={x:0,y:0},E={x:0,y:0},[,,g,w]=Bi({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(v=i.x??u.x+(d.x-u.x)*a,b=i.y??(u.y+d.y)/2):(v=i.x??(u.x+d.x)/2,b=i.y??u.y+(d.y-u.y)*a);let P=[{x:v,y:u.y},{x:v,y:d.y}],T=[{x:u.x,y:b},{x:d.x,y:b}];l[h]===p?m=h==="x"?P:T:m=h==="x"?T:P}else{let P=[{x:u.x,y:d.y}],T=[{x:d.x,y:u.y}];if(h==="x"?m=l.x===p?T:P:m=l.y===p?P:T,t===r){let x=Math.abs(e[h]-n[h]);if(x<=s){let S=Math.min(s-1,s-x);l[h]===p?y[h]=(u[h]>e[h]?-1:1)*S:E[h]=(d[h]>n[h]?-1:1)*S}}if(t!==r){let x=h==="x"?"y":"x",S=l[h]===c[x],C=u[x]>d[x],I=u[x]<d[x];(l[h]===1&&(!S&&C||S&&I)||l[h]!==1&&(!S&&I||S&&C))&&(m=h==="x"?P:T)}let W={x:u.x+y.x,y:u.y+y.y},$={x:d.x+E.x,y:d.y+E.y},V=Math.max(Math.abs(W.x-m[0].x),Math.abs($.x-m[0].x)),L=Math.max(Math.abs(W.y-m[0].y),Math.abs($.y-m[0].y));V>=L?(v=(W.x+$.x)/2,b=m[0].y):(v=m[0].x,b=(W.y+$.y)/2)}let M={x:u.x+y.x,y:u.y+y.y},_={x:d.x+E.x,y:d.y+E.y};return[[e,...M.x!==m[0].x||M.y!==m[0].y?[M]:[],...m,..._.x!==m[m.length-1].x||_.y!==m[m.length-1].y?[_]:[],n],v,b,g,w]}o(sf,"getPoints");function af(e,t,n,r){let i=Math.min(Qs(e,t)/2,Qs(t,n)/2,r),{x:s,y:a}=t;if(e.x===s&&s===n.x||e.y===a&&a===n.y)return`L${s} ${a}`;if(e.y===a){let u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${s+i*u},${a}Q ${s},${a} ${s},${a+i*d}`}let l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${s},${a+i*c}Q ${s},${a} ${s+i*l},${a}`}o(af,"getBend");function Jn({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:r,targetY:i,targetPosition:s=J.Top,borderRadius:a=5,centerX:l,centerY:c,offset:u=20,stepPosition:d=.5}){let[f,h,p,m,v]=sf({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:l,y:c},offset:u,stepPosition:d}),b=`M${f[0].x} ${f[0].y}`;for(let y=1;y<f.length-1;y++)b+=af(f[y-1],f[y],f[y+1],a);return b+=`L${f[f.length-1].x} ${f[f.length-1].y}`,[b,h,p,m,v]}o(Jn,"getSmoothStepPath");function Js(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}o(Js,"isNodeInitialized");function ga(e){let{sourceNode:t,targetNode:n}=e;if(!Js(t)||!Js(n))return null;let r=t.internals.handleBounds||js(t.handles),i=n.internals.handleBounds||js(n.handles),s=ea(r?.source??[],e.sourceHandle),a=ea(e.connectionMode===vt.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!s||!a)return e.onError?.("008",ze.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let l=s?.position||J.Bottom,c=a?.position||J.Top,u=St(t,s,l),d=St(n,a,c);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:c}}o(ga,"getEdgePosition");function js(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}o(js,"toHandleBounds");function St(e,t,n=J.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,s=(t?.y??0)+e.internals.positionAbsolute.y,{width:a,height:l}=t??Fe(e);if(r)return{x:i+a/2,y:s+l/2};switch(t?.position??n){case J.Top:return{x:i+a/2,y:s};case J.Right:return{x:i+a,y:s+l/2};case J.Bottom:return{x:i+a/2,y:s+l};case J.Left:return{x:i,y:s+l/2}}}o(St,"getHandlePosition");function ea(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}o(ea,"getHandle$1");function Ho(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}o(Ho,"getMarkerId");function ya(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let s=new Set;return e.reduce((a,l)=>([l.markerStart||r,l.markerEnd||i].forEach(c=>{if(c&&typeof c=="object"){let u=Ho(c,t);s.has(u)||(a.push({id:u,color:c.color||n,...c}),s.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}o(ya,"createMarkerIds");var xa=1e3,lf=10,Vi={nodeOrigin:[0,0],nodeExtent:on,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},cf={...Vi,checkEquality:!0};function Fi(e,t){let n={...e};for(let r in t)t[r]!==void 0&&(n[r]=t[r]);return n}o(Fi,"mergeObjects");function wa(e,t,n){let r=Fi(Vi,n);for(let i of e.values())if(i.parentId)Xi(i,e,t,r);else{let s=Gn(i,r.nodeOrigin),a=Rt(i.extent)?i.extent:r.nodeExtent,l=Ot(s,a,Fe(i));i.internals.positionAbsolute=l}}o(wa,"updateAbsolutePositions");function uf(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let i of e.handles){let s={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(s):i.type==="target"&&r.push(s)}return{source:n,target:r}}o(uf,"parseHandles");function Wi(e){return e==="manual"}o(Wi,"isManualZIndexMode");function Bo(e,t,n,r={}){let i=Fi(cf,r),s={i:0},a=new Map(t),l=i?.elevateNodesOnSelect&&!Wi(i.zIndexMode)?xa:0,c=e.length>0,u=!1;t.clear(),n.clear();for(let d of e){let f=a.get(d.id);if(i.checkEquality&&d===f?.internals.userNode)t.set(d.id,f);else{let h=Gn(d,i.nodeOrigin),p=Rt(d.extent)?d.extent:i.nodeExtent,m=Ot(h,p,Fe(d));f={...i.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:m,handleBounds:uf(d,f),z:ba(d,l,i.zIndexMode),userNode:d}},t.set(d.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(c=!1),d.parentId&&Xi(f,t,n,r,s),u||=d.selected??!1}return{nodesInitialized:c,hasSelectedNodes:u}}o(Bo,"adoptUserNodes");function df(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}o(df,"updateParentLookup");function Xi(e,t,n,r,i){let{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=Fi(Vi,r),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}df(e,n),i&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++i.i,d.internals.z=d.internals.z+i.i*lf),i&&d.internals.rootParentIndex!==void 0&&(i.i=d.internals.rootParentIndex);let f=s&&!Wi(c)?xa:0,{x:h,y:p,z:m}=ff(e,d,a,l,f,c),{positionAbsolute:v}=e.internals,b=h!==v.x||p!==v.y;(b||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:h,y:p}:v,z:m}})}o(Xi,"updateChildNode");function ba(e,t,n){let r=Le(e.zIndex)?e.zIndex:0;return Wi(n)?r:r+(e.selected?t:0)}o(ba,"calculateZ");function ff(e,t,n,r,i,s){let{x:a,y:l}=t.internals.positionAbsolute,c=Fe(e),u=Gn(e,n),d=Rt(e.extent)?Ot(u,e.extent,c):u,f=Ot({x:a+d.x,y:l+d.y},r,c);e.extent==="parent"&&(f=ca(f,c,t));let h=ba(e,i,s),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}o(ff,"calculateChildXYZ");function Vo(e,t,n,r=[0,0]){let i=[],s=new Map;for(let a of e){let l=t.get(a.parentId);if(!l)continue;let c=s.get(a.parentId)?.expandedRect??sn(l),u=Ti(c,a.rect);s.set(a.parentId,{expandedRect:u,parent:l})}return s.size>0&&s.forEach(({expandedRect:a,parent:l},c)=>{let u=l.internals.positionAbsolute,d=Fe(l),f=l.origin??r,h=a.x<u.x?Math.round(Math.abs(u.x-a.x)):0,p=a.y<u.y?Math.round(Math.abs(u.y-a.y)):0,m=Math.max(d.width,Math.round(a.width)),v=Math.max(d.height,Math.round(a.height)),b=(m-d.width)*f[0],y=(v-d.height)*f[1];(h>0||p>0||b||y)&&(i.push({id:c,type:"position",position:{x:l.position.x-h+b,y:l.position.y-p+y}}),n.get(c)?.forEach(E=>{e.some(g=>g.id===E.id)||i.push({id:E.id,type:"position",position:{x:E.position.x+h,y:E.position.y+p}})})),(d.width<a.width||d.height<a.height||h||p)&&i.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:m+(h?f[0]*h-b:0),height:v+(p?f[1]*p-y:0)}})}),i}o(Vo,"handleExpandParent");function va(e,t,n,r,i,s,a){let l=r?.querySelector(".xyflow__viewport"),c=!1;if(!l)return{changes:[],updatedInternals:c};let u=[],d=window.getComputedStyle(l),{m22:f}=new window.DOMMatrixReadOnly(d.transform),h=[];for(let p of e.values()){let m=t.get(p.id);if(!m)continue;if(m.hidden){t.set(m.id,{...m,internals:{...m.internals,handleBounds:void 0}}),c=!0;continue}let v=Oo(p.nodeElement),b=m.measured.width!==v.width||m.measured.height!==v.height;if(!!(v.width&&v.height&&(b||!m.internals.handleBounds||p.force))){let E=p.nodeElement.getBoundingClientRect(),g=Rt(m.extent)?m.extent:s,{positionAbsolute:w}=m.internals;if(m.parentId&&m.extent==="parent"){let _=t.get(m.parentId);_&&(w=ca(w,v,_))}else g&&(w=Ot(w,g,v));let M={...m,measured:v,internals:{...m.internals,positionAbsolute:w,handleBounds:{source:qs("source",p.nodeElement,E,f,m.id),target:qs("target",p.nodeElement,E,f,m.id)}}};t.set(m.id,M),m.parentId&&Xi(M,t,n,{nodeOrigin:i,zIndexMode:a}),c=!0,b&&(u.push({id:m.id,type:"dimensions",dimensions:v}),m.expandParent&&m.parentId&&h.push({id:m.id,parentId:m.parentId,rect:sn(M,i)}))}}if(h.length>0){let p=Vo(h,t,n,i);u.push(...p)}return{changes:u,updatedInternals:c}}o(va,"updateNodeInternals");async function Sa({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:s}){if(!t||!e.x&&!e.y)return!1;let a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,s]],r);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}o(Sa,"panBy");function ta(e,t,n,r,i,s){let a=i,l=r.get(a)||new Map;r.set(a,l.set(n,t)),a=`${i}-${e}`;let c=r.get(a)||new Map;if(r.set(a,c.set(n,t)),s){a=`${i}-${e}-${s}`;let u=r.get(a)||new Map;r.set(a,u.set(n,t))}}o(ta,"addConnectionToLookup");function Yi(e,t,n){e.clear(),t.clear();for(let r of n){let{source:i,target:s,sourceHandle:a=null,targetHandle:l=null}=r,c={edgeId:r.id,source:i,target:s,sourceHandle:a,targetHandle:l},u=`${i}-${a}--${s}-${l}`,d=`${s}-${l}--${i}-${a}`;ta("source",c,d,e,i,a),ta("target",c,u,e,s,l),t.set(r.id,r)}}o(Yi,"updateConnectionLookup");function Ea(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:Ea(n,t):!1}o(Ea,"isParentSelected");function na(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}o(na,"hasSelector");function hf(e,t,n,r){let i=new Map;for(let[s,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!Ea(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){let l=e.get(s);l&&i.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}o(hf,"getDragItems");function bi({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[a,l]of t){let c=n.get(a)?.internals.userNode;c&&i.push({...c,position:l.position,dragging:r})}if(!e)return[i[0],i];let s=n.get(e)?.internals.userNode;return[s?{...s,position:t.get(e)?.position||s.position,dragging:r}:i[0],i]}o(bi,"getEventHandlerParams");function pf({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let s={x:n-i.distance.x,y:r-i.distance.y},a=an(s,t);return{x:a.x-s.x,y:a.y-s.y}}o(pf,"calculateSnapOffset");function Ca({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,v=null;function b({noDragClassName:E,handleSelector:g,domNode:w,isSelectable:M,nodeId:_,nodeClickDistance:k=0}){h=Ee(w);function P({x:V,y:L}){let{nodeLookup:x,nodeExtent:S,snapGrid:C,snapToGrid:I,nodeOrigin:O,onNodeDrag:A,onSelectionDrag:B,onError:F,updateNodePositions:H}=t();s={x:V,y:L};let U=!1,Z=l.size>1,X=Z&&S?Ei(rn(l)):null,j=Z&&I?pf({dragItems:l,snapGrid:C,x:V,y:L}):null;for(let[K,R]of l){if(!x.has(K))continue;let Y={x:V-R.distance.x,y:L-R.distance.y};I&&(Y=j?{x:Math.round(Y.x+j.x),y:Math.round(Y.y+j.y)}:an(Y,C));let te=null;if(Z&&S&&!R.extent&&X){let{positionAbsolute:G}=R.internals,ne=G.x-X.x+S[0][0],oe=G.x+R.measured.width-X.x2+S[1][0],se=G.y-X.y+S[0][1],le=G.y+R.measured.height-X.y2+S[1][1];te=[[ne,se],[oe,le]]}let{position:ee,positionAbsolute:q}=Pi({nodeId:K,nextPosition:Y,nodeLookup:x,nodeExtent:te||S,nodeOrigin:O,onError:F});U=U||R.position.x!==ee.x||R.position.y!==ee.y,R.position=ee,R.internals.positionAbsolute=q}if(m=m||U,!!U&&(H(l,!0),v&&(r||A||!_&&B))){let[K,R]=bi({nodeId:_,dragItems:l,nodeLookup:x});r?.(v,l,K,R),A?.(v,K,R),_||B?.(v,R)}}o(P,"updateNodes");async function T(){if(!d)return;let{transform:V,panBy:L,autoPanSpeed:x,autoPanOnNodeDrag:S}=t();if(!S){c=!1,cancelAnimationFrame(a);return}let[C,I]=Ao(u,d,x);(C!==0||I!==0)&&(s.x=(s.x??0)-C/V[2],s.y=(s.y??0)-I/V[2],await L({x:C,y:I})&&P(s)),a=requestAnimationFrame(T)}o(T,"autoPan");function W(V){let{nodeLookup:L,multiSelectionActive:x,nodesDraggable:S,transform:C,snapGrid:I,snapToGrid:O,selectNodesOnDrag:A,onNodeDragStart:B,onSelectionDragStart:F,unselectNodesAndEdges:H}=t();f=!0,(!A||!M)&&!x&&_&&(L.get(_)?.selected||H()),M&&A&&_&&e?.(_);let U=qn(V.sourceEvent,{transform:C,snapGrid:I,snapToGrid:O,containerBounds:d});if(s=U,l=hf(L,S,U,_),l.size>0&&(n||B||!_&&F)){let[Z,X]=bi({nodeId:_,dragItems:l,nodeLookup:L});n?.(V.sourceEvent,l,Z,X),B?.(V.sourceEvent,Z,X),_||F?.(V.sourceEvent,X)}}o(W,"startDrag");let $=zn().clickDistance(k).on("start",V=>{let{domNode:L,nodeDragThreshold:x,transform:S,snapGrid:C,snapToGrid:I}=t();d=L?.getBoundingClientRect()||null,p=!1,m=!1,v=V.sourceEvent,x===0&&W(V),s=qn(V.sourceEvent,{transform:S,snapGrid:C,snapToGrid:I,containerBounds:d}),u=He(V.sourceEvent,d)}).on("drag",V=>{let{autoPanOnNodeDrag:L,transform:x,snapGrid:S,snapToGrid:C,nodeDragThreshold:I,nodeLookup:O}=t(),A=qn(V.sourceEvent,{transform:x,snapGrid:S,snapToGrid:C,containerBounds:d});if(v=V.sourceEvent,(V.sourceEvent.type==="touchmove"&&V.sourceEvent.touches.length>1||_&&!O.has(_))&&(p=!0),!p){if(!c&&L&&f&&(c=!0,T()),!f){let B=He(V.sourceEvent,d),F=B.x-u.x,H=B.y-u.y;Math.sqrt(F*F+H*H)>I&&W(V)}(s.x!==A.xSnapped||s.y!==A.ySnapped)&&l&&f&&(u=He(V.sourceEvent,d),P(A))}}).on("end",V=>{if(!f||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){let{nodeLookup:L,updateNodePositions:x,onNodeDragStop:S,onSelectionDragStop:C}=t();if(m&&(x(l,!1),m=!1),i||S||!_&&C){let[I,O]=bi({nodeId:_,dragItems:l,nodeLookup:L,dragging:!1});i?.(V.sourceEvent,l,I,O),S?.(V.sourceEvent,I,O),_||C?.(V.sourceEvent,O)}}}).filter(V=>{let L=V.target;return!V.button&&(!E||!na(L,`.${E}`,w))&&(!g||na(L,g,w))});h.call($)}o(b,"update");function y(){h?.on(".drag",null)}return o(y,"destroy"),{update:b,destroy:y}}o(Ca,"XYDrag");function mf(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let s of t.values())Qn(i,sn(s))>0&&r.push(s);return r}o(mf,"getNodesWithinDistance");var gf=250;function yf(e,t,n,r){let i=[],s=1/0,a=mf(e,n,t+gf);for(let l of a){let c=[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]];for(let u of c){if(r.nodeId===u.nodeId&&r.type===u.type&&r.id===u.id)continue;let{x:d,y:f}=St(l,u,u.position,!0),h=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(f-e.y,2));h>t||(h<s?(i=[{...u,x:d,y:f}],s=h):h===s&&i.push({...u,x:d,y:f}))}}if(!i.length)return null;if(i.length>1){let l=r.type==="source"?"target":"source";return i.find(c=>c.type===l)??i[0]}return i[0]}o(yf,"getClosestHandle");function _a(e,t,n,r,i,s=!1){let a=r.get(e);if(!a)return null;let l=i==="strict"?a.internals.handleBounds?.[t]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],c=(n?l?.find(u=>u.id===n):l?.[0])??null;return c&&s?{...c,...St(a,c,c.position,!0)}:c}o(_a,"getHandle");function Na(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}o(Na,"getHandleType");function xf(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}o(xf,"isConnectionValid");var Ia=o(()=>!0,"alwaysValid");function wf(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:v,onConnectEnd:b,isValidConnection:y=Ia,onReconnectEnd:E,updateConnection:g,getTransform:w,getFromHandle:M,autoPanSpeed:_,dragThreshold:k=1,handleDomNode:P}){let T=Ri(e.target),W=0,$,{x:V,y:L}=He(e),x=Na(s,P),S=l?.getBoundingClientRect(),C=!1;if(!S||!x)return;let I=_a(i,x,r,c,t);if(!I)return;let O=He(e,S),A=!1,B=null,F=!1,H=null;function U(){if(!d||!S)return;let[ee,q]=Ao(O,S,_);h({x:ee,y:q}),W=requestAnimationFrame(U)}o(U,"autoPan");let Z={...I,nodeId:i,type:x,position:I.position},X=c.get(i),K={inProgress:!0,isValid:null,from:St(X,Z,J.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:X,to:O,toHandle:null,toPosition:Zs[Z.position],toNode:null,pointer:O};function R(){C=!0,g(K),m?.(e,{nodeId:i,handleId:r,handleType:x})}o(R,"startConnection"),k===0&&R();function Y(ee){if(!C){let{x:le,y:ve}=He(ee),he=le-V,pe=ve-L;if(!(he*he+pe*pe>k*k))return;R()}if(!M()||!Z){te(ee);return}let q=w();O=He(ee,S),$=yf(ln(O,q,!1,[1,1]),n,c,Z),A||(U(),A=!0);let G=Ma(ee,{handle:$,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:a?"target":"source",isValidConnection:y,doc:T,lib:u,flowId:f,nodeLookup:c});H=G.handleDomNode,B=G.connection,F=xf(!!$,G.isValid);let ne=c.get(i),oe=ne?St(ne,Z,J.Left,!0):K.from,se={...K,from:oe,isValid:F,to:G.toHandle&&F?$t({x:G.toHandle.x,y:G.toHandle.y},q):O,toHandle:G.toHandle,toPosition:F&&G.toHandle?G.toHandle.position:Zs[Z.position],toNode:G.toHandle?c.get(G.toHandle.nodeId):null,pointer:O};g(se),K=se}o(Y,"onPointerMove");function te(ee){if(!("touches"in ee&&ee.touches.length>0)){if(C){($||H)&&B&&F&&v?.(B);let{inProgress:q,...G}=K,ne={...G,toPosition:K.toHandle?K.toPosition:null};b?.(ee,ne),s&&E?.(ee,ne)}p(),cancelAnimationFrame(W),A=!1,F=!1,B=null,H=null,T.removeEventListener("mousemove",Y),T.removeEventListener("mouseup",te),T.removeEventListener("touchmove",Y),T.removeEventListener("touchend",te)}}o(te,"onPointerUp"),T.addEventListener("mousemove",Y),T.addEventListener("mouseup",te),T.addEventListener("touchmove",Y),T.addEventListener("touchend",te)}o(wf,"onPointerDown");function Ma(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:a,lib:l,flowId:c,isValidConnection:u=Ia,nodeLookup:d}){let f=s==="target",h=t?a.querySelector(`.${l}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=He(e),v=a.elementFromPoint(p,m),b=v?.classList.contains(`${l}-flow__handle`)?v:h,y={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){let E=Na(void 0,b),g=b.getAttribute("data-nodeid"),w=b.getAttribute("data-handleid"),M=b.classList.contains("connectable"),_=b.classList.contains("connectableend");if(!g||!E)return y;let k={source:f?g:r,sourceHandle:f?w:i,target:f?r:g,targetHandle:f?i:w};y.connection=k;let T=M&&_&&(n===vt.Strict?f&&E==="source"||!f&&E==="target":g!==r||w!==i);y.isValid=T&&u(k),y.toHandle=_a(g,E,w,d,n,!0)}return y}o(Ma,"isValidHandle");var Fo={onPointerDown:wf,isValid:Ma};function ka({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=Ee(e);function s({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){let m=o(g=>{if(g.sourceEvent.type!=="wheel"||!t)return;let w=n(),M=g.sourceEvent.ctrlKey&&cn()?10:1,_=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*d,k=w[2]*Math.pow(2,_*M);t.scaleTo(k)},"zoomHandler"),v=[0,0],b=o(g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(v=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},"panStartHandler"),y=o(g=>{let w=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;let M=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],_=[M[0]-v[0],M[1]-v[1]];v=M;let k=r()*Math.max(w[2],Math.log(w[2]))*(p?-1:1),P={x:w[0]-_[0]*k,y:w[1]-_[1]*k},T=[[0,0],[c,u]];t.setViewportConstrained({x:P.x,y:P.y,zoom:w[2]},T,l)},"panHandler"),E=Un().on("start",b).on("zoom",f?y:null).on("zoom.wheel",h?m:null);i.call(E,{})}o(s,"update");function a(){i.on("zoom",null)}return o(a,"destroy"),{update:s,destroy:a,pointer:Me}}o(ka,"XYMinimap");var Wo=o(e=>({x:e.x,y:e.y,zoom:e.k}),"transformToViewport"),vi=o(({x:e,y:t,zoom:n})=>At.translate(e,t).scale(n),"viewportToTransform"),en=o((e,t)=>e.target.closest(`.${t}`),"isWrappedWithClass"),Pa=o((e,t)=>t===2&&Array.isArray(e)&&e.includes(2),"isRightClickPan"),bf=o(e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,"defaultEase"),Si=o((e,t=0,n=bf,r=()=>{})=>{let i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},"getD3Transition"),Ta=o(e=>{let t=e.ctrlKey&&cn()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},"wheelDelta");function vf({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(en(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();let f=n.property("__zoom").k||1;if(d.ctrlKey&&a){let b=Me(d),y=Ta(d),E=f*Math.pow(2,y);r.scaleTo(n,E,b,d);return}let h=d.deltaMode===1?20:1,p=i===et.Vertical?0:d.deltaX*h,m=i===et.Horizontal?0:d.deltaY*h;!cn()&&d.shiftKey&&i!==et.Vertical&&(p=d.deltaY*h,m=0),r.translateBy(n,-(p/f)*s,-(m/f)*s,{internal:!0});let v=Wo(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(d,v):(e.isPanScrolling=!0,l?.(d,v)),e.panScrollTimeout=setTimeout(()=>{u?.(d,v),e.isPanScrolling=!1},150)}}o(vf,"createPanOnScrollHandler");function Sf({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let s=r.type==="wheel",a=!t&&s&&!r.ctrlKey,l=en(r,e);if(r.ctrlKey&&s&&l&&r.preventDefault(),a||l)return null;r.preventDefault(),n.call(this,r,i)}}o(Sf,"createZoomOnScrollHandler");function Ef({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=Wo(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,i)}}o(Ef,"createPanZoomStartHandler");function Cf({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{e.usedRightMouseButton=!!(n&&Pa(t,e.mouseButton??0)),s.sourceEvent?.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!s.sourceEvent?.internal&&i?.(s.sourceEvent,Wo(s.transform))}}o(Cf,"createPanZoomHandler");function _f({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return a=>{if(!a.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,s&&Pa(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let l=Wo(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(a.sourceEvent,l)},n?150:0)}}}o(_f,"createPanZoomEndHandler");function Nf({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{let h=e||t,p=n&&f.ctrlKey,m=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(en(f,`${u}-flow__node`)||en(f,`${u}-flow__edge`)))return!0;if(!r&&!h&&!i&&!s&&!n||a||d&&!m||en(f,l)&&m||en(f,c)&&(!m||i&&m&&!e)||!n&&f.ctrlKey&&m)return!1;if(!n&&f.type==="touchstart"&&f.touches?.length>1)return f.preventDefault(),!1;if(!h&&!i&&!p&&m||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;let v=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m)&&v}}o(Nf,"createFilter");function Aa({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:c}){let u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=[[0,0],[d.width,d.height]];(typeof ResizeObserver<"u"?new ResizeObserver(L=>{let x=L[0];x&&(f=[[0,0],[x.contentRect.width,x.contentRect.height]])}):null)?.observe(e);let p=Un().extent(()=>f).scaleExtent([t,n]).translateExtent(r),m=Ee(e).call(p);w({x:i.x,y:i.y,zoom:nn(i.zoom,t,n)},[[0,0],[d.width,d.height]],r);let v=m.on("wheel.zoom"),b=m.on("dblclick.zoom");p.wheelDelta(Ta);async function y(L,x){return m?new Promise(S=>{p?.interpolate(x?.interpolate==="linear"?uo:Ut).transform(Si(m,x?.duration,x?.ease,()=>S(!0)),L)}):!1}o(y,"setTransform");function E({noWheelClassName:L,noPanClassName:x,onPaneContextMenu:S,userSelectionActive:C,panOnScroll:I,panOnDrag:O,panOnScrollMode:A,panOnScrollSpeed:B,preventScrolling:F,zoomOnPinch:H,zoomOnScroll:U,zoomOnDoubleClick:Z,zoomActivationKeyPressed:X,lib:j,onTransformChange:K,connectionInProgress:R,paneClickDistance:Y,selectionOnDrag:te}){C&&!u.isZoomingOrPanning&&g();let ee=I&&!X&&!C;p.clickDistance(te?1/0:!Le(Y)||Y<0?0:Y);let q=ee?vf({zoomPanValues:u,noWheelClassName:L,d3Selection:m,d3Zoom:p,panOnScrollMode:A,panOnScrollSpeed:B,zoomOnPinch:H,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:l}):Sf({noWheelClassName:L,preventScrolling:F,d3ZoomHandler:v});m.on("wheel.zoom",q,{passive:!1});let G=Ef({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});p.on("start",G);let ne=Cf({zoomPanValues:u,panOnDrag:O,onPaneContextMenu:!!S,onPanZoom:s,onTransformChange:K});p.on("zoom",ne);let oe=_f({zoomPanValues:u,panOnDrag:O,panOnScroll:I,onPaneContextMenu:S,onPanZoomEnd:l,onDraggingChange:c});p.on("end",oe);let se=Nf({zoomActivationKeyPressed:X,panOnDrag:O,zoomOnScroll:U,panOnScroll:I,zoomOnDoubleClick:Z,zoomOnPinch:H,userSelectionActive:C,noPanClassName:x,noWheelClassName:L,lib:j,connectionInProgress:R});p.filter(se),Z?m.on("dblclick.zoom",b):m.on("dblclick.zoom",null)}o(E,"update");function g(){p.on("zoom",null)}o(g,"destroy");async function w(L,x,S){let C=vi(L),I=p?.constrain()(C,x,S);return I&&await y(I),I}o(w,"setViewportConstrained");async function M(L,x){let S=vi(L);return await y(S,x),S}o(M,"setViewport");function _(L){if(m){let x=vi(L),S=m.property("__zoom");(S.k!==L.zoom||S.x!==L.x||S.y!==L.y)&&p?.transform(m,x,null,{sync:!0})}}o(_,"syncViewport");function k(){let L=m?Zn(m.node()):{x:0,y:0,k:1};return{x:L.x,y:L.y,zoom:L.k}}o(k,"getViewport");async function P(L,x){return m?new Promise(S=>{p?.interpolate(x?.interpolate==="linear"?uo:Ut).scaleTo(Si(m,x?.duration,x?.ease,()=>S(!0)),L)}):!1}o(P,"scaleTo");async function T(L,x){return m?new Promise(S=>{p?.interpolate(x?.interpolate==="linear"?uo:Ut).scaleBy(Si(m,x?.duration,x?.ease,()=>S(!0)),L)}):!1}o(T,"scaleBy");function W(L){p?.scaleExtent(L)}o(W,"setScaleExtent");function $(L){p?.translateExtent(L)}o($,"setTranslateExtent");function V(L){let x=!Le(L)||L<0?0:L;p?.clickDistance(x)}return o(V,"setClickDistance"),{update:E,destroy:g,setViewport:M,setViewportConstrained:w,getViewport:k,scaleTo:P,scaleBy:T,setScaleExtent:W,setTranslateExtent:$,syncViewport:_,setClickDistance:V}}o(Aa,"XYPanZoom");var Et;(function(e){e.Line="line",e.Handle="handle"})(Et||(Et={}));function If({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:s}){let a=e-t,l=n-r,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&i&&(c[0]=c[0]*-1),l&&s&&(c[1]=c[1]*-1),c}o(If,"getResizeDirection");function oa(e){let t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}o(oa,"getControlDirection");function wt(e,t){return Math.max(0,t-e)}o(wt,"getLowerExtentClamp");function bt(e,t){return Math.max(0,e-t)}o(bt,"getUpperExtentClamp");function ko(e,t,n){return Math.max(0,t-e,e-n)}o(ko,"getSizeClamp");function ra(e,t){return e?!t:t}o(ra,"xor");function Mf(e,t,n,r,i,s,a,l){let{affectsX:c,affectsY:u}=t,{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:v,maxWidth:b,minHeight:y,maxHeight:E}=r,{x:g,y:w,width:M,height:_,aspectRatio:k}=e,P=Math.floor(d?p-e.pointerX:0),T=Math.floor(f?m-e.pointerY:0),W=M+(c?-P:P),$=_+(u?-T:T),V=-s[0]*M,L=-s[1]*_,x=ko(W,v,b),S=ko($,y,E);if(a){let O=0,A=0;c&&P<0?O=wt(g+P+V,a[0][0]):!c&&P>0&&(O=bt(g+W+V,a[1][0])),u&&T<0?A=wt(w+T+L,a[0][1]):!u&&T>0&&(A=bt(w+$+L,a[1][1])),x=Math.max(x,O),S=Math.max(S,A)}if(l){let O=0,A=0;c&&P>0?O=bt(g+P,l[0][0]):!c&&P<0&&(O=wt(g+W,l[1][0])),u&&T>0?A=bt(w+T,l[0][1]):!u&&T<0&&(A=wt(w+$,l[1][1])),x=Math.max(x,O),S=Math.max(S,A)}if(i){if(d){let O=ko(W/k,y,E)*k;if(x=Math.max(x,O),a){let A=0;!c&&!u||c&&!u&&h?A=bt(w+L+W/k,a[1][1])*k:A=wt(w+L+(c?P:-P)/k,a[0][1])*k,x=Math.max(x,A)}if(l){let A=0;!c&&!u||c&&!u&&h?A=wt(w+W/k,l[1][1])*k:A=bt(w+(c?P:-P)/k,l[0][1])*k,x=Math.max(x,A)}}if(f){let O=ko($*k,v,b)/k;if(S=Math.max(S,O),a){let A=0;!c&&!u||u&&!c&&h?A=bt(g+$*k+V,a[1][0])/k:A=wt(g+(u?T:-T)*k+V,a[0][0])/k,S=Math.max(S,A)}if(l){let A=0;!c&&!u||u&&!c&&h?A=wt(g+$*k,l[1][0])/k:A=bt(g+(u?T:-T)*k,l[0][0])/k,S=Math.max(S,A)}}}T=T+(T<0?S:-S),P=P+(P<0?x:-x),i&&(h?W>$*k?T=(ra(c,u)?-P:P)/k:P=(ra(c,u)?-T:T)*k:d?(T=P/k,u=c):(P=T*k,c=u));let C=c?g+P:g,I=u?w+T:w;return{width:M+(c?-P:P),height:_+(u?-T:T),x:s[0]*P*(c?-1:1)+C,y:s[1]*T*(u?-1:1)+I}}o(Mf,"getDimensionsAfterResize");var Da={width:0,height:0,x:0,y:0},kf={...Da,pointerX:0,pointerY:0,aspectRatio:1};function Pf(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,s=e.measured.width??0,a=e.measured.height??0,l=n[0]*s,c=n[1]*a;return[[r-l,i-c],[r+s-l,i+a-c]]}o(Pf,"nodeToChildExtent");function za({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let s=Ee(e),a={controlDirection:oa("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:p,onResize:m,onResizeEnd:v,shouldResize:b}){let y={...Da},E={...kf};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:oa(u)};let g,w=null,M=[],_,k,P,T=!1,W=zn().on("start",$=>{let{nodeLookup:V,transform:L,snapGrid:x,snapToGrid:S,nodeOrigin:C,paneDomNode:I}=n();if(g=V.get(t),!g)return;w=I?.getBoundingClientRect()??null;let{xSnapped:O,ySnapped:A}=qn($.sourceEvent,{transform:L,snapGrid:x,snapToGrid:S,containerBounds:w});y={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},E={...y,pointerX:O,pointerY:A,aspectRatio:y.width/y.height},_=void 0,k=Rt(g.extent)?g.extent:void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(_=V.get(g.parentId)),_&&g.extent==="parent"&&(k=[[0,0],[_.measured.width,_.measured.height]]),M=[],P=void 0;for(let[B,F]of V)if(F.parentId===t&&(M.push({id:B,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){let H=Pf(F,g,F.origin??C);P?P=[[Math.min(H[0][0],P[0][0]),Math.min(H[0][1],P[0][1])],[Math.max(H[1][0],P[1][0]),Math.max(H[1][1],P[1][1])]]:P=H}p?.($,{...y})}).on("drag",$=>{let{transform:V,snapGrid:L,snapToGrid:x,nodeOrigin:S}=n(),C=qn($.sourceEvent,{transform:V,snapGrid:L,snapToGrid:x,containerBounds:w}),I=[];if(!g)return;let{x:O,y:A,width:B,height:F}=y,H={},U=g.origin??S,{width:Z,height:X,x:j,y:K}=Mf(E,a.controlDirection,C,a.boundaries,a.keepAspectRatio,U,k,P),R=Z!==B,Y=X!==F,te=j!==O&&R,ee=K!==A&&Y;if(!te&&!ee&&!R&&!Y)return;if((te||ee||U[0]===1||U[1]===1)&&(H.x=te?j:y.x,H.y=ee?K:y.y,y.x=H.x,y.y=H.y,M.length>0)){let oe=j-O,se=K-A;for(let le of M)le.position={x:le.position.x-oe+U[0]*(Z-B),y:le.position.y-se+U[1]*(X-F)},I.push(le)}if((R||Y)&&(H.width=R&&(!a.resizeDirection||a.resizeDirection==="horizontal")?Z:y.width,H.height=Y&&(!a.resizeDirection||a.resizeDirection==="vertical")?X:y.height,y.width=H.width,y.height=H.height),_&&g.expandParent){let oe=U[0]*(H.width??0);H.x&&H.x<oe&&(y.x=oe,E.x=E.x-(H.x-oe));let se=U[1]*(H.height??0);H.y&&H.y<se&&(y.y=se,E.y=E.y-(H.y-se))}let q=If({width:y.width,prevWidth:B,height:y.height,prevHeight:F,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),G={...y,direction:q};b?.($,G)!==!1&&(T=!0,m?.($,G),r(H,I))}).on("end",$=>{T&&(v?.($,{...y}),i?.({...y}),T=!1)});s.call(W)}o(l,"update");function c(){s.on(".drag",null)}return o(c,"destroy"),{update:l,destroy:c}}o(za,"XYResizer");var La=mt(ar(),1),Ha=mt(nu(),1);var Oa=o(e=>{let t,n=new Set,r=o((d,f)=>{let h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){let p=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(m=>m(t,p))}},"setState"),i=o(()=>t,"getState"),c={setState:r,getState:i,getInitialState:o(()=>u,"getInitialState"),subscribe:o(d=>(n.add(d),()=>n.delete(d)),"subscribe"),destroy:o(()=>{(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()},"destroy")},u=t=e(r,i,c);return c},"createStoreImpl"),$a=o(e=>e?Oa(e):Oa,"createStore");var{useDebugValue:Tf}=La.default,{useSyncExternalStoreWithSelector:Af}=Ha.default,Df=o(e=>e,"identity");function Zi(e,t=Df,n){let r=Af(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Tf(r),r}o(Zi,"useStoreWithEqualityFn");var Ra=o((e,t)=>{let n=$a(e),r=o((i,s=t)=>Zi(n,i,s),"useBoundStoreWithEqualityFn");return Object.assign(r,n),r},"createWithEqualityFnImpl"),Ba=o((e,t)=>e?Ra(e,t):Ra,"createWithEqualityFn");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(let[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}o(ue,"shallow$1");var zf=mt(eu());var Uo=(0,D.createContext)(null),Of=Uo.Provider,hl=ze.error001("react");function ie(e,t){let n=(0,D.useContext)(Uo);if(n===null)throw new Error(hl);return Zi(n,e,t)}o(ie,"useStore");function de(){let e=(0,D.useContext)(Uo);if(e===null)throw new Error(hl);return(0,D.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}o(de,"useStoreApi");var Va={display:"none"},$f={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},pl="react-flow__node-desc",ml="react-flow__edge-desc",Rf="react-flow__aria-live",Lf=o(e=>e.ariaLiveMessage,"ariaLiveSelector"),Hf=o(e=>e.ariaLabelConfig,"ariaLabelConfigSelector");function Bf({rfId:e}){let t=ie(Lf);return(0,z.jsx)("div",{id:`${Rf}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:$f,children:t})}o(Bf,"AriaLiveMessage");function Vf({rfId:e,disableKeyboardA11y:t}){let n=ie(Hf);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)("div",{id:`${pl}-${e}`,style:Va,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,z.jsx)("div",{id:`${ml}-${e}`,style:Va,children:n["edge.a11yDescription.default"]}),!t&&(0,z.jsx)(Bf,{rfId:e})]})}o(Vf,"A11yDescriptions");var _t=(0,D.forwardRef)(({position:e="top-left",children:t,className:n,style:r,...i},s)=>{let a=`${e}`.split("-");return(0,z.jsx)("div",{className:ge(["react-flow__panel",n,...a]),style:r,ref:s,...i,children:t})});_t.displayName="Panel";var Fa="https://reactflow.dev?utm_source=attribution";function Ff({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:(0,z.jsx)(_t,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Fa}`,children:(0,z.jsx)("a",{href:Fa,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}o(Ff,"Attribution");var Wf=o(e=>{let t=[],n=[];for(let[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(let[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},"selector$l"),Xo=o(e=>e.id,"selectId");function Xf(e,t){return ue(e.selectedNodes.map(Xo),t.selectedNodes.map(Xo))&&ue(e.selectedEdges.map(Xo),t.selectedEdges.map(Xo))}o(Xf,"areEqual$1");function Yf({onSelectionChange:e}){let t=de(),{selectedNodes:n,selectedEdges:r}=ie(Wf,Xf);return(0,D.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(s=>s(i))},[n,r,e]),null}o(Yf,"SelectionListenerInner");var Zf=o(e=>!!e.onSelectionChangeHandlers,"changeSelector");function Uf({onSelectionChange:e}){let t=ie(Zf);return e||t?(0,z.jsx)(Yf,{onSelectionChange:e}):null}o(Uf,"SelectionListener");var gl=[0,0],qf={x:0,y:0,zoom:1},Gf=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Wa=[...Gf,"rfId"],Kf=o(e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),"selector$k"),Xa={translateExtent:on,nodeOrigin:gl,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Qf(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:c}=ie(Kf,ue),u=de();(0,D.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=Xa,l()}),[]);let d=(0,D.useRef)(Xa);return(0,D.useEffect)(()=>{for(let f of Wa){let h=e[f],p=d.current[f];h!==p&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?r(h):f==="maxZoom"?i(h):f==="translateExtent"?s(h):f==="nodeExtent"?a(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:fa(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},Wa.map(f=>e[f])),null}o(Qf,"StoreUpdater");function Ya(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}o(Ya,"getMediaQuery");function Jf(e){let[t,n]=(0,D.useState)(e==="system"?null:e);return(0,D.useEffect)(()=>{if(e!=="system"){n(e);return}let r=Ya(),i=o(()=>n(r?.matches?"dark":"light"),"updateColorModeClass");return i(),r?.addEventListener("change",i),()=>{r?.removeEventListener("change",i)}},[e]),t!==null?t:Ya()?.matches?"dark":"light"}o(Jf,"useColorModeClass");var Za=typeof document<"u"?document:null;function jn(e=null,t={target:Za,actInsideInputWithModifier:!0}){let[n,r]=(0,D.useState)(!1),i=(0,D.useRef)(!1),s=(0,D.useRef)(new Set([])),[a,l]=(0,D.useMemo)(()=>{if(e!==null){let u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",`
1
+ "use client";import{a as Ye,b as fo}from"./chunk-GMR677FL.js";import{a as Cs,b as _s,c as Ns,f as ho}from"./chunk-XQGANNLS.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import"./chunk-KYF2E5CJ.js";import"./chunk-7YEFOSPH.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import{a as lr,b as cr,c as ys,d as xs,e as uo,g as ws,h as bs,i as Ut}from"./chunk-4UOFSGUS.js";import{e as hs}from"./chunk-SMIESS7P.js";import{a as Es}from"./chunk-LFKCLLPT.js";import{b as nu}from"./chunk-T6VMSOBB.js";import{a as io,b as so,c as ao,d as lo,e as co}from"./chunk-UZERI5YC.js";import{a as Ge}from"./chunk-5Y3QLNWX.js";import{e as ps,k as ms}from"./chunk-QBWRC5YX.js";import{a as Ss}from"./chunk-LFXFP4IF.js";import{b as vs}from"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as Mt}from"./chunk-CFPZYHPY.js";import{a as eu}from"./chunk-7QIFDWQV.js";import{c as Ie}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as qe}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as Nn}from"./chunk-GXZAXNZI.js";import{f as fs}from"./chunk-35II7U25.js";import"./chunk-XBDKZZ67.js";import{a as gs}from"./chunk-XQCVZAGU.js";import{d as It,f as En,g as Cn,h as _n,m as De}from"./chunk-4CGALXS3.js";import{b as us}from"./chunk-LE56LPNH.js";import{a as o,e as mt,f as ar,g as tu,h as ds,j as Zt}from"./chunk-3XIESWL4.js";var Be=mt(tu(),1);var re=mt(ar(),1);var z=mt(ds()),D=mt(ar());function ge(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=ge(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}o(ge,"cc");var ou={value:o(()=>{},"value")};function Ms(){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 po(n)}o(Ms,"dispatch");function po(e){this._=e}o(po,"Dispatch");function ru(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}o(ru,"parseTypenames");po.prototype=Ms.prototype={constructor:po,on:o(function(e,t){var n=this._,r=ru(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=iu(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Is(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Is(n[i],e.name,null);return this},"on"),copy:o(function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new po(e)},"copy"),call:o(function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},"call"),apply:o(function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)},"apply")};function iu(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}o(iu,"get");function Is(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=ou,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}o(Is,"set");var kt=Ms;var mo="http://www.w3.org/1999/xhtml",ur={svg:"http://www.w3.org/2000/svg",xhtml:mo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ze(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),ur.hasOwnProperty(t)?{space:ur[t],local:e}:e}o(Ze,"default");function su(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===mo&&t.documentElement.namespaceURI===mo?t.createElement(e):t.createElementNS(n,e)}}o(su,"creatorInherit");function au(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}o(au,"creatorFixed");function In(e){var t=Ze(e);return(t.local?au:su)(t)}o(In,"default");function lu(){}o(lu,"none");function gt(e){return e==null?lu:function(){return this.querySelector(e)}}o(gt,"default");function dr(e){typeof e!="function"&&(e=gt(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=r[i]=new Array(a),c,u,d=0;d<a;++d)(c=s[d])&&(u=e.call(c,c.__data__,d,s))&&("__data__"in c&&(u.__data__=c.__data__),l[d]=u);return new ye(r,this._parents)}o(dr,"default");function fr(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}o(fr,"array");function cu(){return[]}o(cu,"empty");function qt(e){return e==null?cu:function(){return this.querySelectorAll(e)}}o(qt,"default");function uu(e){return function(){return fr(e.apply(this,arguments))}}o(uu,"arrayAll");function hr(e){typeof e=="function"?e=uu(e):e=qt(e);for(var t=this._groups,n=t.length,r=[],i=[],s=0;s<n;++s)for(var a=t[s],l=a.length,c,u=0;u<l;++u)(c=a[u])&&(r.push(e.call(c,c.__data__,u,a)),i.push(c));return new ye(r,i)}o(hr,"default");function Gt(e){return function(){return this.matches(e)}}o(Gt,"default");function go(e){return function(t){return t.matches(e)}}o(go,"childMatcher");var du=Array.prototype.find;function fu(e){return function(){return du.call(this.children,e)}}o(fu,"childFind");function hu(){return this.firstElementChild}o(hu,"childFirst");function pr(e){return this.select(e==null?hu:fu(typeof e=="function"?e:go(e)))}o(pr,"default");var pu=Array.prototype.filter;function mu(){return Array.from(this.children)}o(mu,"children");function gu(e){return function(){return pu.call(this.children,e)}}o(gu,"childrenFilter");function mr(e){return this.selectAll(e==null?mu:gu(typeof e=="function"?e:go(e)))}o(mr,"default");function gr(e){typeof e!="function"&&(e=Gt(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=r[i]=[],c,u=0;u<a;++u)(c=s[u])&&e.call(c,c.__data__,u,s)&&l.push(c);return new ye(r,this._parents)}o(gr,"default");function Mn(e){return new Array(e.length)}o(Mn,"default");function yr(){return new ye(this._enter||this._groups.map(Mn),this._parents)}o(yr,"default");function kn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}o(kn,"EnterNode");kn.prototype={constructor:kn,appendChild:o(function(e){return this._parent.insertBefore(e,this._next)},"appendChild"),insertBefore:o(function(e,t){return this._parent.insertBefore(e,t)},"insertBefore"),querySelector:o(function(e){return this._parent.querySelector(e)},"querySelector"),querySelectorAll:o(function(e){return this._parent.querySelectorAll(e)},"querySelectorAll")};function xr(e){return function(){return e}}o(xr,"default");function yu(e,t,n,r,i,s){for(var a=0,l,c=t.length,u=s.length;a<u;++a)(l=t[a])?(l.__data__=s[a],r[a]=l):n[a]=new kn(e,s[a]);for(;a<c;++a)(l=t[a])&&(i[a]=l)}o(yu,"bindIndex");function xu(e,t,n,r,i,s,a){var l,c,u=new Map,d=t.length,f=s.length,h=new Array(d),p;for(l=0;l<d;++l)(c=t[l])&&(h[l]=p=a.call(c,c.__data__,l,t)+"",u.has(p)?i[l]=c:u.set(p,c));for(l=0;l<f;++l)p=a.call(e,s[l],l,s)+"",(c=u.get(p))?(r[l]=c,c.__data__=s[l],u.delete(p)):n[l]=new kn(e,s[l]);for(l=0;l<d;++l)(c=t[l])&&u.get(h[l])===c&&(i[l]=c)}o(xu,"bindKey");function wu(e){return e.__data__}o(wu,"datum");function wr(e,t){if(!arguments.length)return Array.from(this,wu);var n=t?xu:yu,r=this._parents,i=this._groups;typeof e!="function"&&(e=xr(e));for(var s=i.length,a=new Array(s),l=new Array(s),c=new Array(s),u=0;u<s;++u){var d=r[u],f=i[u],h=f.length,p=bu(e.call(d,d&&d.__data__,u,r)),m=p.length,v=l[u]=new Array(m),b=a[u]=new Array(m),y=c[u]=new Array(h);n(d,f,v,b,y,p,t);for(var E=0,g=0,w,M;E<m;++E)if(w=v[E]){for(E>=g&&(g=E+1);!(M=b[g])&&++g<m;);w._next=M||null}}return a=new ye(a,r),a._enter=l,a._exit=c,a}o(wr,"default");function bu(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}o(bu,"arraylike");function br(){return new ye(this._exit||this._groups.map(Mn),this._parents)}o(br,"default");function vr(e,t,n){var r=this.enter(),i=this,s=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(i=t(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}o(vr,"default");function Sr(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,s=r.length,a=Math.min(i,s),l=new Array(i),c=0;c<a;++c)for(var u=n[c],d=r[c],f=u.length,h=l[c]=new Array(f),p,m=0;m<f;++m)(p=u[m]||d[m])&&(h[m]=p);for(;c<i;++c)l[c]=n[c];return new ye(l,this._parents)}o(Sr,"default");function Er(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,s=r[i],a;--i>=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}o(Er,"default");function Cr(e){e||(e=vu);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}o(t,"compareNode");for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var a=n[s],l=a.length,c=i[s]=new Array(l),u,d=0;d<l;++d)(u=a[d])&&(c[d]=u);c.sort(t)}return new ye(i,this._parents).order()}o(Cr,"default");function vu(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}o(vu,"ascending");function _r(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}o(_r,"default");function Nr(){return Array.from(this)}o(Nr,"default");function Ir(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length;i<s;++i){var a=r[i];if(a)return a}return null}o(Ir,"default");function Mr(){let e=0;for(let t of this)++e;return e}o(Mr,"default");function kr(){return!this.node()}o(kr,"default");function Pr(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],s=0,a=i.length,l;s<a;++s)(l=i[s])&&e.call(l,l.__data__,s,i);return this}o(Pr,"default");function Su(e){return function(){this.removeAttribute(e)}}o(Su,"attrRemove");function Eu(e){return function(){this.removeAttributeNS(e.space,e.local)}}o(Eu,"attrRemoveNS");function Cu(e,t){return function(){this.setAttribute(e,t)}}o(Cu,"attrConstant");function _u(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}o(_u,"attrConstantNS");function Nu(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}o(Nu,"attrFunction");function Iu(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)}}o(Iu,"attrFunctionNS");function Tr(e,t){var n=Ze(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?Eu:Su:typeof t=="function"?n.local?Iu:Nu:n.local?_u:Cu)(n,t))}o(Tr,"default");function Pn(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}o(Pn,"default");function Mu(e){return function(){this.style.removeProperty(e)}}o(Mu,"styleRemove");function ku(e,t,n){return function(){this.style.setProperty(e,t,n)}}o(ku,"styleConstant");function Pu(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}o(Pu,"styleFunction");function Ar(e,t,n){return arguments.length>1?this.each((t==null?Mu:typeof t=="function"?Pu:ku)(e,t,n??"")):yt(this.node(),e)}o(Ar,"default");function yt(e,t){return e.style.getPropertyValue(t)||Pn(e).getComputedStyle(e,null).getPropertyValue(t)}o(yt,"styleValue");function Tu(e){return function(){delete this[e]}}o(Tu,"propertyRemove");function Au(e,t){return function(){this[e]=t}}o(Au,"propertyConstant");function Du(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}o(Du,"propertyFunction");function Dr(e,t){return arguments.length>1?this.each((t==null?Tu:typeof t=="function"?Du:Au)(e,t)):this.node()[e]}o(Dr,"default");function ks(e){return e.trim().split(/^|\s+/)}o(ks,"classArray");function zr(e){return e.classList||new Ps(e)}o(zr,"classList");function Ps(e){this._node=e,this._names=ks(e.getAttribute("class")||"")}o(Ps,"ClassList");Ps.prototype={add:o(function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},"add"),remove:o(function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},"remove"),contains:o(function(e){return this._names.indexOf(e)>=0},"contains")};function Ts(e,t){for(var n=zr(e),r=-1,i=t.length;++r<i;)n.add(t[r])}o(Ts,"classedAdd");function As(e,t){for(var n=zr(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}o(As,"classedRemove");function zu(e){return function(){Ts(this,e)}}o(zu,"classedTrue");function Ou(e){return function(){As(this,e)}}o(Ou,"classedFalse");function $u(e,t){return function(){(t.apply(this,arguments)?Ts:As)(this,e)}}o($u,"classedFunction");function Or(e,t){var n=ks(e+"");if(arguments.length<2){for(var r=zr(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t=="function"?$u:t?zu:Ou)(n,t))}o(Or,"default");function Ru(){this.textContent=""}o(Ru,"textRemove");function Lu(e){return function(){this.textContent=e}}o(Lu,"textConstant");function Hu(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}o(Hu,"textFunction");function $r(e){return arguments.length?this.each(e==null?Ru:(typeof e=="function"?Hu:Lu)(e)):this.node().textContent}o($r,"default");function Bu(){this.innerHTML=""}o(Bu,"htmlRemove");function Vu(e){return function(){this.innerHTML=e}}o(Vu,"htmlConstant");function Fu(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}o(Fu,"htmlFunction");function Rr(e){return arguments.length?this.each(e==null?Bu:(typeof e=="function"?Fu:Vu)(e)):this.node().innerHTML}o(Rr,"default");function Wu(){this.nextSibling&&this.parentNode.appendChild(this)}o(Wu,"raise");function Lr(){return this.each(Wu)}o(Lr,"default");function Xu(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}o(Xu,"lower");function Hr(){return this.each(Xu)}o(Hr,"default");function Br(e){var t=typeof e=="function"?e:In(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}o(Br,"default");function Yu(){return null}o(Yu,"constantNull");function Vr(e,t){var n=typeof e=="function"?e:In(e),r=t==null?Yu:typeof t=="function"?t:gt(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}o(Vr,"default");function Zu(){var e=this.parentNode;e&&e.removeChild(this)}o(Zu,"remove");function Fr(){return this.each(Zu)}o(Fr,"default");function Uu(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}o(Uu,"selection_cloneShallow");function qu(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}o(qu,"selection_cloneDeep");function Wr(e){return this.select(e?qu:Uu)}o(Wr,"default");function Xr(e){return arguments.length?this.property("__data__",e):this.node().__data__}o(Xr,"default");function Gu(e){return function(t){e.call(this,t,this.__data__)}}o(Gu,"contextListener");function Ku(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}})}o(Ku,"parseTypenames");function Qu(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n<i;++n)s=t[n],(!e.type||s.type===e.type)&&s.name===e.name?this.removeEventListener(s.type,s.listener,s.options):t[++r]=s;++r?t.length=r:delete this.__on}}}o(Qu,"onRemove");function Ju(e,t,n){return function(){var r=this.__on,i,s=Gu(t);if(r){for(var a=0,l=r.length;a<l;++a)if((i=r[a]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=t;return}}this.addEventListener(e.type,s,n),i={type:e.type,name:e.name,value:t,listener:s,options:n},r?r.push(i):this.__on=[i]}}o(Ju,"onAdd");function Yr(e,t,n){var r=Ku(e+""),i,s=r.length,a;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,u=l.length,d;c<u;++c)for(i=0,d=l[c];i<s;++i)if((a=r[i]).type===d.type&&a.name===d.name)return d.value}return}for(l=t?Ju:Qu,i=0;i<s;++i)this.each(l(r[i],t,n));return this}o(Yr,"default");function Ds(e,t,n){var r=Pn(e),i=r.CustomEvent;typeof i=="function"?i=new i(t,n):(i=r.document.createEvent("Event"),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}o(Ds,"dispatchEvent");function ju(e,t){return function(){return Ds(this,e,t)}}o(ju,"dispatchConstant");function ed(e,t){return function(){return Ds(this,e,t.apply(this,arguments))}}o(ed,"dispatchFunction");function Zr(e,t){return this.each((typeof t=="function"?ed:ju)(e,t))}o(Zr,"default");function*Ur(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,s=r.length,a;i<s;++i)(a=r[i])&&(yield a)}o(Ur,"default");var qr=[null];function ye(e,t){this._groups=e,this._parents=t}o(ye,"Selection");function zs(){return new ye([[document.documentElement]],qr)}o(zs,"selection");function td(){return this}o(td,"selection_selection");ye.prototype=zs.prototype={constructor:ye,select:dr,selectAll:hr,selectChild:pr,selectChildren:mr,filter:gr,data:wr,enter:yr,exit:br,join:vr,merge:Sr,selection:td,order:Er,sort:Cr,call:_r,nodes:Nr,node:Ir,size:Mr,empty:kr,each:Pr,attr:Tr,style:Ar,property:Dr,classed:Or,text:$r,html:Rr,raise:Lr,lower:Hr,append:Br,insert:Vr,remove:Fr,clone:Wr,datum:Xr,on:Yr,dispatch:Zr,[Symbol.iterator]:Ur};var Ke=zs;function Ee(e){return typeof e=="string"?new ye([[document.querySelector(e)]],[document.documentElement]):new ye([[e]],qr)}o(Ee,"default");function Gr(e){let t;for(;t=e.sourceEvent;)e=t;return e}o(Gr,"default");function Me(e,t){if(e=Gr(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}o(Me,"default");var Os={passive:!1},Pt={capture:!0,passive:!1};function yo(e){e.stopImmediatePropagation()}o(yo,"nopropagation");function Qe(e){e.preventDefault(),e.stopImmediatePropagation()}o(Qe,"default");function Kt(e){var t=e.document.documentElement,n=Ee(e).on("dragstart.drag",Qe,Pt);"onselectstart"in t?n.on("selectstart.drag",Qe,Pt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}o(Kt,"default");function Tn(e,t){var n=e.document.documentElement,r=Ee(e).on("dragstart.drag",null);t&&(r.on("click.drag",Qe,Pt),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}o(Tn,"yesdrag");var An=o(e=>()=>e,"default");function Dn(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:s,x:a,y:l,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}o(Dn,"DragEvent");Dn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function nd(e){return!e.ctrlKey&&!e.button}o(nd,"defaultFilter");function od(){return this.parentNode}o(od,"defaultContainer");function rd(e,t){return t??{x:e.x,y:e.y}}o(rd,"defaultSubject");function id(){return navigator.maxTouchPoints||"ontouchstart"in this}o(id,"defaultTouchable");function zn(){var e=nd,t=od,n=rd,r=id,i={},s=kt("start","drag","end"),a=0,l,c,u,d,f=0;function h(w){w.on("mousedown.drag",p).filter(r).on("touchstart.drag",b).on("touchmove.drag",y,Os).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}o(h,"drag");function p(w,M){if(!(d||!e.call(this,w,M))){var _=g(this,t.call(this,w,M),w,M,"mouse");_&&(Ee(w.view).on("mousemove.drag",m,Pt).on("mouseup.drag",v,Pt),Kt(w.view),yo(w),u=!1,l=w.clientX,c=w.clientY,_("start",w))}}o(p,"mousedowned");function m(w){if(Qe(w),!u){var M=w.clientX-l,_=w.clientY-c;u=M*M+_*_>f}i.mouse("drag",w)}o(m,"mousemoved");function v(w){Ee(w.view).on("mousemove.drag mouseup.drag",null),Tn(w.view,u),Qe(w),i.mouse("end",w)}o(v,"mouseupped");function b(w,M){if(e.call(this,w,M)){var _=w.changedTouches,k=t.call(this,w,M),P=_.length,T,W;for(T=0;T<P;++T)(W=g(this,k,w,M,_[T].identifier,_[T]))&&(yo(w),W("start",w,_[T]))}}o(b,"touchstarted");function y(w){var M=w.changedTouches,_=M.length,k,P;for(k=0;k<_;++k)(P=i[M[k].identifier])&&(Qe(w),P("drag",w,M[k]))}o(y,"touchmoved");function E(w){var M=w.changedTouches,_=M.length,k,P;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),k=0;k<_;++k)(P=i[M[k].identifier])&&(yo(w),P("end",w,M[k]))}o(E,"touchended");function g(w,M,_,k,P,T){var W=s.copy(),$=Me(T||_,M),V,L,x;if((x=n.call(w,new Dn("beforestart",{sourceEvent:_,target:h,identifier:P,active:a,x:$[0],y:$[1],dx:0,dy:0,dispatch:W}),k))!=null)return V=x.x-$[0]||0,L=x.y-$[1]||0,o(function S(C,I,O){var A=$,B;switch(C){case"start":i[P]=S,B=a++;break;case"end":delete i[P],--a;case"drag":$=Me(O||I,M),B=a;break}W.call(C,w,new Dn(C,{sourceEvent:I,subject:x,target:h,identifier:P,active:B,x:$[0]+V,y:$[1]+L,dx:$[0]-A[0],dy:$[1]-A[1],dispatch:W}),k)},"gesture")}return o(g,"beforestart"),h.filter=function(w){return arguments.length?(e=typeof w=="function"?w:An(!!w),h):e},h.container=function(w){return arguments.length?(t=typeof w=="function"?w:An(w),h):t},h.subject=function(w){return arguments.length?(n=typeof w=="function"?w:An(w),h):n},h.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:An(!!w),h):r},h.on=function(){var w=s.on.apply(s,arguments);return w===s?h:w},h.clickDistance=function(w){return arguments.length?(f=(w=+w)*w,h):Math.sqrt(f)},h}o(zn,"default");var Qt=0,$n=0,On=0,Rs=1e3,xo,Rn,wo=0,Tt=0,bo=0,Ln=typeof performance=="object"&&performance.now?performance:Date,Ls=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Bn(){return Tt||(Ls(sd),Tt=Ln.now()+bo)}o(Bn,"now");function sd(){Tt=0}o(sd,"clearNow");function Hn(){this._call=this._time=this._next=null}o(Hn,"Timer");Hn.prototype=vo.prototype={constructor:Hn,restart:o(function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Bn():+n)+(t==null?0:+t),!this._next&&Rn!==this&&(Rn?Rn._next=this:xo=this,Rn=this),this._call=e,this._time=n,Kr()},"restart"),stop:o(function(){this._call&&(this._call=null,this._time=1/0,Kr())},"stop")};function vo(e,t,n){var r=new Hn;return r.restart(e,t,n),r}o(vo,"timer");function Hs(){Bn(),++Qt;for(var e=xo,t;e;)(t=Tt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Qt}o(Hs,"timerFlush");function $s(){Tt=(wo=Ln.now())+bo,Qt=$n=0;try{Hs()}finally{Qt=0,ld(),Tt=0}}o($s,"wake");function ad(){var e=Ln.now(),t=e-wo;t>Rs&&(bo-=t,wo=e)}o(ad,"poke");function ld(){for(var e,t=xo,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:xo=n);Rn=e,Kr(r)}o(ld,"nap");function Kr(e){if(!Qt){$n&&($n=clearTimeout($n));var t=e-Tt;t>24?(e<1/0&&($n=setTimeout($s,e-Ln.now()-bo)),On&&(On=clearInterval(On))):(On||(wo=Ln.now(),On=setInterval(ad,Rs)),Qt=1,Ls($s))}}o(Kr,"sleep");function Vn(e,t,n){var r=new Hn;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}o(Vn,"default");var cd=kt("start","end","cancel","interrupt"),ud=[],Fs=0,Bs=1,Eo=2,So=3,Vs=4,Co=5,Fn=6;function Je(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;dd(e,n,{name:t,index:r,group:i,on:cd,tween:ud,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:Fs})}o(Je,"default");function Wn(e,t){var n=Ce(e,t);if(n.state>Fs)throw new Error("too late; already scheduled");return n}o(Wn,"init");function Ne(e,t){var n=Ce(e,t);if(n.state>So)throw new Error("too late; already running");return n}o(Ne,"set");function Ce(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}o(Ce,"get");function dd(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=vo(s,0,n.time);function s(u){n.state=Bs,n.timer.restart(a,n.delay,n.time),n.delay<=u&&a(u-n.delay)}o(s,"schedule");function a(u){var d,f,h,p;if(n.state!==Bs)return c();for(d in r)if(p=r[d],p.name===n.name){if(p.state===So)return Vn(a);p.state===Vs?(p.state=Fn,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete r[d]):+d<t&&(p.state=Fn,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete r[d])}if(Vn(function(){n.state===So&&(n.state=Vs,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=Eo,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Eo){for(n.state=So,i=new Array(h=n.tween.length),d=0,f=-1;d<h;++d)(p=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(i[++f]=p);i.length=f+1}}o(a,"start");function l(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(c),n.state=Co,1),f=-1,h=i.length;++f<h;)i[f].call(e,d);n.state===Co&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}o(l,"tick");function c(){n.state=Fn,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}o(c,"stop")}o(dd,"create");function xt(e,t){var n=e.__transition,r,i,s=!0,a;if(n){t=t==null?null:t+"";for(a in n){if((r=n[a]).name!==t){s=!1;continue}i=r.state>Eo&&r.state<Co,r.state=Fn,r.timer.stop(),r.on.call(i?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[a]}s&&delete e.__transition}}o(xt,"default");function Qr(e){return this.each(function(){xt(this,e)})}o(Qr,"default");function fd(e,t){var n,r;return function(){var i=Ne(this,e),s=i.tween;if(s!==n){r=n=s;for(var a=0,l=r.length;a<l;++a)if(r[a].name===t){r=r.slice(),r.splice(a,1);break}}i.tween=r}}o(fd,"tweenRemove");function hd(e,t,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=Ne(this,e),a=s.tween;if(a!==r){i=(r=a).slice();for(var l={name:t,value:n},c=0,u=i.length;c<u;++c)if(i[c].name===t){i[c]=l;break}c===u&&i.push(l)}s.tween=i}}o(hd,"tweenFunction");function Jr(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ce(this.node(),n).tween,i=0,s=r.length,a;i<s;++i)if((a=r[i]).name===e)return a.value;return null}return this.each((t==null?fd:hd)(n,e,t))}o(Jr,"default");function Jt(e,t,n){var r=e._id;return e.each(function(){var i=Ne(this,r);(i.value||(i.value={}))[t]=n.apply(this,arguments)}),function(i){return Ce(i,r).value[t]}}o(Jt,"tweenValue");function Xn(e,t){var n;return(typeof t=="number"?ys:t instanceof lr?cr:(n=lr(t))?(t=n,cr):xs)(e,t)}o(Xn,"default");function pd(e){return function(){this.removeAttribute(e)}}o(pd,"attrRemove");function md(e){return function(){this.removeAttributeNS(e.space,e.local)}}o(md,"attrRemoveNS");function gd(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttribute(e);return a===i?null:a===r?s:s=t(r=a,n)}}o(gd,"attrConstant");function yd(e,t,n){var r,i=n+"",s;return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?s:s=t(r=a,n)}}o(yd,"attrConstantNS");function xd(e,t,n){var r,i,s;return function(){var a,l=n(this),c;return l==null?void this.removeAttribute(e):(a=this.getAttribute(e),c=l+"",a===c?null:a===r&&c===i?s:(i=c,s=t(r=a,l)))}}o(xd,"attrFunction");function wd(e,t,n){var r,i,s;return function(){var a,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local),c=l+"",a===c?null:a===r&&c===i?s:(i=c,s=t(r=a,l)))}}o(wd,"attrFunctionNS");function jr(e,t){var n=Ze(e),r=n==="transform"?bs:Xn;return this.attrTween(e,typeof t=="function"?(n.local?wd:xd)(n,r,Jt(this,"attr."+e,t)):t==null?(n.local?md:pd)(n):(n.local?yd:gd)(n,r,t))}o(jr,"default");function bd(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}o(bd,"attrInterpolate");function vd(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}o(vd,"attrInterpolateNS");function Sd(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&vd(e,s)),n}return o(i,"tween"),i._value=t,i}o(Sd,"attrTweenNS");function Ed(e,t){var n,r;function i(){var s=t.apply(this,arguments);return s!==r&&(n=(r=s)&&bd(e,s)),n}return o(i,"tween"),i._value=t,i}o(Ed,"attrTween");function ei(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=Ze(e);return this.tween(n,(r.local?Sd:Ed)(r,t))}o(ei,"default");function Cd(e,t){return function(){Wn(this,e).delay=+t.apply(this,arguments)}}o(Cd,"delayFunction");function _d(e,t){return t=+t,function(){Wn(this,e).delay=t}}o(_d,"delayConstant");function ti(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Cd:_d)(t,e)):Ce(this.node(),t).delay}o(ti,"default");function Nd(e,t){return function(){Ne(this,e).duration=+t.apply(this,arguments)}}o(Nd,"durationFunction");function Id(e,t){return t=+t,function(){Ne(this,e).duration=t}}o(Id,"durationConstant");function ni(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Nd:Id)(t,e)):Ce(this.node(),t).duration}o(ni,"default");function Md(e,t){if(typeof t!="function")throw new Error;return function(){Ne(this,e).ease=t}}o(Md,"easeConstant");function oi(e){var t=this._id;return arguments.length?this.each(Md(t,e)):Ce(this.node(),t).ease}o(oi,"default");function kd(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Ne(this,e).ease=n}}o(kd,"easeVarying");function ri(e){if(typeof e!="function")throw new Error;return this.each(kd(this._id,e))}o(ri,"default");function ii(e){typeof e!="function"&&(e=Gt(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i<n;++i)for(var s=t[i],a=s.length,l=r[i]=[],c,u=0;u<a;++u)(c=s[u])&&e.call(c,c.__data__,u,s)&&l.push(c);return new Ae(r,this._parents,this._name,this._id)}o(ii,"default");function si(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,i=n.length,s=Math.min(r,i),a=new Array(r),l=0;l<s;++l)for(var c=t[l],u=n[l],d=c.length,f=a[l]=new Array(d),h,p=0;p<d;++p)(h=c[p]||u[p])&&(f[p]=h);for(;l<r;++l)a[l]=t[l];return new Ae(a,this._parents,this._name,this._id)}o(si,"default");function Pd(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}o(Pd,"start");function Td(e,t,n){var r,i,s=Pd(t)?Wn:Ne;return function(){var a=s(this,e),l=a.on;l!==r&&(i=(r=l).copy()).on(t,n),a.on=i}}o(Td,"onFunction");function ai(e,t){var n=this._id;return arguments.length<2?Ce(this.node(),n).on.on(e):this.each(Td(n,e,t))}o(ai,"default");function Ad(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}o(Ad,"removeFunction");function li(){return this.on("end.remove",Ad(this._id))}o(li,"default");function ci(e){var t=this._name,n=this._id;typeof e!="function"&&(e=gt(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a<i;++a)for(var l=r[a],c=l.length,u=s[a]=new Array(c),d,f,h=0;h<c;++h)(d=l[h])&&(f=e.call(d,d.__data__,h,l))&&("__data__"in d&&(f.__data__=d.__data__),u[h]=f,Je(u[h],t,n,h,u,Ce(d,n)));return new Ae(s,this._parents,t,n)}o(ci,"default");function ui(e){var t=this._name,n=this._id;typeof e!="function"&&(e=qt(e));for(var r=this._groups,i=r.length,s=[],a=[],l=0;l<i;++l)for(var c=r[l],u=c.length,d,f=0;f<u;++f)if(d=c[f]){for(var h=e.call(d,d.__data__,f,c),p,m=Ce(d,n),v=0,b=h.length;v<b;++v)(p=h[v])&&Je(p,t,n,v,h,m);s.push(h),a.push(d)}return new Ae(s,a,t,n)}o(ui,"default");var Dd=Ke.prototype.constructor;function di(){return new Dd(this._groups,this._parents)}o(di,"default");function zd(e,t){var n,r,i;return function(){var s=yt(this,e),a=(this.style.removeProperty(e),yt(this,e));return s===a?null:s===n&&a===r?i:i=t(n=s,r=a)}}o(zd,"styleNull");function Ws(e){return function(){this.style.removeProperty(e)}}o(Ws,"styleRemove");function Od(e,t,n){var r,i=n+"",s;return function(){var a=yt(this,e);return a===i?null:a===r?s:s=t(r=a,n)}}o(Od,"styleConstant");function $d(e,t,n){var r,i,s;return function(){var a=yt(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),yt(this,e))),a===c?null:a===r&&c===i?s:(i=c,s=t(r=a,l))}}o($d,"styleFunction");function Rd(e,t){var n,r,i,s="style."+t,a="end."+s,l;return function(){var c=Ne(this,e),u=c.on,d=c.value[s]==null?l||(l=Ws(t)):void 0;(u!==n||i!==d)&&(r=(n=u).copy()).on(a,i=d),c.on=r}}o(Rd,"styleMaybeRemove");function fi(e,t,n){var r=(e+="")=="transform"?ws:Xn;return t==null?this.styleTween(e,zd(e,r)).on("end.style."+e,Ws(e)):typeof t=="function"?this.styleTween(e,$d(e,r,Jt(this,"style."+e,t))).each(Rd(this._id,e)):this.styleTween(e,Od(e,r,t),n).on("end.style."+e,null)}o(fi,"default");function Ld(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}o(Ld,"styleInterpolate");function Hd(e,t,n){var r,i;function s(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Ld(e,a,n)),r}return o(s,"tween"),s._value=t,s}o(Hd,"styleTween");function hi(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,Hd(e,t,n??""))}o(hi,"default");function Bd(e){return function(){this.textContent=e}}o(Bd,"textConstant");function Vd(e){return function(){var t=e(this);this.textContent=t??""}}o(Vd,"textFunction");function pi(e){return this.tween("text",typeof e=="function"?Vd(Jt(this,"text",e)):Bd(e==null?"":e+""))}o(pi,"default");function Fd(e){return function(t){this.textContent=e.call(this,t)}}o(Fd,"textInterpolate");function Wd(e){var t,n;function r(){var i=e.apply(this,arguments);return i!==n&&(t=(n=i)&&Fd(i)),t}return o(r,"tween"),r._value=e,r}o(Wd,"textTween");function mi(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,Wd(e))}o(mi,"default");function gi(){for(var e=this._name,t=this._id,n=_o(),r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],l=a.length,c,u=0;u<l;++u)if(c=a[u]){var d=Ce(c,t);Je(c,e,n,u,a,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new Ae(r,this._parents,e,n)}o(gi,"default");function yi(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(s,a){var l={value:a},c={value:o(function(){--i===0&&s()},"value")};n.each(function(){var u=Ne(this,r),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),u.on=t}),i===0&&s()})}o(yi,"default");var Xd=0;function Ae(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}o(Ae,"Transition");function Xs(e){return Ke().transition(e)}o(Xs,"transition");function _o(){return++Xd}o(_o,"newId");var je=Ke.prototype;Ae.prototype=Xs.prototype={constructor:Ae,select:ci,selectAll:ui,selectChild:je.selectChild,selectChildren:je.selectChildren,filter:ii,merge:si,selection:di,transition:gi,call:je.call,nodes:je.nodes,node:je.node,size:je.size,empty:je.empty,each:je.each,on:ai,attr:jr,attrTween:ei,style:fi,styleTween:hi,text:pi,textTween:mi,remove:li,tween:Jr,delay:ti,duration:ni,ease:oi,easeVarying:ri,end:yi,[Symbol.iterator]:je[Symbol.iterator]};function No(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}o(No,"cubicInOut");var Yd={time:null,delay:0,duration:250,ease:No};function Zd(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}o(Zd,"inherit");function xi(e){var t,n;e instanceof Ae?(t=e._id,e=e._name):(t=_o(),(n=Yd).time=Bn(),e=e==null?null:e+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var a=r[s],l=a.length,c,u=0;u<l;++u)(c=a[u])&&Je(c,e,t,u,a,n||Zd(c,t));return new Ae(r,this._parents,e,t)}o(xi,"default");Ke.prototype.interrupt=Qr;Ke.prototype.transition=xi;var Yn=o(e=>()=>e,"default");function wi(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}o(wi,"ZoomEvent");function Ve(e,t,n){this.k=e,this.x=t,this.y=n}o(Ve,"Transform");Ve.prototype={constructor:Ve,scale:o(function(e){return e===1?this:new Ve(this.k*e,this.x,this.y)},"scale"),translate:o(function(e,t){return e===0&t===0?this:new Ve(this.k,this.x+this.k*e,this.y+this.k*t)},"translate"),apply:o(function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},"apply"),applyX:o(function(e){return e*this.k+this.x},"applyX"),applyY:o(function(e){return e*this.k+this.y},"applyY"),invert:o(function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},"invert"),invertX:o(function(e){return(e-this.x)/this.k},"invertX"),invertY:o(function(e){return(e-this.y)/this.k},"invertY"),rescaleX:o(function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},"rescaleX"),rescaleY:o(function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},"rescaleY"),toString:o(function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"},"toString")};var At=new Ve(1,0,0);Zn.prototype=Ve.prototype;function Zn(e){for(;!e.__zoom;)if(!(e=e.parentNode))return At;return e.__zoom}o(Zn,"transform");function Io(e){e.stopImmediatePropagation()}o(Io,"nopropagation");function Dt(e){e.preventDefault(),e.stopImmediatePropagation()}o(Dt,"default");function Ud(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}o(Ud,"defaultFilter");function qd(){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]]}o(qd,"defaultExtent");function Ys(){return this.__zoom||At}o(Ys,"defaultTransform");function Gd(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}o(Gd,"defaultWheelDelta");function Kd(){return navigator.maxTouchPoints||"ontouchstart"in this}o(Kd,"defaultTouchable");function Qd(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],s=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>s?(s+a)/2:Math.min(0,s)||Math.max(0,a))}o(Qd,"defaultConstrain");function Un(){var e=Ud,t=qd,n=Qd,r=Gd,i=Kd,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,c=Ut,u=kt("start","zoom","end"),d,f,h,p=500,m=150,v=0,b=10;function y(x){x.property("__zoom",Ys).on("wheel.zoom",P,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",W).filter(i).on("touchstart.zoom",$).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}o(y,"zoom"),y.transform=function(x,S,C,I){var O=x.selection?x.selection():x;O.property("__zoom",Ys),x!==O?M(x,S,C,I):O.interrupt().each(function(){_(this,arguments).event(I).start().zoom(null,typeof S=="function"?S.apply(this,arguments):S).end()})},y.scaleBy=function(x,S,C,I){y.scaleTo(x,function(){var O=this.__zoom.k,A=typeof S=="function"?S.apply(this,arguments):S;return O*A},C,I)},y.scaleTo=function(x,S,C,I){y.transform(x,function(){var O=t.apply(this,arguments),A=this.__zoom,B=C==null?w(O):typeof C=="function"?C.apply(this,arguments):C,F=A.invert(B),H=typeof S=="function"?S.apply(this,arguments):S;return n(g(E(A,H),B,F),O,a)},C,I)},y.translateBy=function(x,S,C,I){y.transform(x,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),a)},null,I)},y.translateTo=function(x,S,C,I,O){y.transform(x,function(){var A=t.apply(this,arguments),B=this.__zoom,F=I==null?w(A):typeof I=="function"?I.apply(this,arguments):I;return n(At.translate(F[0],F[1]).scale(B.k).translate(typeof S=="function"?-S.apply(this,arguments):-S,typeof C=="function"?-C.apply(this,arguments):-C),A,a)},I,O)};function E(x,S){return S=Math.max(s[0],Math.min(s[1],S)),S===x.k?x:new Ve(S,x.x,x.y)}o(E,"scale");function g(x,S,C){var I=S[0]-C[0]*x.k,O=S[1]-C[1]*x.k;return I===x.x&&O===x.y?x:new Ve(x.k,I,O)}o(g,"translate");function w(x){return[(+x[0][0]+ +x[1][0])/2,(+x[0][1]+ +x[1][1])/2]}o(w,"centroid");function M(x,S,C,I){x.on("start.zoom",function(){_(this,arguments).event(I).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(I).end()}).tween("zoom",function(){var O=this,A=arguments,B=_(O,A).event(I),F=t.apply(O,A),H=C==null?w(F):typeof C=="function"?C.apply(O,A):C,U=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),Z=O.__zoom,X=typeof S=="function"?S.apply(O,A):S,j=c(Z.invert(H).concat(U/Z.k),X.invert(H).concat(U/X.k));return function(K){if(K===1)K=X;else{var R=j(K),Y=U/R[2];K=new Ve(Y,H[0]-R[0]*Y,H[1]-R[1]*Y)}B.zoom(null,K)}})}o(M,"schedule");function _(x,S,C){return!C&&x.__zooming||new k(x,S)}o(_,"gesture");function k(x,S){this.that=x,this.args=S,this.active=0,this.sourceEvent=null,this.extent=t.apply(x,S),this.taps=0}o(k,"Gesture"),k.prototype={event:o(function(x){return x&&(this.sourceEvent=x),this},"event"),start:o(function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},"start"),zoom:o(function(x,S){return this.mouse&&x!=="mouse"&&(this.mouse[1]=S.invert(this.mouse[0])),this.touch0&&x!=="touch"&&(this.touch0[1]=S.invert(this.touch0[0])),this.touch1&&x!=="touch"&&(this.touch1[1]=S.invert(this.touch1[0])),this.that.__zoom=S,this.emit("zoom"),this},"zoom"),end:o(function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},"end"),emit:o(function(x){var S=Ee(this.that).datum();u.call(x,this.that,new wi(x,{sourceEvent:this.sourceEvent,target:y,type:x,transform:this.that.__zoom,dispatch:u}),S)},"emit")};function P(x,...S){if(!e.apply(this,arguments))return;var C=_(this,S).event(x),I=this.__zoom,O=Math.max(s[0],Math.min(s[1],I.k*Math.pow(2,r.apply(this,arguments)))),A=Me(x);if(C.wheel)(C.mouse[0][0]!==A[0]||C.mouse[0][1]!==A[1])&&(C.mouse[1]=I.invert(C.mouse[0]=A)),clearTimeout(C.wheel);else{if(I.k===O)return;C.mouse=[A,I.invert(A)],xt(this),C.start()}Dt(x),C.wheel=setTimeout(B,m),C.zoom("mouse",n(g(E(I,O),C.mouse[0],C.mouse[1]),C.extent,a));function B(){C.wheel=null,C.end()}o(B,"wheelidled")}o(P,"wheeled");function T(x,...S){if(h||!e.apply(this,arguments))return;var C=x.currentTarget,I=_(this,S,!0).event(x),O=Ee(x.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",U,!0),A=Me(x,C),B=x.clientX,F=x.clientY;Kt(x.view),Io(x),I.mouse=[A,this.__zoom.invert(A)],xt(this),I.start();function H(Z){if(Dt(Z),!I.moved){var X=Z.clientX-B,j=Z.clientY-F;I.moved=X*X+j*j>v}I.event(Z).zoom("mouse",n(g(I.that.__zoom,I.mouse[0]=Me(Z,C),I.mouse[1]),I.extent,a))}o(H,"mousemoved");function U(Z){O.on("mousemove.zoom mouseup.zoom",null),Tn(Z.view,I.moved),Dt(Z),I.event(Z).end()}o(U,"mouseupped")}o(T,"mousedowned");function W(x,...S){if(e.apply(this,arguments)){var C=this.__zoom,I=Me(x.changedTouches?x.changedTouches[0]:x,this),O=C.invert(I),A=C.k*(x.shiftKey?.5:2),B=n(g(E(C,A),I,O),t.apply(this,S),a);Dt(x),l>0?Ee(this).transition().duration(l).call(M,B,I,x):Ee(this).call(y.transform,B,I,x)}}o(W,"dblclicked");function $(x,...S){if(e.apply(this,arguments)){var C=x.touches,I=C.length,O=_(this,S,x.changedTouches.length===I).event(x),A,B,F,H;for(Io(x),B=0;B<I;++B)F=C[B],H=Me(F,this),H=[H,this.__zoom.invert(H),F.identifier],O.touch0?!O.touch1&&O.touch0[2]!==H[2]&&(O.touch1=H,O.taps=0):(O.touch0=H,A=!0,O.taps=1+!!d);d&&(d=clearTimeout(d)),A&&(O.taps<2&&(f=H[0],d=setTimeout(function(){d=null},p)),xt(this),O.start())}}o($,"touchstarted");function V(x,...S){if(this.__zooming){var C=_(this,S).event(x),I=x.changedTouches,O=I.length,A,B,F,H;for(Dt(x),A=0;A<O;++A)B=I[A],F=Me(B,this),C.touch0&&C.touch0[2]===B.identifier?C.touch0[0]=F:C.touch1&&C.touch1[2]===B.identifier&&(C.touch1[0]=F);if(B=C.that.__zoom,C.touch1){var U=C.touch0[0],Z=C.touch0[1],X=C.touch1[0],j=C.touch1[1],K=(K=X[0]-U[0])*K+(K=X[1]-U[1])*K,R=(R=j[0]-Z[0])*R+(R=j[1]-Z[1])*R;B=E(B,Math.sqrt(K/R)),F=[(U[0]+X[0])/2,(U[1]+X[1])/2],H=[(Z[0]+j[0])/2,(Z[1]+j[1])/2]}else if(C.touch0)F=C.touch0[0],H=C.touch0[1];else return;C.zoom("touch",n(g(B,F,H),C.extent,a))}}o(V,"touchmoved");function L(x,...S){if(this.__zooming){var C=_(this,S).event(x),I=x.changedTouches,O=I.length,A,B;for(Io(x),h&&clearTimeout(h),h=setTimeout(function(){h=null},p),A=0;A<O;++A)B=I[A],C.touch0&&C.touch0[2]===B.identifier?delete C.touch0:C.touch1&&C.touch1[2]===B.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&&(B=Me(B,this),Math.hypot(f[0]-B[0],f[1]-B[1])<b)){var F=Ee(this).on("dblclick.zoom");F&&F.apply(this,arguments)}}}return o(L,"touchended"),y.wheelDelta=function(x){return arguments.length?(r=typeof x=="function"?x:Yn(+x),y):r},y.filter=function(x){return arguments.length?(e=typeof x=="function"?x:Yn(!!x),y):e},y.touchable=function(x){return arguments.length?(i=typeof x=="function"?x:Yn(!!x),y):i},y.extent=function(x){return arguments.length?(t=typeof x=="function"?x:Yn([[+x[0][0],+x[0][1]],[+x[1][0],+x[1][1]]]),y):t},y.scaleExtent=function(x){return arguments.length?(s[0]=+x[0],s[1]=+x[1],y):[s[0],s[1]]},y.translateExtent=function(x){return arguments.length?(a[0][0]=+x[0][0],a[1][0]=+x[1][0],a[0][1]=+x[0][1],a[1][1]=+x[1][1],y):[[a[0][0],a[0][1]],[a[1][0],a[1][1]]]},y.constrain=function(x){return arguments.length?(n=x,y):n},y.duration=function(x){return arguments.length?(l=+x,y):l},y.interpolate=function(x){return arguments.length?(c=x,y):c},y.on=function(){var x=u.on.apply(u,arguments);return x===u?y:x},y.clickDistance=function(x){return arguments.length?(v=(x=+x)*x,y):Math.sqrt(v)},y.tapDistance=function(x){return arguments.length?(b=+x,y):b},y}o(Un,"default");var ze={error001:o((e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,"error001"),error002:o(()=>"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.","error002"),error003:o(e=>`Node type "${e}" not found. Using fallback type "default".`,"error003"),error004:o(()=>"The parent container needs a width and a height to render the graph.","error004"),error005:o(()=>"Only child nodes can use a parent extent.","error005"),error006:o(()=>"Can't create edge. An edge needs a source and a target.","error006"),error007:o(e=>`The old edge with id=${e} does not exist.`,"error007"),error009:o(e=>`Marker type "${e}" doesn't exist.`,"error009"),error008:o((e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,"error008"),error010:o(()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.","error010"),error011:o(e=>`Edge type "${e}" not found. Using fallback type "default".`,"error011"),error012:o(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.`,"error012"),error013:o((e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,"error013"),error014:o(()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.","error014"),error015:o(()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.","error015"),error016:o(e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`,"error016")},on=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ci=["Enter"," ","Escape"],_i={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":o(({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"node.a11yDescription.ariaLiveMessage"),"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"},vt;(function(e){e.Strict="strict",e.Loose="loose"})(vt||(vt={}));var et;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(et||(et={}));var zt;(function(e){e.Partial="partial",e.Full="full"})(zt||(zt={}));var Ni={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},Ue;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ue||(Ue={}));var tn;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(tn||(tn={}));var J;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(J||(J={}));var Zs={[J.Left]:J.Right,[J.Right]:J.Left,[J.Top]:J.Bottom,[J.Bottom]:J.Top};function Ii(e){return e===null?null:e?"valid":"invalid"}o(Ii,"getConnectionStatus");var Mi=o(e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,"isEdgeBase"),ia=o(e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),"isNodeBase"),ki=o(e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),"isInternalNodeBase");var Gn=o((e,t=[0,0])=>{let{width:n,height:r}=Fe(e),i=e.origin??t,s=n*i[0],a=r*i[1];return{x:e.position.x-s,y:e.position.y-a}},"getNodePositionWithOrigin"),Kn=o((e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=e.reduce((r,i)=>{let s=typeof i=="string",a=!t.nodeLookup&&!s?i:void 0;t.nodeLookup&&(a=s?t.nodeLookup.get(i):ki(i)?i:t.nodeLookup.get(i.id));let l=a?Po(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Do(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return zo(n)},"getNodesBounds"),rn=o((e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(i=>{(t.filter===void 0||t.filter(i))&&(n=Do(n,Po(i)),r=!0)}),r?zo(n):{x:0,y:0,width:0,height:0}},"getInternalNodesBounds"),To=o((e,t,[n,r,i]=[0,0,1],s=!1,a=!1)=>{let l=(t.x-n)/i,c=(t.y-r)/i,u=t.width/i,d=t.height/i,f=[];for(let h of e.values()){let{measured:p,selectable:m=!0,hidden:v=!1}=h;if(a&&!m||v)continue;let b=p.width??h.width??h.initialWidth??0,y=p.height??h.height??h.initialHeight??0,{x:E,y:g}=h.internals.positionAbsolute,w=ua(l,c,u,d,E,g,b,y),M=b*y,_=s&&w>0;(!h.internals.handleBounds||_||w>=M||h.dragging)&&f.push(h)}return f},"getNodesInside"),sa=o((e,t)=>{let n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))},"getConnectedEdges");function Jd(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(i=>i.id)):null;return e.forEach(i=>{let s;if(t?.includeHiddenNodes){let{width:a,height:l}=Fe(i);s=a>0&&l>0}else s=!!(i.measured.width&&i.measured.height&&!i.hidden);s&&(!r||r.has(i.id))&&n.set(i.id,i)}),n}o(Jd,"getFitViewNodes");async function aa({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:s},a){if(e.size===0)return!0;let l=Jd(e,a),c=rn(l),u=Lt(c,t,n,a?.minZoom??i,a?.maxZoom??s,a?.padding??.1);return await r.setViewport(u,{duration:a?.duration,ease:a?.ease,interpolate:a?.interpolate}),!0}o(aa,"fitViewport");function Pi({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:s}){let a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=a.origin??r,f=a.extent||i;if(a.extent==="parent"&&!a.expandParent)if(!l)s?.("005",ze.error005());else{let p=l.measured.width,m=l.measured.height;p&&m&&(f=[[c,u],[c+p,u+m]])}else l&&Rt(a.extent)&&(f=[[a.extent[0][0]+c,a.extent[0][1]+u],[a.extent[1][0]+c,a.extent[1][1]+u]]);let h=Rt(f)?Ot(t,f,a.measured):t;return(a.measured.width===void 0||a.measured.height===void 0)&&s?.("015",ze.error015()),{position:{x:h.x-c+(a.measured.width??0)*d[0],y:h.y-u+(a.measured.height??0)*d[1]},positionAbsolute:h}}o(Pi,"calculateNodePosition");async function la({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let s=new Set(e.map(h=>h.id)),a=[];for(let h of n){if(h.deletable===!1)continue;let p=s.has(h.id),m=!p&&h.parentId&&a.find(v=>v.id===h.parentId);(p||m)&&a.push(h)}let l=new Set(t.map(h=>h.id)),c=r.filter(h=>h.deletable!==!1),d=sa(a,c);for(let h of c)l.has(h.id)&&!d.find(m=>m.id===h.id)&&d.push(h);if(!i)return{edges:d,nodes:a};let f=await i({nodes:a,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:a}:{edges:[],nodes:[]}:f}o(la,"getElementsToRemove");var nn=o((e,t=0,n=1)=>Math.min(Math.max(e,t),n),"clamp"),Ot=o((e={x:0,y:0},t,n)=>({x:nn(e.x,t[0][0],t[1][0]-(n?.width??0)),y:nn(e.y,t[0][1],t[1][1]-(n?.height??0))}),"clampPosition");function ca(e,t,n){let{width:r,height:i}=Fe(n),{x:s,y:a}=n.internals.positionAbsolute;return Ot(e,[[s,a],[s+r,a+i]],t)}o(ca,"clampPositionToParent");var Us=o((e,t,n)=>e<t?nn(Math.abs(e-t),1,t)/t:e>n?-nn(Math.abs(e-n),1,t)/t:0,"calcAutoPanVelocity"),Ao=o((e,t,n=15,r=40)=>{let i=Us(e.x,r,t.width-r)*n,s=Us(e.y,r,t.height-r)*n;return[i,s]},"calcAutoPan"),Do=o((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)}),"getBoundsOfBoxes"),Ei=o(({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),"rectToBox"),zo=o(({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),"boxToRect"),sn=o((e,t=[0,0])=>{let{x:n,y:r}=ki(e)?e.internals.positionAbsolute:Gn(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},"nodeToRect"),Po=o((e,t=[0,0])=>{let{x:n,y:r}=ki(e)?e.internals.positionAbsolute:Gn(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},"nodeToBox"),Ti=o((e,t)=>zo(Do(Ei(e),Ei(t))),"getBoundsOfRects"),ua=o((e,t,n,r,i,s,a,l)=>{let c=Math.max(0,Math.min(e+n,i+a)-Math.max(e,i)),u=Math.max(0,Math.min(t+r,s+l)-Math.max(t,s));return Math.ceil(c*u)},"getRectsOverlappingArea"),Qn=o((e,t)=>ua(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),"getOverlappingArea"),Ai=o(e=>Le(e.width)&&Le(e.height)&&Le(e.x)&&Le(e.y),"isRectObject"),Le=o(e=>!isNaN(e)&&isFinite(e),"isNumeric"),Di=o((e,t)=>(n,r)=>{},"createDevWarn"),an=o((e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),"snapPosition"),ln=o(({x:e,y:t},[n,r,i],s=!1,a=[1,1])=>{let l={x:(e-n)/i,y:(t-r)/i};return s?an(l,a):l},"pointToRendererPoint"),$t=o(({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),"rendererPointToPoint");function jt(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}o(jt,"parsePadding");function jd(e,t,n){if(typeof e=="string"||typeof e=="number"){let r=jt(e,n),i=jt(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e=="object"){let r=jt(e.top??e.y??0,n),i=jt(e.bottom??e.y??0,n),s=jt(e.left??e.x??0,t),a=jt(e.right??e.x??0,t);return{top:r,right:a,bottom:i,left:s,x:s+a,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}o(jd,"parsePaddings");function ef(e,t,n,r,i,s){let{x:a,y:l}=$t(e,[t,n,r]),{x:c,y:u}=$t({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=i-c,f=s-u;return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}o(ef,"calculateAppliedPaddings");var Lt=o((e,t,n,r,i,s)=>{let a=jd(s,t,n),l=(t-a.x)/e.width,c=(n-a.y)/e.height,u=Math.min(l,c),d=nn(u,r,i),f=e.x+e.width/2,h=e.y+e.height/2,p=t/2-f*d,m=n/2-h*d,v=ef(e,p,m,d,t,n),b={left:Math.min(v.left-a.left,0),top:Math.min(v.top-a.top,0),right:Math.min(v.right-a.right,0),bottom:Math.min(v.bottom-a.bottom,0)};return{x:p-b.left+b.right,y:m-b.top+b.bottom,zoom:d}},"getViewportForBounds"),cn=o(()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0,"isMacOs");function Rt(e){return e!=null&&e!=="parent"}o(Rt,"isCoordinateExtent");function Fe(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}o(Fe,"getNodeDimensions");function zi(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}o(zi,"nodeHasDimensions");function Oi(e,t={width:0,height:0},n,r,i){let s={...e},a=r.get(n);if(a){let l=a.origin||i;s.x+=a.internals.positionAbsolute.x-(t.width??0)*l[0],s.y+=a.internals.positionAbsolute.y-(t.height??0)*l[1]}return s}o(Oi,"evaluateAbsolutePosition");function $i(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}o($i,"areSetsEqual");function da(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}}o(da,"withResolvers");function fa(e){return{..._i,...e||{}}}o(fa,"mergeAriaLabelConfig");function qn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:s,y:a}=He(e),l=ln({x:s-(i?.left??0),y:a-(i?.top??0)},r),{x:c,y:u}=n?an(l,t):l;return{xSnapped:c,ySnapped:u,...l}}o(qn,"getPointerPosition");var Oo=o(e=>({width:e.offsetWidth,height:e.offsetHeight}),"getDimensions"),Ri=o(e=>e?.getRootNode?.()||window?.document,"getHostForElement"),tf=["INPUT","SELECT","TEXTAREA"];function Li(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:tf.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}o(Li,"isInputDOMNode");var Hi=o(e=>"clientX"in e,"isMouseEvent"),He=o((e,t)=>{let n=Hi(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},"getEventPosition"),qs=o((e,t,n,r,i)=>{let s=t.querySelectorAll(`.${e}`);return!s||!s.length?null:Array.from(s).map(a=>{let l=a.getBoundingClientRect();return{id:a.getAttribute("data-handleid"),type:e,nodeId:i,position:a.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...Oo(a)}})},"getHandleBounds");function $o({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:s,targetControlX:a,targetControlY:l}){let c=e*.125+i*.375+a*.375+n*.125,u=t*.125+s*.375+l*.375+r*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}o($o,"getBezierEdgeCenter");function Mo(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}o(Mo,"calculateControlOffset");function Gs({pos:e,x1:t,y1:n,x2:r,y2:i,c:s}){switch(e){case J.Left:return[t-Mo(t-r,s),n];case J.Right:return[t+Mo(r-t,s),n];case J.Top:return[t,n-Mo(n-i,s)];case J.Bottom:return[t,n+Mo(i-n,s)]}}o(Gs,"getControlWithCurvature");function Ro({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:r,targetY:i,targetPosition:s=J.Top,curvature:a=.25}){let[l,c]=Gs({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[u,d]=Gs({pos:s,x1:r,y1:i,x2:e,y2:t,c:a}),[f,h,p,m]=$o({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${r},${i}`,f,h,p,m]}o(Ro,"getBezierPath");function Bi({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,s=n<e?n+i:n-i,a=Math.abs(r-t)/2,l=r<t?r+a:r-a;return[s,l,i,a]}o(Bi,"getEdgeCenter");function ha({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:s="basic"}){if(s==="manual")return r;let a=i&&n?r+1e3:r,l=Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0);return a+l}o(ha,"getElevatedEdgeZIndex");function pa({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let s=Do(Po(e),Po(t));s.x===s.x2&&(s.x2+=1),s.y===s.y2&&(s.y2+=1);let a={x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]};return Qn(a,zo(s))>0}o(pa,"isEdgeVisible");var nf=o(({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,"getEdgeId"),of=o((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)),"connectionExists"),ma=o((e,t,n={})=>{if(!e.source||!e.target)return n.onError?.("006",ze.error006()),t;let r=n.getEdgeId||nf,i;return Mi(e)?i={...e}:i={...e,id:r(e)},of(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))},"addEdge");function Lo({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,s,a,l]=Bi({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,s,a,l]}o(Lo,"getStraightPath");var Ks={[J.Left]:{x:-1,y:0},[J.Right]:{x:1,y:0},[J.Top]:{x:0,y:-1},[J.Bottom]:{x:0,y:1}},rf=o(({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},"getDirection"),Qs=o((e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)),"distance");function sf({source:e,sourcePosition:t=J.Bottom,target:n,targetPosition:r=J.Top,center:i,offset:s,stepPosition:a}){let l=Ks[t],c=Ks[r],u={x:e.x+l.x*s,y:e.y+l.y*s},d={x:n.x+c.x*s,y:n.y+c.y*s},f=rf({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",p=f[h],m=[],v,b,y={x:0,y:0},E={x:0,y:0},[,,g,w]=Bi({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(v=i.x??u.x+(d.x-u.x)*a,b=i.y??(u.y+d.y)/2):(v=i.x??(u.x+d.x)/2,b=i.y??u.y+(d.y-u.y)*a);let P=[{x:v,y:u.y},{x:v,y:d.y}],T=[{x:u.x,y:b},{x:d.x,y:b}];l[h]===p?m=h==="x"?P:T:m=h==="x"?T:P}else{let P=[{x:u.x,y:d.y}],T=[{x:d.x,y:u.y}];if(h==="x"?m=l.x===p?T:P:m=l.y===p?P:T,t===r){let x=Math.abs(e[h]-n[h]);if(x<=s){let S=Math.min(s-1,s-x);l[h]===p?y[h]=(u[h]>e[h]?-1:1)*S:E[h]=(d[h]>n[h]?-1:1)*S}}if(t!==r){let x=h==="x"?"y":"x",S=l[h]===c[x],C=u[x]>d[x],I=u[x]<d[x];(l[h]===1&&(!S&&C||S&&I)||l[h]!==1&&(!S&&I||S&&C))&&(m=h==="x"?P:T)}let W={x:u.x+y.x,y:u.y+y.y},$={x:d.x+E.x,y:d.y+E.y},V=Math.max(Math.abs(W.x-m[0].x),Math.abs($.x-m[0].x)),L=Math.max(Math.abs(W.y-m[0].y),Math.abs($.y-m[0].y));V>=L?(v=(W.x+$.x)/2,b=m[0].y):(v=m[0].x,b=(W.y+$.y)/2)}let M={x:u.x+y.x,y:u.y+y.y},_={x:d.x+E.x,y:d.y+E.y};return[[e,...M.x!==m[0].x||M.y!==m[0].y?[M]:[],...m,..._.x!==m[m.length-1].x||_.y!==m[m.length-1].y?[_]:[],n],v,b,g,w]}o(sf,"getPoints");function af(e,t,n,r){let i=Math.min(Qs(e,t)/2,Qs(t,n)/2,r),{x:s,y:a}=t;if(e.x===s&&s===n.x||e.y===a&&a===n.y)return`L${s} ${a}`;if(e.y===a){let u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${s+i*u},${a}Q ${s},${a} ${s},${a+i*d}`}let l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${s},${a+i*c}Q ${s},${a} ${s+i*l},${a}`}o(af,"getBend");function Jn({sourceX:e,sourceY:t,sourcePosition:n=J.Bottom,targetX:r,targetY:i,targetPosition:s=J.Top,borderRadius:a=5,centerX:l,centerY:c,offset:u=20,stepPosition:d=.5}){let[f,h,p,m,v]=sf({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:s,center:{x:l,y:c},offset:u,stepPosition:d}),b=`M${f[0].x} ${f[0].y}`;for(let y=1;y<f.length-1;y++)b+=af(f[y-1],f[y],f[y+1],a);return b+=`L${f[f.length-1].x} ${f[f.length-1].y}`,[b,h,p,m,v]}o(Jn,"getSmoothStepPath");function Js(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}o(Js,"isNodeInitialized");function ga(e){let{sourceNode:t,targetNode:n}=e;if(!Js(t)||!Js(n))return null;let r=t.internals.handleBounds||js(t.handles),i=n.internals.handleBounds||js(n.handles),s=ea(r?.source??[],e.sourceHandle),a=ea(e.connectionMode===vt.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!s||!a)return e.onError?.("008",ze.error008(s?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let l=s?.position||J.Bottom,c=a?.position||J.Top,u=St(t,s,l),d=St(n,a,c);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:c}}o(ga,"getEdgePosition");function js(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}o(js,"toHandleBounds");function St(e,t,n=J.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,s=(t?.y??0)+e.internals.positionAbsolute.y,{width:a,height:l}=t??Fe(e);if(r)return{x:i+a/2,y:s+l/2};switch(t?.position??n){case J.Top:return{x:i+a/2,y:s};case J.Right:return{x:i+a,y:s+l/2};case J.Bottom:return{x:i+a/2,y:s+l};case J.Left:return{x:i,y:s+l/2}}}o(St,"getHandlePosition");function ea(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}o(ea,"getHandle$1");function Ho(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}o(Ho,"getMarkerId");function ya(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let s=new Set;return e.reduce((a,l)=>([l.markerStart||r,l.markerEnd||i].forEach(c=>{if(c&&typeof c=="object"){let u=Ho(c,t);s.has(u)||(a.push({id:u,color:c.color||n,...c}),s.add(u))}}),a),[]).sort((a,l)=>a.id.localeCompare(l.id))}o(ya,"createMarkerIds");var xa=1e3,lf=10,Vi={nodeOrigin:[0,0],nodeExtent:on,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},cf={...Vi,checkEquality:!0};function Fi(e,t){let n={...e};for(let r in t)t[r]!==void 0&&(n[r]=t[r]);return n}o(Fi,"mergeObjects");function wa(e,t,n){let r=Fi(Vi,n);for(let i of e.values())if(i.parentId)Xi(i,e,t,r);else{let s=Gn(i,r.nodeOrigin),a=Rt(i.extent)?i.extent:r.nodeExtent,l=Ot(s,a,Fe(i));i.internals.positionAbsolute=l}}o(wa,"updateAbsolutePositions");function uf(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let i of e.handles){let s={id:i.id,width:i.width??1,height:i.height??1,nodeId:e.id,x:i.x,y:i.y,position:i.position,type:i.type};i.type==="source"?n.push(s):i.type==="target"&&r.push(s)}return{source:n,target:r}}o(uf,"parseHandles");function Wi(e){return e==="manual"}o(Wi,"isManualZIndexMode");function Bo(e,t,n,r={}){let i=Fi(cf,r),s={i:0},a=new Map(t),l=i?.elevateNodesOnSelect&&!Wi(i.zIndexMode)?xa:0,c=e.length>0,u=!1;t.clear(),n.clear();for(let d of e){let f=a.get(d.id);if(i.checkEquality&&d===f?.internals.userNode)t.set(d.id,f);else{let h=Gn(d,i.nodeOrigin),p=Rt(d.extent)?d.extent:i.nodeExtent,m=Ot(h,p,Fe(d));f={...i.defaults,...d,measured:{width:d.measured?.width,height:d.measured?.height},internals:{positionAbsolute:m,handleBounds:uf(d,f),z:ba(d,l,i.zIndexMode),userNode:d}},t.set(d.id,f)}(f.measured===void 0||f.measured.width===void 0||f.measured.height===void 0)&&!f.hidden&&(c=!1),d.parentId&&Xi(f,t,n,r,s),u||=d.selected??!1}return{nodesInitialized:c,hasSelectedNodes:u}}o(Bo,"adoptUserNodes");function df(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}o(df,"updateParentLookup");function Xi(e,t,n,r,i){let{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:l,zIndexMode:c}=Fi(Vi,r),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}df(e,n),i&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++i.i,d.internals.z=d.internals.z+i.i*lf),i&&d.internals.rootParentIndex!==void 0&&(i.i=d.internals.rootParentIndex);let f=s&&!Wi(c)?xa:0,{x:h,y:p,z:m}=ff(e,d,a,l,f,c),{positionAbsolute:v}=e.internals,b=h!==v.x||p!==v.y;(b||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:b?{x:h,y:p}:v,z:m}})}o(Xi,"updateChildNode");function ba(e,t,n){let r=Le(e.zIndex)?e.zIndex:0;return Wi(n)?r:r+(e.selected?t:0)}o(ba,"calculateZ");function ff(e,t,n,r,i,s){let{x:a,y:l}=t.internals.positionAbsolute,c=Fe(e),u=Gn(e,n),d=Rt(e.extent)?Ot(u,e.extent,c):u,f=Ot({x:a+d.x,y:l+d.y},r,c);e.extent==="parent"&&(f=ca(f,c,t));let h=ba(e,i,s),p=t.internals.z??0;return{x:f.x,y:f.y,z:p>=h?p+1:h}}o(ff,"calculateChildXYZ");function Vo(e,t,n,r=[0,0]){let i=[],s=new Map;for(let a of e){let l=t.get(a.parentId);if(!l)continue;let c=s.get(a.parentId)?.expandedRect??sn(l),u=Ti(c,a.rect);s.set(a.parentId,{expandedRect:u,parent:l})}return s.size>0&&s.forEach(({expandedRect:a,parent:l},c)=>{let u=l.internals.positionAbsolute,d=Fe(l),f=l.origin??r,h=a.x<u.x?Math.round(Math.abs(u.x-a.x)):0,p=a.y<u.y?Math.round(Math.abs(u.y-a.y)):0,m=Math.max(d.width,Math.round(a.width)),v=Math.max(d.height,Math.round(a.height)),b=(m-d.width)*f[0],y=(v-d.height)*f[1];(h>0||p>0||b||y)&&(i.push({id:c,type:"position",position:{x:l.position.x-h+b,y:l.position.y-p+y}}),n.get(c)?.forEach(E=>{e.some(g=>g.id===E.id)||i.push({id:E.id,type:"position",position:{x:E.position.x+h,y:E.position.y+p}})})),(d.width<a.width||d.height<a.height||h||p)&&i.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:m+(h?f[0]*h-b:0),height:v+(p?f[1]*p-y:0)}})}),i}o(Vo,"handleExpandParent");function va(e,t,n,r,i,s,a){let l=r?.querySelector(".xyflow__viewport"),c=!1;if(!l)return{changes:[],updatedInternals:c};let u=[],d=window.getComputedStyle(l),{m22:f}=new window.DOMMatrixReadOnly(d.transform),h=[];for(let p of e.values()){let m=t.get(p.id);if(!m)continue;if(m.hidden){t.set(m.id,{...m,internals:{...m.internals,handleBounds:void 0}}),c=!0;continue}let v=Oo(p.nodeElement),b=m.measured.width!==v.width||m.measured.height!==v.height;if(!!(v.width&&v.height&&(b||!m.internals.handleBounds||p.force))){let E=p.nodeElement.getBoundingClientRect(),g=Rt(m.extent)?m.extent:s,{positionAbsolute:w}=m.internals;if(m.parentId&&m.extent==="parent"){let _=t.get(m.parentId);_&&(w=ca(w,v,_))}else g&&(w=Ot(w,g,v));let M={...m,measured:v,internals:{...m.internals,positionAbsolute:w,handleBounds:{source:qs("source",p.nodeElement,E,f,m.id),target:qs("target",p.nodeElement,E,f,m.id)}}};t.set(m.id,M),m.parentId&&Xi(M,t,n,{nodeOrigin:i,zIndexMode:a}),c=!0,b&&(u.push({id:m.id,type:"dimensions",dimensions:v}),m.expandParent&&m.parentId&&h.push({id:m.id,parentId:m.parentId,rect:sn(M,i)}))}}if(h.length>0){let p=Vo(h,t,n,i);u.push(...p)}return{changes:u,updatedInternals:c}}o(va,"updateNodeInternals");async function Sa({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:s}){if(!t||!e.x&&!e.y)return!1;let a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,s]],r);return!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2])}o(Sa,"panBy");function ta(e,t,n,r,i,s){let a=i,l=r.get(a)||new Map;r.set(a,l.set(n,t)),a=`${i}-${e}`;let c=r.get(a)||new Map;if(r.set(a,c.set(n,t)),s){a=`${i}-${e}-${s}`;let u=r.get(a)||new Map;r.set(a,u.set(n,t))}}o(ta,"addConnectionToLookup");function Yi(e,t,n){e.clear(),t.clear();for(let r of n){let{source:i,target:s,sourceHandle:a=null,targetHandle:l=null}=r,c={edgeId:r.id,source:i,target:s,sourceHandle:a,targetHandle:l},u=`${i}-${a}--${s}-${l}`,d=`${s}-${l}--${i}-${a}`;ta("source",c,d,e,i,a),ta("target",c,u,e,s,l),t.set(r.id,r)}}o(Yi,"updateConnectionLookup");function Ea(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:Ea(n,t):!1}o(Ea,"isParentSelected");function na(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}o(na,"hasSelector");function hf(e,t,n,r){let i=new Map;for(let[s,a]of e)if((a.selected||a.id===r)&&(!a.parentId||!Ea(a,e))&&(a.draggable||t&&typeof a.draggable>"u")){let l=e.get(s);l&&i.set(s,{id:s,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return i}o(hf,"getDragItems");function bi({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[a,l]of t){let c=n.get(a)?.internals.userNode;c&&i.push({...c,position:l.position,dragging:r})}if(!e)return[i[0],i];let s=n.get(e)?.internals.userNode;return[s?{...s,position:t.get(e)?.position||s.position,dragging:r}:i[0],i]}o(bi,"getEventHandlerParams");function pf({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let s={x:n-i.distance.x,y:r-i.distance.y},a=an(s,t);return{x:a.x-s.x,y:a.y-s.y}}o(pf,"calculateSnapOffset");function Ca({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let s={x:null,y:null},a=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,p=!1,m=!1,v=null;function b({noDragClassName:E,handleSelector:g,domNode:w,isSelectable:M,nodeId:_,nodeClickDistance:k=0}){h=Ee(w);function P({x:V,y:L}){let{nodeLookup:x,nodeExtent:S,snapGrid:C,snapToGrid:I,nodeOrigin:O,onNodeDrag:A,onSelectionDrag:B,onError:F,updateNodePositions:H}=t();s={x:V,y:L};let U=!1,Z=l.size>1,X=Z&&S?Ei(rn(l)):null,j=Z&&I?pf({dragItems:l,snapGrid:C,x:V,y:L}):null;for(let[K,R]of l){if(!x.has(K))continue;let Y={x:V-R.distance.x,y:L-R.distance.y};I&&(Y=j?{x:Math.round(Y.x+j.x),y:Math.round(Y.y+j.y)}:an(Y,C));let te=null;if(Z&&S&&!R.extent&&X){let{positionAbsolute:G}=R.internals,ne=G.x-X.x+S[0][0],oe=G.x+R.measured.width-X.x2+S[1][0],se=G.y-X.y+S[0][1],le=G.y+R.measured.height-X.y2+S[1][1];te=[[ne,se],[oe,le]]}let{position:ee,positionAbsolute:q}=Pi({nodeId:K,nextPosition:Y,nodeLookup:x,nodeExtent:te||S,nodeOrigin:O,onError:F});U=U||R.position.x!==ee.x||R.position.y!==ee.y,R.position=ee,R.internals.positionAbsolute=q}if(m=m||U,!!U&&(H(l,!0),v&&(r||A||!_&&B))){let[K,R]=bi({nodeId:_,dragItems:l,nodeLookup:x});r?.(v,l,K,R),A?.(v,K,R),_||B?.(v,R)}}o(P,"updateNodes");async function T(){if(!d)return;let{transform:V,panBy:L,autoPanSpeed:x,autoPanOnNodeDrag:S}=t();if(!S){c=!1,cancelAnimationFrame(a);return}let[C,I]=Ao(u,d,x);(C!==0||I!==0)&&(s.x=(s.x??0)-C/V[2],s.y=(s.y??0)-I/V[2],await L({x:C,y:I})&&P(s)),a=requestAnimationFrame(T)}o(T,"autoPan");function W(V){let{nodeLookup:L,multiSelectionActive:x,nodesDraggable:S,transform:C,snapGrid:I,snapToGrid:O,selectNodesOnDrag:A,onNodeDragStart:B,onSelectionDragStart:F,unselectNodesAndEdges:H}=t();f=!0,(!A||!M)&&!x&&_&&(L.get(_)?.selected||H()),M&&A&&_&&e?.(_);let U=qn(V.sourceEvent,{transform:C,snapGrid:I,snapToGrid:O,containerBounds:d});if(s=U,l=hf(L,S,U,_),l.size>0&&(n||B||!_&&F)){let[Z,X]=bi({nodeId:_,dragItems:l,nodeLookup:L});n?.(V.sourceEvent,l,Z,X),B?.(V.sourceEvent,Z,X),_||F?.(V.sourceEvent,X)}}o(W,"startDrag");let $=zn().clickDistance(k).on("start",V=>{let{domNode:L,nodeDragThreshold:x,transform:S,snapGrid:C,snapToGrid:I}=t();d=L?.getBoundingClientRect()||null,p=!1,m=!1,v=V.sourceEvent,x===0&&W(V),s=qn(V.sourceEvent,{transform:S,snapGrid:C,snapToGrid:I,containerBounds:d}),u=He(V.sourceEvent,d)}).on("drag",V=>{let{autoPanOnNodeDrag:L,transform:x,snapGrid:S,snapToGrid:C,nodeDragThreshold:I,nodeLookup:O}=t(),A=qn(V.sourceEvent,{transform:x,snapGrid:S,snapToGrid:C,containerBounds:d});if(v=V.sourceEvent,(V.sourceEvent.type==="touchmove"&&V.sourceEvent.touches.length>1||_&&!O.has(_))&&(p=!0),!p){if(!c&&L&&f&&(c=!0,T()),!f){let B=He(V.sourceEvent,d),F=B.x-u.x,H=B.y-u.y;Math.sqrt(F*F+H*H)>I&&W(V)}(s.x!==A.xSnapped||s.y!==A.ySnapped)&&l&&f&&(u=He(V.sourceEvent,d),P(A))}}).on("end",V=>{if(!f||p){p&&l.size>0&&t().updateNodePositions(l,!1);return}if(c=!1,f=!1,cancelAnimationFrame(a),l.size>0){let{nodeLookup:L,updateNodePositions:x,onNodeDragStop:S,onSelectionDragStop:C}=t();if(m&&(x(l,!1),m=!1),i||S||!_&&C){let[I,O]=bi({nodeId:_,dragItems:l,nodeLookup:L,dragging:!1});i?.(V.sourceEvent,l,I,O),S?.(V.sourceEvent,I,O),_||C?.(V.sourceEvent,O)}}}).filter(V=>{let L=V.target;return!V.button&&(!E||!na(L,`.${E}`,w))&&(!g||na(L,g,w))});h.call($)}o(b,"update");function y(){h?.on(".drag",null)}return o(y,"destroy"),{update:b,destroy:y}}o(Ca,"XYDrag");function mf(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let s of t.values())Qn(i,sn(s))>0&&r.push(s);return r}o(mf,"getNodesWithinDistance");var gf=250;function yf(e,t,n,r){let i=[],s=1/0,a=mf(e,n,t+gf);for(let l of a){let c=[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]];for(let u of c){if(r.nodeId===u.nodeId&&r.type===u.type&&r.id===u.id)continue;let{x:d,y:f}=St(l,u,u.position,!0),h=Math.sqrt(Math.pow(d-e.x,2)+Math.pow(f-e.y,2));h>t||(h<s?(i=[{...u,x:d,y:f}],s=h):h===s&&i.push({...u,x:d,y:f}))}}if(!i.length)return null;if(i.length>1){let l=r.type==="source"?"target":"source";return i.find(c=>c.type===l)??i[0]}return i[0]}o(yf,"getClosestHandle");function _a(e,t,n,r,i,s=!1){let a=r.get(e);if(!a)return null;let l=i==="strict"?a.internals.handleBounds?.[t]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],c=(n?l?.find(u=>u.id===n):l?.[0])??null;return c&&s?{...c,...St(a,c,c.position,!0)}:c}o(_a,"getHandle");function Na(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}o(Na,"getHandleType");function xf(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}o(xf,"isConnectionValid");var Ia=o(()=>!0,"alwaysValid");function wf(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:s,isTarget:a,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:p,onConnectStart:m,onConnect:v,onConnectEnd:b,isValidConnection:y=Ia,onReconnectEnd:E,updateConnection:g,getTransform:w,getFromHandle:M,autoPanSpeed:_,dragThreshold:k=1,handleDomNode:P}){let T=Ri(e.target),W=0,$,{x:V,y:L}=He(e),x=Na(s,P),S=l?.getBoundingClientRect(),C=!1;if(!S||!x)return;let I=_a(i,x,r,c,t);if(!I)return;let O=He(e,S),A=!1,B=null,F=!1,H=null;function U(){if(!d||!S)return;let[ee,q]=Ao(O,S,_);h({x:ee,y:q}),W=requestAnimationFrame(U)}o(U,"autoPan");let Z={...I,nodeId:i,type:x,position:I.position},X=c.get(i),K={inProgress:!0,isValid:null,from:St(X,Z,J.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:X,to:O,toHandle:null,toPosition:Zs[Z.position],toNode:null,pointer:O};function R(){C=!0,g(K),m?.(e,{nodeId:i,handleId:r,handleType:x})}o(R,"startConnection"),k===0&&R();function Y(ee){if(!C){let{x:le,y:ve}=He(ee),he=le-V,pe=ve-L;if(!(he*he+pe*pe>k*k))return;R()}if(!M()||!Z){te(ee);return}let q=w();O=He(ee,S),$=yf(ln(O,q,!1,[1,1]),n,c,Z),A||(U(),A=!0);let G=Ma(ee,{handle:$,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:a?"target":"source",isValidConnection:y,doc:T,lib:u,flowId:f,nodeLookup:c});H=G.handleDomNode,B=G.connection,F=xf(!!$,G.isValid);let ne=c.get(i),oe=ne?St(ne,Z,J.Left,!0):K.from,se={...K,from:oe,isValid:F,to:G.toHandle&&F?$t({x:G.toHandle.x,y:G.toHandle.y},q):O,toHandle:G.toHandle,toPosition:F&&G.toHandle?G.toHandle.position:Zs[Z.position],toNode:G.toHandle?c.get(G.toHandle.nodeId):null,pointer:O};g(se),K=se}o(Y,"onPointerMove");function te(ee){if(!("touches"in ee&&ee.touches.length>0)){if(C){($||H)&&B&&F&&v?.(B);let{inProgress:q,...G}=K,ne={...G,toPosition:K.toHandle?K.toPosition:null};b?.(ee,ne),s&&E?.(ee,ne)}p(),cancelAnimationFrame(W),A=!1,F=!1,B=null,H=null,T.removeEventListener("mousemove",Y),T.removeEventListener("mouseup",te),T.removeEventListener("touchmove",Y),T.removeEventListener("touchend",te)}}o(te,"onPointerUp"),T.addEventListener("mousemove",Y),T.addEventListener("mouseup",te),T.addEventListener("touchmove",Y),T.addEventListener("touchend",te)}o(wf,"onPointerDown");function Ma(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:s,doc:a,lib:l,flowId:c,isValidConnection:u=Ia,nodeLookup:d}){let f=s==="target",h=t?a.querySelector(`.${l}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=He(e),v=a.elementFromPoint(p,m),b=v?.classList.contains(`${l}-flow__handle`)?v:h,y={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){let E=Na(void 0,b),g=b.getAttribute("data-nodeid"),w=b.getAttribute("data-handleid"),M=b.classList.contains("connectable"),_=b.classList.contains("connectableend");if(!g||!E)return y;let k={source:f?g:r,sourceHandle:f?w:i,target:f?r:g,targetHandle:f?i:w};y.connection=k;let T=M&&_&&(n===vt.Strict?f&&E==="source"||!f&&E==="target":g!==r||w!==i);y.isValid=T&&u(k),y.toHandle=_a(g,E,w,d,n,!0)}return y}o(Ma,"isValidHandle");var Fo={onPointerDown:wf,isValid:Ma};function ka({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=Ee(e);function s({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:p=!1}){let m=o(g=>{if(g.sourceEvent.type!=="wheel"||!t)return;let w=n(),M=g.sourceEvent.ctrlKey&&cn()?10:1,_=-g.sourceEvent.deltaY*(g.sourceEvent.deltaMode===1?.05:g.sourceEvent.deltaMode?1:.002)*d,k=w[2]*Math.pow(2,_*M);t.scaleTo(k)},"zoomHandler"),v=[0,0],b=o(g=>{(g.sourceEvent.type==="mousedown"||g.sourceEvent.type==="touchstart")&&(v=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY])},"panStartHandler"),y=o(g=>{let w=n();if(g.sourceEvent.type!=="mousemove"&&g.sourceEvent.type!=="touchmove"||!t)return;let M=[g.sourceEvent.clientX??g.sourceEvent.touches[0].clientX,g.sourceEvent.clientY??g.sourceEvent.touches[0].clientY],_=[M[0]-v[0],M[1]-v[1]];v=M;let k=r()*Math.max(w[2],Math.log(w[2]))*(p?-1:1),P={x:w[0]-_[0]*k,y:w[1]-_[1]*k},T=[[0,0],[c,u]];t.setViewportConstrained({x:P.x,y:P.y,zoom:w[2]},T,l)},"panHandler"),E=Un().on("start",b).on("zoom",f?y:null).on("zoom.wheel",h?m:null);i.call(E,{})}o(s,"update");function a(){i.on("zoom",null)}return o(a,"destroy"),{update:s,destroy:a,pointer:Me}}o(ka,"XYMinimap");var Wo=o(e=>({x:e.x,y:e.y,zoom:e.k}),"transformToViewport"),vi=o(({x:e,y:t,zoom:n})=>At.translate(e,t).scale(n),"viewportToTransform"),en=o((e,t)=>e.target.closest(`.${t}`),"isWrappedWithClass"),Pa=o((e,t)=>t===2&&Array.isArray(e)&&e.includes(2),"isRightClickPan"),bf=o(e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,"defaultEase"),Si=o((e,t=0,n=bf,r=()=>{})=>{let i=typeof t=="number"&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on("end",r):e},"getD3Transition"),Ta=o(e=>{let t=e.ctrlKey&&cn()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},"wheelDelta");function vf({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:s,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(en(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();let f=n.property("__zoom").k||1;if(d.ctrlKey&&a){let b=Me(d),y=Ta(d),E=f*Math.pow(2,y);r.scaleTo(n,E,b,d);return}let h=d.deltaMode===1?20:1,p=i===et.Vertical?0:d.deltaX*h,m=i===et.Horizontal?0:d.deltaY*h;!cn()&&d.shiftKey&&i!==et.Vertical&&(p=d.deltaY*h,m=0),r.translateBy(n,-(p/f)*s,-(m/f)*s,{internal:!0});let v=Wo(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(d,v):(e.isPanScrolling=!0,l?.(d,v)),e.panScrollTimeout=setTimeout(()=>{u?.(d,v),e.isPanScrolling=!1},150)}}o(vf,"createPanOnScrollHandler");function Sf({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let s=r.type==="wheel",a=!t&&s&&!r.ctrlKey,l=en(r,e);if(r.ctrlKey&&s&&l&&r.preventDefault(),a||l)return null;r.preventDefault(),n.call(this,r,i)}}o(Sf,"createZoomOnScrollHandler");function Ef({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=Wo(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(r.sourceEvent,i)}}o(Ef,"createPanZoomStartHandler");function Cf({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return s=>{e.usedRightMouseButton=!!(n&&Pa(t,e.mouseButton??0)),s.sourceEvent?.sync||r([s.transform.x,s.transform.y,s.transform.k]),i&&!s.sourceEvent?.internal&&i?.(s.sourceEvent,Wo(s.transform))}}o(Cf,"createPanZoomHandler");function _f({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:s}){return a=>{if(!a.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,s&&Pa(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&s(a.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let l=Wo(a.transform);e.prevViewport=l,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(a.sourceEvent,l)},n?150:0)}}}o(_f,"createPanZoomEndHandler");function Nf({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:i,zoomOnDoubleClick:s,userSelectionActive:a,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{let h=e||t,p=n&&f.ctrlKey,m=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(en(f,`${u}-flow__node`)||en(f,`${u}-flow__edge`)))return!0;if(!r&&!h&&!i&&!s&&!n||a||d&&!m||en(f,l)&&m||en(f,c)&&(!m||i&&m&&!e)||!n&&f.ctrlKey&&m)return!1;if(!n&&f.type==="touchstart"&&f.touches?.length>1)return f.preventDefault(),!1;if(!h&&!i&&!p&&m||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;let v=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||m)&&v}}o(Nf,"createFilter");function Aa({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:l,onDraggingChange:c}){let u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=[[0,0],[d.width,d.height]];(typeof ResizeObserver<"u"?new ResizeObserver(L=>{let x=L[0];x&&(f=[[0,0],[x.contentRect.width,x.contentRect.height]])}):null)?.observe(e);let p=Un().extent(()=>f).scaleExtent([t,n]).translateExtent(r),m=Ee(e).call(p);w({x:i.x,y:i.y,zoom:nn(i.zoom,t,n)},[[0,0],[d.width,d.height]],r);let v=m.on("wheel.zoom"),b=m.on("dblclick.zoom");p.wheelDelta(Ta);async function y(L,x){return m?new Promise(S=>{p?.interpolate(x?.interpolate==="linear"?uo:Ut).transform(Si(m,x?.duration,x?.ease,()=>S(!0)),L)}):!1}o(y,"setTransform");function E({noWheelClassName:L,noPanClassName:x,onPaneContextMenu:S,userSelectionActive:C,panOnScroll:I,panOnDrag:O,panOnScrollMode:A,panOnScrollSpeed:B,preventScrolling:F,zoomOnPinch:H,zoomOnScroll:U,zoomOnDoubleClick:Z,zoomActivationKeyPressed:X,lib:j,onTransformChange:K,connectionInProgress:R,paneClickDistance:Y,selectionOnDrag:te}){C&&!u.isZoomingOrPanning&&g();let ee=I&&!X&&!C;p.clickDistance(te?1/0:!Le(Y)||Y<0?0:Y);let q=ee?vf({zoomPanValues:u,noWheelClassName:L,d3Selection:m,d3Zoom:p,panOnScrollMode:A,panOnScrollSpeed:B,zoomOnPinch:H,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:l}):Sf({noWheelClassName:L,preventScrolling:F,d3ZoomHandler:v});m.on("wheel.zoom",q,{passive:!1});let G=Ef({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:a});p.on("start",G);let ne=Cf({zoomPanValues:u,panOnDrag:O,onPaneContextMenu:!!S,onPanZoom:s,onTransformChange:K});p.on("zoom",ne);let oe=_f({zoomPanValues:u,panOnDrag:O,panOnScroll:I,onPaneContextMenu:S,onPanZoomEnd:l,onDraggingChange:c});p.on("end",oe);let se=Nf({zoomActivationKeyPressed:X,panOnDrag:O,zoomOnScroll:U,panOnScroll:I,zoomOnDoubleClick:Z,zoomOnPinch:H,userSelectionActive:C,noPanClassName:x,noWheelClassName:L,lib:j,connectionInProgress:R});p.filter(se),Z?m.on("dblclick.zoom",b):m.on("dblclick.zoom",null)}o(E,"update");function g(){p.on("zoom",null)}o(g,"destroy");async function w(L,x,S){let C=vi(L),I=p?.constrain()(C,x,S);return I&&await y(I),I}o(w,"setViewportConstrained");async function M(L,x){let S=vi(L);return await y(S,x),S}o(M,"setViewport");function _(L){if(m){let x=vi(L),S=m.property("__zoom");(S.k!==L.zoom||S.x!==L.x||S.y!==L.y)&&p?.transform(m,x,null,{sync:!0})}}o(_,"syncViewport");function k(){let L=m?Zn(m.node()):{x:0,y:0,k:1};return{x:L.x,y:L.y,zoom:L.k}}o(k,"getViewport");async function P(L,x){return m?new Promise(S=>{p?.interpolate(x?.interpolate==="linear"?uo:Ut).scaleTo(Si(m,x?.duration,x?.ease,()=>S(!0)),L)}):!1}o(P,"scaleTo");async function T(L,x){return m?new Promise(S=>{p?.interpolate(x?.interpolate==="linear"?uo:Ut).scaleBy(Si(m,x?.duration,x?.ease,()=>S(!0)),L)}):!1}o(T,"scaleBy");function W(L){p?.scaleExtent(L)}o(W,"setScaleExtent");function $(L){p?.translateExtent(L)}o($,"setTranslateExtent");function V(L){let x=!Le(L)||L<0?0:L;p?.clickDistance(x)}return o(V,"setClickDistance"),{update:E,destroy:g,setViewport:M,setViewportConstrained:w,getViewport:k,scaleTo:P,scaleBy:T,setScaleExtent:W,setTranslateExtent:$,syncViewport:_,setClickDistance:V}}o(Aa,"XYPanZoom");var Et;(function(e){e.Line="line",e.Handle="handle"})(Et||(Et={}));function If({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:s}){let a=e-t,l=n-r,c=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&i&&(c[0]=c[0]*-1),l&&s&&(c[1]=c[1]*-1),c}o(If,"getResizeDirection");function oa(e){let t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),i=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:i}}o(oa,"getControlDirection");function wt(e,t){return Math.max(0,t-e)}o(wt,"getLowerExtentClamp");function bt(e,t){return Math.max(0,e-t)}o(bt,"getUpperExtentClamp");function ko(e,t,n){return Math.max(0,t-e,e-n)}o(ko,"getSizeClamp");function ra(e,t){return e?!t:t}o(ra,"xor");function Mf(e,t,n,r,i,s,a,l){let{affectsX:c,affectsY:u}=t,{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:p,ySnapped:m}=n,{minWidth:v,maxWidth:b,minHeight:y,maxHeight:E}=r,{x:g,y:w,width:M,height:_,aspectRatio:k}=e,P=Math.floor(d?p-e.pointerX:0),T=Math.floor(f?m-e.pointerY:0),W=M+(c?-P:P),$=_+(u?-T:T),V=-s[0]*M,L=-s[1]*_,x=ko(W,v,b),S=ko($,y,E);if(a){let O=0,A=0;c&&P<0?O=wt(g+P+V,a[0][0]):!c&&P>0&&(O=bt(g+W+V,a[1][0])),u&&T<0?A=wt(w+T+L,a[0][1]):!u&&T>0&&(A=bt(w+$+L,a[1][1])),x=Math.max(x,O),S=Math.max(S,A)}if(l){let O=0,A=0;c&&P>0?O=bt(g+P,l[0][0]):!c&&P<0&&(O=wt(g+W,l[1][0])),u&&T>0?A=bt(w+T,l[0][1]):!u&&T<0&&(A=wt(w+$,l[1][1])),x=Math.max(x,O),S=Math.max(S,A)}if(i){if(d){let O=ko(W/k,y,E)*k;if(x=Math.max(x,O),a){let A=0;!c&&!u||c&&!u&&h?A=bt(w+L+W/k,a[1][1])*k:A=wt(w+L+(c?P:-P)/k,a[0][1])*k,x=Math.max(x,A)}if(l){let A=0;!c&&!u||c&&!u&&h?A=wt(w+W/k,l[1][1])*k:A=bt(w+(c?P:-P)/k,l[0][1])*k,x=Math.max(x,A)}}if(f){let O=ko($*k,v,b)/k;if(S=Math.max(S,O),a){let A=0;!c&&!u||u&&!c&&h?A=bt(g+$*k+V,a[1][0])/k:A=wt(g+(u?T:-T)*k+V,a[0][0])/k,S=Math.max(S,A)}if(l){let A=0;!c&&!u||u&&!c&&h?A=wt(g+$*k,l[1][0])/k:A=bt(g+(u?T:-T)*k,l[0][0])/k,S=Math.max(S,A)}}}T=T+(T<0?S:-S),P=P+(P<0?x:-x),i&&(h?W>$*k?T=(ra(c,u)?-P:P)/k:P=(ra(c,u)?-T:T)*k:d?(T=P/k,u=c):(P=T*k,c=u));let C=c?g+P:g,I=u?w+T:w;return{width:M+(c?-P:P),height:_+(u?-T:T),x:s[0]*P*(c?-1:1)+C,y:s[1]*T*(u?-1:1)+I}}o(Mf,"getDimensionsAfterResize");var Da={width:0,height:0,x:0,y:0},kf={...Da,pointerX:0,pointerY:0,aspectRatio:1};function Pf(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,s=e.measured.width??0,a=e.measured.height??0,l=n[0]*s,c=n[1]*a;return[[r-l,i-c],[r+s-l,i+a-c]]}o(Pf,"nodeToChildExtent");function za({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let s=Ee(e),a={controlDirection:oa("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:p,onResize:m,onResizeEnd:v,shouldResize:b}){let y={...Da},E={...kf};a={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:oa(u)};let g,w=null,M=[],_,k,P,T=!1,W=zn().on("start",$=>{let{nodeLookup:V,transform:L,snapGrid:x,snapToGrid:S,nodeOrigin:C,paneDomNode:I}=n();if(g=V.get(t),!g)return;w=I?.getBoundingClientRect()??null;let{xSnapped:O,ySnapped:A}=qn($.sourceEvent,{transform:L,snapGrid:x,snapToGrid:S,containerBounds:w});y={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},E={...y,pointerX:O,pointerY:A,aspectRatio:y.width/y.height},_=void 0,k=Rt(g.extent)?g.extent:void 0,g.parentId&&(g.extent==="parent"||g.expandParent)&&(_=V.get(g.parentId)),_&&g.extent==="parent"&&(k=[[0,0],[_.measured.width,_.measured.height]]),M=[],P=void 0;for(let[B,F]of V)if(F.parentId===t&&(M.push({id:B,position:{...F.position},extent:F.extent}),F.extent==="parent"||F.expandParent)){let H=Pf(F,g,F.origin??C);P?P=[[Math.min(H[0][0],P[0][0]),Math.min(H[0][1],P[0][1])],[Math.max(H[1][0],P[1][0]),Math.max(H[1][1],P[1][1])]]:P=H}p?.($,{...y})}).on("drag",$=>{let{transform:V,snapGrid:L,snapToGrid:x,nodeOrigin:S}=n(),C=qn($.sourceEvent,{transform:V,snapGrid:L,snapToGrid:x,containerBounds:w}),I=[];if(!g)return;let{x:O,y:A,width:B,height:F}=y,H={},U=g.origin??S,{width:Z,height:X,x:j,y:K}=Mf(E,a.controlDirection,C,a.boundaries,a.keepAspectRatio,U,k,P),R=Z!==B,Y=X!==F,te=j!==O&&R,ee=K!==A&&Y;if(!te&&!ee&&!R&&!Y)return;if((te||ee||U[0]===1||U[1]===1)&&(H.x=te?j:y.x,H.y=ee?K:y.y,y.x=H.x,y.y=H.y,M.length>0)){let oe=j-O,se=K-A;for(let le of M)le.position={x:le.position.x-oe+U[0]*(Z-B),y:le.position.y-se+U[1]*(X-F)},I.push(le)}if((R||Y)&&(H.width=R&&(!a.resizeDirection||a.resizeDirection==="horizontal")?Z:y.width,H.height=Y&&(!a.resizeDirection||a.resizeDirection==="vertical")?X:y.height,y.width=H.width,y.height=H.height),_&&g.expandParent){let oe=U[0]*(H.width??0);H.x&&H.x<oe&&(y.x=oe,E.x=E.x-(H.x-oe));let se=U[1]*(H.height??0);H.y&&H.y<se&&(y.y=se,E.y=E.y-(H.y-se))}let q=If({width:y.width,prevWidth:B,height:y.height,prevHeight:F,affectsX:a.controlDirection.affectsX,affectsY:a.controlDirection.affectsY}),G={...y,direction:q};b?.($,G)!==!1&&(T=!0,m?.($,G),r(H,I))}).on("end",$=>{T&&(v?.($,{...y}),i?.({...y}),T=!1)});s.call(W)}o(l,"update");function c(){s.on(".drag",null)}return o(c,"destroy"),{update:l,destroy:c}}o(za,"XYResizer");var La=mt(ar(),1),Ha=mt(nu(),1);var Oa=o(e=>{let t,n=new Set,r=o((d,f)=>{let h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){let p=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(m=>m(t,p))}},"setState"),i=o(()=>t,"getState"),c={setState:r,getState:i,getInitialState:o(()=>u,"getInitialState"),subscribe:o(d=>(n.add(d),()=>n.delete(d)),"subscribe"),destroy:o(()=>{(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()},"destroy")},u=t=e(r,i,c);return c},"createStoreImpl"),$a=o(e=>e?Oa(e):Oa,"createStore");var{useDebugValue:Tf}=La.default,{useSyncExternalStoreWithSelector:Af}=Ha.default,Df=o(e=>e,"identity");function Zi(e,t=Df,n){let r=Af(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Tf(r),r}o(Zi,"useStoreWithEqualityFn");var Ra=o((e,t)=>{let n=$a(e),r=o((i,s=t)=>Zi(n,i,s),"useBoundStoreWithEqualityFn");return Object.assign(r,n),r},"createWithEqualityFnImpl"),Ba=o((e,t)=>e?Ra(e,t):Ra,"createWithEqualityFn");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(let[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let r of e)if(!t.has(r))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}o(ue,"shallow$1");var zf=mt(eu());var Uo=(0,D.createContext)(null),Of=Uo.Provider,hl=ze.error001("react");function ie(e,t){let n=(0,D.useContext)(Uo);if(n===null)throw new Error(hl);return Zi(n,e,t)}o(ie,"useStore");function de(){let e=(0,D.useContext)(Uo);if(e===null)throw new Error(hl);return(0,D.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}o(de,"useStoreApi");var Va={display:"none"},$f={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},pl="react-flow__node-desc",ml="react-flow__edge-desc",Rf="react-flow__aria-live",Lf=o(e=>e.ariaLiveMessage,"ariaLiveSelector"),Hf=o(e=>e.ariaLabelConfig,"ariaLabelConfigSelector");function Bf({rfId:e}){let t=ie(Lf);return(0,z.jsx)("div",{id:`${Rf}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:$f,children:t})}o(Bf,"AriaLiveMessage");function Vf({rfId:e,disableKeyboardA11y:t}){let n=ie(Hf);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)("div",{id:`${pl}-${e}`,style:Va,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,z.jsx)("div",{id:`${ml}-${e}`,style:Va,children:n["edge.a11yDescription.default"]}),!t&&(0,z.jsx)(Bf,{rfId:e})]})}o(Vf,"A11yDescriptions");var _t=(0,D.forwardRef)(({position:e="top-left",children:t,className:n,style:r,...i},s)=>{let a=`${e}`.split("-");return(0,z.jsx)("div",{className:ge(["react-flow__panel",n,...a]),style:r,ref:s,...i,children:t})});_t.displayName="Panel";var Fa="https://reactflow.dev?utm_source=attribution";function Ff({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:(0,z.jsx)(_t,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Fa}`,children:(0,z.jsx)("a",{href:Fa,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}o(Ff,"Attribution");var Wf=o(e=>{let t=[],n=[];for(let[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(let[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},"selector$l"),Xo=o(e=>e.id,"selectId");function Xf(e,t){return ue(e.selectedNodes.map(Xo),t.selectedNodes.map(Xo))&&ue(e.selectedEdges.map(Xo),t.selectedEdges.map(Xo))}o(Xf,"areEqual$1");function Yf({onSelectionChange:e}){let t=de(),{selectedNodes:n,selectedEdges:r}=ie(Wf,Xf);return(0,D.useEffect)(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(s=>s(i))},[n,r,e]),null}o(Yf,"SelectionListenerInner");var Zf=o(e=>!!e.onSelectionChangeHandlers,"changeSelector");function Uf({onSelectionChange:e}){let t=ie(Zf);return e||t?(0,z.jsx)(Yf,{onSelectionChange:e}):null}o(Uf,"SelectionListener");var gl=[0,0],qf={x:0,y:0,zoom:1},Gf=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Wa=[...Gf,"rfId"],Kf=o(e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),"selector$k"),Xa={translateExtent:on,nodeOrigin:gl,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Qf(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:s,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:c}=ie(Kf,ue),u=de();(0,D.useEffect)(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=Xa,l()}),[]);let d=(0,D.useRef)(Xa);return(0,D.useEffect)(()=>{for(let f of Wa){let h=e[f],p=d.current[f];h!==p&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?r(h):f==="maxZoom"?i(h):f==="translateExtent"?s(h):f==="nodeExtent"?a(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:fa(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},Wa.map(f=>e[f])),null}o(Qf,"StoreUpdater");function Ya(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}o(Ya,"getMediaQuery");function Jf(e){let[t,n]=(0,D.useState)(e==="system"?null:e);return(0,D.useEffect)(()=>{if(e!=="system"){n(e);return}let r=Ya(),i=o(()=>n(r?.matches?"dark":"light"),"updateColorModeClass");return i(),r?.addEventListener("change",i),()=>{r?.removeEventListener("change",i)}},[e]),t!==null?t:Ya()?.matches?"dark":"light"}o(Jf,"useColorModeClass");var Za=typeof document<"u"?document:null;function jn(e=null,t={target:Za,actInsideInputWithModifier:!0}){let[n,r]=(0,D.useState)(!1),i=(0,D.useRef)(!1),s=(0,D.useRef)(new Set([])),[a,l]=(0,D.useMemo)(()=>{if(e!==null){let u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",`
2
2
  `).replace(`
3
3
 
4
4
  `,`