@swiftcast/clip-editor-react 0.0.1-alpha.4 → 0.0.1-alpha.5

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 (188) hide show
  1. package/dist/index.html +1 -1
  2. package/dist/mf-manifest.json +37 -1200
  3. package/dist/mf-stats.json +38 -1566
  4. package/dist/remoteEntry.js +5 -5
  5. package/dist/static/js/{8094.03bf5edc.js → 94.955b8fbb.js} +3 -3
  6. package/dist/static/js/async/194.fb5067a8.js +1 -0
  7. package/dist/static/js/async/216.512fc3b8.js +3 -0
  8. package/dist/static/js/async/216.512fc3b8.js.LICENSE.txt +38 -0
  9. package/dist/static/js/async/353.5233ade4.js +175 -0
  10. package/dist/static/js/async/353.5233ade4.js.LICENSE.txt +144 -0
  11. package/dist/static/js/async/355.58550f0f.js +3 -0
  12. package/dist/static/js/async/{5128.27f2ad05.js.LICENSE.txt → 355.58550f0f.js.LICENSE.txt} +14 -2
  13. package/dist/static/js/async/375.444c8914.js +1 -0
  14. package/dist/static/js/async/491.179841c1.js +1 -0
  15. package/dist/static/js/async/510.09d21b18.js +36 -0
  16. package/dist/static/js/async/{1690.28cd4402.js.LICENSE.txt → 510.09d21b18.js.LICENSE.txt} +36 -0
  17. package/dist/static/js/async/525.9c60477e.js +1 -0
  18. package/dist/static/js/async/661.4302c83b.js +8 -0
  19. package/dist/static/js/async/{5285.fe1791d9.js.LICENSE.txt → 661.4302c83b.js.LICENSE.txt} +8 -1
  20. package/dist/static/js/async/682.f9ec3784.js +2 -0
  21. package/dist/static/js/async/852.5fbbde64.js +6 -0
  22. package/dist/static/js/async/929.8efefefe.js +1 -0
  23. package/dist/static/js/async/__federation_expose_ProjectsPage.e597d172.js +2 -0
  24. package/dist/static/js/async/{6452.a2c7f164.js.LICENSE.txt → __federation_expose_ProjectsPage.e597d172.js.LICENSE.txt} +1 -1
  25. package/dist/static/js/async/__federation_expose_SniffingPage.b7d88010.js +1 -0
  26. package/dist/static/js/async/__federation_expose_WorkFlow.e18339ec.js +11 -0
  27. package/dist/static/js/async/lib-axios.64c3f6d8.js +1 -0
  28. package/dist/static/js/index.c98d9791.js +1 -0
  29. package/package.json +1 -1
  30. package/dist/static/js/async/109.256a32bd.js +0 -2
  31. package/dist/static/js/async/109.256a32bd.js.LICENSE.txt +0 -9
  32. package/dist/static/js/async/1099.7ec4a1d4.js +0 -1
  33. package/dist/static/js/async/1167.eafb458c.js +0 -1
  34. package/dist/static/js/async/1229.3824b191.js +0 -1
  35. package/dist/static/js/async/1358.c5623f2c.js +0 -2
  36. package/dist/static/js/async/1358.c5623f2c.js.LICENSE.txt +0 -9
  37. package/dist/static/js/async/1359.c78c33cc.js +0 -1
  38. package/dist/static/js/async/1408.45dd942f.js +0 -1
  39. package/dist/static/js/async/1475.ca68a958.js +0 -2
  40. package/dist/static/js/async/1475.ca68a958.js.LICENSE.txt +0 -9
  41. package/dist/static/js/async/1491.afc05a88.js +0 -1
  42. package/dist/static/js/async/1536.acd44187.js +0 -2
  43. package/dist/static/js/async/1536.acd44187.js.LICENSE.txt +0 -9
  44. package/dist/static/js/async/1545.339b9e4a.js +0 -1
  45. package/dist/static/js/async/1663.0a34b1a6.js +0 -2
  46. package/dist/static/js/async/1663.0a34b1a6.js.LICENSE.txt +0 -9
  47. package/dist/static/js/async/1677.4c84f733.js +0 -2
  48. package/dist/static/js/async/1677.4c84f733.js.LICENSE.txt +0 -9
  49. package/dist/static/js/async/1690.28cd4402.js +0 -2
  50. package/dist/static/js/async/1855.dc79d72c.js +0 -1
  51. package/dist/static/js/async/1921.7437e362.js +0 -1
  52. package/dist/static/js/async/2068.600661ee.js +0 -1
  53. package/dist/static/js/async/2111.5db2cfc1.js +0 -2
  54. package/dist/static/js/async/2111.5db2cfc1.js.LICENSE.txt +0 -9
  55. package/dist/static/js/async/213.94b97063.js +0 -1
  56. package/dist/static/js/async/2199.65d29190.js +0 -1
  57. package/dist/static/js/async/2305.9e6f32d6.js +0 -2
  58. package/dist/static/js/async/2305.9e6f32d6.js.LICENSE.txt +0 -8
  59. package/dist/static/js/async/2375.042f6260.js +0 -1
  60. package/dist/static/js/async/2469.fc8a042e.js +0 -1
  61. package/dist/static/js/async/2746.01a51768.js +0 -2
  62. package/dist/static/js/async/2746.01a51768.js.LICENSE.txt +0 -1
  63. package/dist/static/js/async/2790.ff501683.js +0 -5
  64. package/dist/static/js/async/2900.6ab855e9.js +0 -1
  65. package/dist/static/js/async/2927.6711b41c.js +0 -2
  66. package/dist/static/js/async/2927.6711b41c.js.LICENSE.txt +0 -45
  67. package/dist/static/js/async/3126.500697e8.js +0 -1
  68. package/dist/static/js/async/3145.6d46bb3e.js +0 -1
  69. package/dist/static/js/async/3328.3edb2c5f.js +0 -7
  70. package/dist/static/js/async/3328.3edb2c5f.js.LICENSE.txt +0 -9
  71. package/dist/static/js/async/3357.3cc4b057.js +0 -1
  72. package/dist/static/js/async/3358.f439fe77.js +0 -3
  73. package/dist/static/js/async/3436.02b7dced.js +0 -2
  74. package/dist/static/js/async/3436.02b7dced.js.LICENSE.txt +0 -9
  75. package/dist/static/js/async/35.63ec382c.js +0 -2
  76. package/dist/static/js/async/35.63ec382c.js.LICENSE.txt +0 -9
  77. package/dist/static/js/async/3500.2a5e861e.js +0 -2
  78. package/dist/static/js/async/3500.2a5e861e.js.LICENSE.txt +0 -5
  79. package/dist/static/js/async/3714.3de0cc07.js +0 -1
  80. package/dist/static/js/async/3761.30e06c21.js +0 -2
  81. package/dist/static/js/async/4437.c013a47e.js +0 -1
  82. package/dist/static/js/async/4516.86f759b3.js +0 -1
  83. package/dist/static/js/async/4588.381756a4.js +0 -4
  84. package/dist/static/js/async/4617.3c1cb2e1.js +0 -1
  85. package/dist/static/js/async/4804.4b5a6c4b.js +0 -1
  86. package/dist/static/js/async/4964.31141e42.js +0 -1
  87. package/dist/static/js/async/5040.ad9e108f.js +0 -2
  88. package/dist/static/js/async/5040.ad9e108f.js.LICENSE.txt +0 -9
  89. package/dist/static/js/async/5058.6c88d364.js +0 -2
  90. package/dist/static/js/async/5058.6c88d364.js.LICENSE.txt +0 -62
  91. package/dist/static/js/async/5083.a594c3b4.js +0 -2
  92. package/dist/static/js/async/5083.a594c3b4.js.LICENSE.txt +0 -9
  93. package/dist/static/js/async/5127.095785dd.js +0 -2
  94. package/dist/static/js/async/5127.095785dd.js.LICENSE.txt +0 -9
  95. package/dist/static/js/async/5128.27f2ad05.js +0 -2
  96. package/dist/static/js/async/5184.c393a127.js +0 -1
  97. package/dist/static/js/async/5218.87494e0c.js +0 -1
  98. package/dist/static/js/async/5285.fe1791d9.js +0 -5
  99. package/dist/static/js/async/5408.253200ee.js +0 -1
  100. package/dist/static/js/async/5450.359d95c3.js +0 -1
  101. package/dist/static/js/async/5469.f0179be1.js +0 -1
  102. package/dist/static/js/async/5522.cc016a92.js +0 -1
  103. package/dist/static/js/async/5770.c3d8277f.js +0 -1
  104. package/dist/static/js/async/5876.36f8e85a.js +0 -2
  105. package/dist/static/js/async/5876.36f8e85a.js.LICENSE.txt +0 -9
  106. package/dist/static/js/async/5921.bfb648cb.js +0 -1
  107. package/dist/static/js/async/6127.1257e70c.js +0 -1
  108. package/dist/static/js/async/6140.5479e7b9.js +0 -2
  109. package/dist/static/js/async/6140.5479e7b9.js.LICENSE.txt +0 -9
  110. package/dist/static/js/async/6297.336e7ffc.js +0 -2
  111. package/dist/static/js/async/6297.336e7ffc.js.LICENSE.txt +0 -9
  112. package/dist/static/js/async/6452.a2c7f164.js +0 -2
  113. package/dist/static/js/async/6504.53e9c9c5.js +0 -1
  114. package/dist/static/js/async/6678.fe09eab0.js +0 -1
  115. package/dist/static/js/async/6682.e0084aeb.js +0 -2
  116. package/dist/static/js/async/6703.f8fca121.js +0 -1
  117. package/dist/static/js/async/6716.50326c01.js +0 -2
  118. package/dist/static/js/async/6716.50326c01.js.LICENSE.txt +0 -8
  119. package/dist/static/js/async/6734.4a52d73f.js +0 -6
  120. package/dist/static/js/async/6964.d244eb15.js +0 -7
  121. package/dist/static/js/async/7300.69a06cf8.js +0 -1
  122. package/dist/static/js/async/7420.4846bd05.js +0 -2
  123. package/dist/static/js/async/7420.4846bd05.js.LICENSE.txt +0 -9
  124. package/dist/static/js/async/7426.2ccadab1.js +0 -1
  125. package/dist/static/js/async/747.3568c169.js +0 -2
  126. package/dist/static/js/async/747.3568c169.js.LICENSE.txt +0 -9
  127. package/dist/static/js/async/753.c9fb4bb6.js +0 -2
  128. package/dist/static/js/async/753.c9fb4bb6.js.LICENSE.txt +0 -8
  129. package/dist/static/js/async/7560.cfdf6fc1.js +0 -3
  130. package/dist/static/js/async/7560.cfdf6fc1.js.LICENSE.txt +0 -19
  131. package/dist/static/js/async/7693.99348793.js +0 -2
  132. package/dist/static/js/async/7693.99348793.js.LICENSE.txt +0 -6
  133. package/dist/static/js/async/7785.4146afc2.js +0 -1
  134. package/dist/static/js/async/7855.3a70056f.js +0 -1
  135. package/dist/static/js/async/787.fe3d07c6.js +0 -1
  136. package/dist/static/js/async/7889.09b20686.js +0 -1
  137. package/dist/static/js/async/7961.5d19744b.js +0 -1
  138. package/dist/static/js/async/8062.09a6fdbd.js +0 -2
  139. package/dist/static/js/async/8062.09a6fdbd.js.LICENSE.txt +0 -9
  140. package/dist/static/js/async/8112.26771b29.js +0 -1
  141. package/dist/static/js/async/8145.7711418b.js +0 -1
  142. package/dist/static/js/async/8194.e3680a0e.js +0 -1
  143. package/dist/static/js/async/8247.71ad8780.js +0 -1
  144. package/dist/static/js/async/8314.4fbcc580.js +0 -2
  145. package/dist/static/js/async/8314.4fbcc580.js.LICENSE.txt +0 -9
  146. package/dist/static/js/async/8327.d70b6d2b.js +0 -2
  147. package/dist/static/js/async/8327.d70b6d2b.js.LICENSE.txt +0 -9
  148. package/dist/static/js/async/8377.491112d2.js +0 -1
  149. package/dist/static/js/async/8430.cc4ab0b0.js +0 -2
  150. package/dist/static/js/async/8430.cc4ab0b0.js.LICENSE.txt +0 -9
  151. package/dist/static/js/async/8512.ae31acae.js +0 -2
  152. package/dist/static/js/async/8512.ae31acae.js.LICENSE.txt +0 -9
  153. package/dist/static/js/async/8522.7b59f26a.js +0 -17
  154. package/dist/static/js/async/8572.889a2f0f.js +0 -1
  155. package/dist/static/js/async/8636.3a0609ce.js +0 -4
  156. package/dist/static/js/async/8652.231efd09.js +0 -1
  157. package/dist/static/js/async/8719.d5d23e80.js +0 -1
  158. package/dist/static/js/async/8865.2104211d.js +0 -8
  159. package/dist/static/js/async/8895.153ddc5f.js +0 -2
  160. package/dist/static/js/async/8895.153ddc5f.js.LICENSE.txt +0 -19
  161. package/dist/static/js/async/8913.64eea008.js +0 -1
  162. package/dist/static/js/async/8964.196834ba.js +0 -1
  163. package/dist/static/js/async/9047.c6fa7623.js +0 -452
  164. package/dist/static/js/async/9047.c6fa7623.js.LICENSE.txt +0 -117
  165. package/dist/static/js/async/905.4340e6d5.js +0 -2
  166. package/dist/static/js/async/905.4340e6d5.js.LICENSE.txt +0 -5
  167. package/dist/static/js/async/9146.efbecec7.js +0 -1
  168. package/dist/static/js/async/9149.82308d8f.js +0 -1
  169. package/dist/static/js/async/9249.622a286f.js +0 -2
  170. package/dist/static/js/async/9249.622a286f.js.LICENSE.txt +0 -5
  171. package/dist/static/js/async/9525.2192486e.js +0 -1
  172. package/dist/static/js/async/9594.516654c9.js +0 -2
  173. package/dist/static/js/async/9594.516654c9.js.LICENSE.txt +0 -9
  174. package/dist/static/js/async/9630.c795adce.js +0 -1
  175. package/dist/static/js/async/9669.dc59da89.js +0 -75
  176. package/dist/static/js/async/9798.20a5011c.js +0 -2
  177. package/dist/static/js/async/9798.20a5011c.js.LICENSE.txt +0 -9
  178. package/dist/static/js/async/9854.c86b795e.js +0 -1
  179. package/dist/static/js/async/9905.e5456d13.js +0 -2
  180. package/dist/static/js/async/9905.e5456d13.js.LICENSE.txt +0 -9
  181. package/dist/static/js/async/9973.04e09e35.js +0 -1
  182. package/dist/static/js/async/__federation_expose_ProjectsPage.d61a8a68.js +0 -1
  183. package/dist/static/js/async/__federation_expose_SniffingPage.79823a67.js +0 -1
  184. package/dist/static/js/async/__federation_expose_WorkFlow.39bd1b8e.js +0 -11
  185. package/dist/static/js/index.03348712.js +0 -1
  186. /package/dist/static/css/async/{9139.ecec5306.css → 139.ecec5306.css} +0 -0
  187. /package/dist/static/js/async/{6682.e0084aeb.js.LICENSE.txt → 682.f9ec3784.js.LICENSE.txt} +0 -0
  188. /package/dist/static/js/async/{3761.30e06c21.js.LICENSE.txt → 852.5fbbde64.js.LICENSE.txt} +0 -0
@@ -1,8 +0,0 @@
1
- /** @license React v16.13.1
2
- * react-is.production.min.js
3
- *
4
- * Copyright (c) Facebook, Inc. and its affiliates.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE file in the root directory of this source tree.
8
- */
@@ -1,3 +0,0 @@
1
- /*! For license information please see 7560.cfdf6fc1.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkremote=self.webpackChunkremote||[]).push([["7560"],{40099:function(e,t,n){n.r(t),n.d(t,{useInternalNode:()=>ay,Position:()=>y,SelectionMode:()=>p,useEdgesState:()=>as,ResizeControlVariant:()=>v,useConnection:()=>iq,useNodesInitialized:()=>af,MiniMap:()=>aL,addEdge:()=>n3,getSimpleBezierPath:()=>ig,Controls:()=>a$,EdgeText:()=>id,Handle:()=>r0,useNodes:()=>an,getBezierEdgeCenter:()=>nG,getViewportForBounds:()=>nO,ViewportPortal:()=>i7,useNodesState:()=>al,MarkerType:()=>m,Background:()=>aS,useStoreApi:()=>oJ,applyNodeChanges:()=>rx,isEdge:()=>rk,useOnViewportChange:()=>au,StepEdge:()=>iS,Panel:()=>o9,NodeResizer:()=>aF,getStraightPath:()=>n6,getConnectedEdges:()=>nh,useReactFlow:()=>rI,useStore:()=>oQ,ReactFlow:()=>i4,applyEdgeChanges:()=>rw,ConnectionMode:()=>f,ReactFlowProvider:()=>i2,isNode:()=>rM,useNodesData:()=>am,useViewport:()=>aa,BackgroundVariant:()=>x,SimpleBezierEdge:()=>iy,EdgeLabelRenderer:()=>i8,useNodeConnections:()=>ag,PanOnScrollMode:()=>h,StraightEdge:()=>ik,ConnectionLineType:()=>g,ControlButton:()=>aA,NodeToolbar:()=>aK,getNodesBounds:()=>nc,useUpdateNodeInternals:()=>ae,getSmoothStepPath:()=>oe,useOnSelectionChange:()=>ac,BaseEdge:()=>ih,BezierEdge:()=>iA,reconnectEdge:()=>n4,getIncomers:()=>ns,useEdges:()=>ar,useHandleConnections:()=>ah,getBezierPath:()=>n0,NodeResizeControl:()=>aV,SmoothStepEdge:()=>iw,getEdgeCenter:()=>n1,useNodeId:()=>rG,useKeyPress:()=>rp,getOutgoers:()=>nl});var o,r,i,a,l,s,u,c,d,f,h,p,g,m,y,v,x,w=n(31549),b=n(8491);function _(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n=0,o;n<e.length;n++)""!==(o=_(e[n]))&&(t+=(t&&" ")+o);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var S={value:()=>{}};function E(){for(var e,t=0,n=arguments.length,o={};t<n;++t){if(!(e=arguments[t]+"")||e in o||/[\s.]/.test(e))throw Error("illegal type: "+e);o[e]=[]}return new M(o)}function M(e){this._=e}function k(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=S,e=e.slice(0,o).concat(e.slice(o+1));break}return null!=n&&e.push({name:t,value:n}),e}function N(){}function C(e){return null==e?N:function(){return this.querySelector(e)}}function A(){return[]}function P(e){return null==e?A:function(){return this.querySelectorAll(e)}}function z(e){return function(){return this.matches(e)}}function $(e){return function(t){return t.matches(e)}}M.prototype=E.prototype={constructor:M,on:function(e,t){var n,o=this._,r=(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!o.hasOwnProperty(e))throw Error("unknown type: "+e);return{type:e,name:t}}),i=-1,a=r.length;if(arguments.length<2){for(;++i<a;)if((n=(e=r[i]).type)&&(n=function(e,t){for(var n,o=0,r=e.length;o<r;++o)if((n=e[o]).name===t)return n.value}(o[n],e.name)))return n;return}if(null!=t&&"function"!=typeof t)throw Error("invalid callback: "+t);for(;++i<a;)if(n=(e=r[i]).type)o[n]=k(o[n],e.name,t);else if(null==t)for(n in o)o[n]=k(o[n],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new M(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,o,r=Array(n),i=0;i<n;++i)r[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(o=this._[e],i=0,n=o.length;i<n;++i)o[i].value.apply(t,r)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};var I=Array.prototype.find;function R(){return this.firstElementChild}var j=Array.prototype.filter;function O(){return Array.from(this.children)}function B(e){return Array(e.length)}function D(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function H(e,t,n,o,r,i){for(var a,l=0,s=t.length,u=i.length;l<u;++l)(a=t[l])?(a.__data__=i[l],o[l]=a):n[l]=new D(e,i[l]);for(;l<s;++l)(a=t[l])&&(r[l]=a)}function T(e,t,n,o,r,i,a){var l,s,u,c=new Map,d=t.length,f=i.length,h=Array(d);for(l=0;l<d;++l)(s=t[l])&&(h[l]=u=a.call(s,s.__data__,l,t)+"",c.has(u)?r[l]=s:c.set(u,s));for(l=0;l<f;++l)u=a.call(e,i[l],l,i)+"",(s=c.get(u))?(o[l]=s,s.__data__=i[l],c.delete(u)):n[l]=new D(e,i[l]);for(l=0;l<d;++l)(s=t[l])&&c.get(h[l])===s&&(r[l]=s)}function L(e){return e.__data__}function V(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}D.prototype={constructor:D,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var F="http://www.w3.org/1999/xhtml";let X={svg:"http://www.w3.org/2000/svg",xhtml:F,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Y(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),X.hasOwnProperty(t)?{space:X[t],local:e}:e}function q(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function W(e,t){return e.style.getPropertyValue(t)||q(e).getComputedStyle(e,null).getPropertyValue(t)}function Z(e){return e.trim().split(/^|\s+/)}function K(e){return e.classList||new U(e)}function U(e){this._node=e,this._names=Z(e.getAttribute("class")||"")}function G(e,t){for(var n=K(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function Q(e,t){for(var n=K(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function J(){this.textContent=""}function ee(){this.innerHTML=""}function et(){this.nextSibling&&this.parentNode.appendChild(this)}function en(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function eo(e){var t=Y(e);return(t.local?function(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}:function(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===F&&t.documentElement.namespaceURI===F?t.createElement(e):t.createElementNS(n,e)}})(t)}function er(){return null}function ei(){var e=this.parentNode;e&&e.removeChild(this)}function ea(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function el(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function es(e){return function(){var t=this.__on;if(t){for(var n,o=0,r=-1,i=t.length;o<i;++o)(n=t[o],e.type&&n.type!==e.type||n.name!==e.name)?t[++r]=n:this.removeEventListener(n.type,n.listener,n.options);++r?t.length=r:delete this.__on}}}function eu(e,t,n){return function(){var o,r=this.__on,i=function(e){t.call(this,e,this.__data__)};if(r){for(var a=0,l=r.length;a<l;++a)if((o=r[a]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function ec(e,t,n){var o=q(e),r=o.CustomEvent;"function"==typeof r?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}U.prototype={add:function(e){0>this._names.indexOf(e)&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var ed=[null];function ef(e,t){this._groups=e,this._parents=t}function eh(){return new ef([[document.documentElement]],ed)}function ep(e){return"string"==typeof e?new ef([[document.querySelector(e)]],[document.documentElement]):new ef([[e]],ed)}function eg(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,[(o=o.matrixTransform(t.getScreenCTM().inverse())).x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}ef.prototype=eh.prototype={constructor:ef,select:function(e){"function"!=typeof e&&(e=C(e));for(var t=this._groups,n=t.length,o=Array(n),r=0;r<n;++r)for(var i,a,l=t[r],s=l.length,u=o[r]=Array(s),c=0;c<s;++c)(i=l[c])&&(a=e.call(i,i.__data__,c,l))&&("__data__"in i&&(a.__data__=i.__data__),u[c]=a);return new ef(o,this._parents)},selectAll:function(e){if("function"==typeof e){var t;t=e,e=function(){var e;return e=t.apply(this,arguments),null==e?[]:Array.isArray(e)?e:Array.from(e)}}else e=P(e);for(var n=this._groups,o=n.length,r=[],i=[],a=0;a<o;++a)for(var l,s=n[a],u=s.length,c=0;c<u;++c)(l=s[c])&&(r.push(e.call(l,l.__data__,c,s)),i.push(l));return new ef(r,i)},selectChild:function(e){var t;return this.select(null==e?R:(t="function"==typeof e?e:$(e),function(){return I.call(this.children,t)}))},selectChildren:function(e){var t;return this.selectAll(null==e?O:(t="function"==typeof e?e:$(e),function(){return j.call(this.children,t)}))},filter:function(e){"function"!=typeof e&&(e=z(e));for(var t=this._groups,n=t.length,o=Array(n),r=0;r<n;++r)for(var i,a=t[r],l=a.length,s=o[r]=[],u=0;u<l;++u)(i=a[u])&&e.call(i,i.__data__,u,a)&&s.push(i);return new ef(o,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,L);var n=t?T:H,o=this._parents,r=this._groups;"function"!=typeof e&&(v=e,e=function(){return v});for(var i=r.length,a=Array(i),l=Array(i),s=Array(i),u=0;u<i;++u){var c=o[u],d=r[u],f=d.length,h="object"==typeof(y=e.call(c,c&&c.__data__,u,o))&&"length"in y?y:Array.from(y),p=h.length,g=l[u]=Array(p),m=a[u]=Array(p);n(c,d,g,m,s[u]=Array(f),h,t);for(var y,v,x,w,b=0,_=0;b<p;++b)if(x=g[b]){for(b>=_&&(_=b+1);!(w=m[_])&&++_<p;);x._next=w||null}}return(a=new ef(a,o))._enter=l,a._exit=s,a},enter:function(){return new ef(this._enter||this._groups.map(B),this._parents)},exit:function(){return new ef(this._exit||this._groups.map(B),this._parents)},join:function(e,t,n){var o=this.enter(),r=this,i=this.exit();return"function"==typeof e?(o=e(o))&&(o=o.selection()):o=o.append(e+""),null!=t&&(r=t(r))&&(r=r.selection()),null==n?i.remove():n(i),o&&r?o.merge(r).order():r},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,a=Math.min(r,i),l=Array(r),s=0;s<a;++s)for(var u,c=n[s],d=o[s],f=c.length,h=l[s]=Array(f),p=0;p<f;++p)(u=c[p]||d[p])&&(h[p]=u);for(;s<r;++s)l[s]=n[s];return new ef(l,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o,r=e[t],i=r.length-1,a=r[i];--i>=0;)(o=r[i])&&(a&&4^o.compareDocumentPosition(a)&&a.parentNode.insertBefore(o,a),a=o);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=V);for(var n=this._groups,o=n.length,r=Array(o),i=0;i<o;++i){for(var a,l=n[i],s=l.length,u=r[i]=Array(s),c=0;c<s;++c)(a=l[c])&&(u[c]=a);u.sort(t)}return new ef(r,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var a=o[r];if(a)return a}return null},size:function(){let e=0;for(let t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r,i=t[n],a=0,l=i.length;a<l;++a)(r=i[a])&&e.call(r,r.__data__,a,i);return this},attr:function(e,t){var n=Y(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((null==t?n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}}:"function"==typeof t?n.local?function(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}:function(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}:n.local?function(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}:function(e,t){return function(){this.setAttribute(e,t)}})(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?function(e){return function(){this.style.removeProperty(e)}}:"function"==typeof t?function(e,t,n){return function(){var o=t.apply(this,arguments);null==o?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}:function(e,t,n){return function(){this.style.setProperty(e,t,n)}})(e,t,null==n?"":n)):W(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?function(e){return function(){delete this[e]}}:"function"==typeof t?function(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}:function(e,t){return function(){this[e]=t}})(e,t)):this.node()[e]},classed:function(e,t){var n=Z(e+"");if(arguments.length<2){for(var o=K(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each(("function"==typeof t?function(e,t){return function(){(t.apply(this,arguments)?G:Q)(this,e)}}:t?function(e){return function(){G(this,e)}}:function(e){return function(){Q(this,e)}})(n,t))},text:function(e){return arguments.length?this.each(null==e?J:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}:function(e){return function(){this.textContent=e}})(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?ee:("function"==typeof e?function(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}:function(e){return function(){this.innerHTML=e}})(e)):this.node().innerHTML},raise:function(){return this.each(et)},lower:function(){return this.each(en)},append:function(e){var t="function"==typeof e?e:eo(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:eo(e),o=null==t?er:"function"==typeof t?t:C(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})},remove:function(){return this.each(ei)},clone:function(e){return this.select(e?el:ea)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var o,r,i=(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}}),a=i.length;if(arguments.length<2){var l=this.node().__on;if(l){for(var s,u=0,c=l.length;u<c;++u)for(o=0,s=l[u];o<a;++o)if((r=i[o]).type===s.type&&r.name===s.name)return s.value}return}for(o=0,l=t?eu:es;o<a;++o)this.each(l(i[o],t,n));return this},dispatch:function(e,t){return this.each(("function"==typeof t?function(e,t){return function(){return ec(this,e,t.apply(this,arguments))}}:function(e,t){return function(){return ec(this,e,t)}})(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o,r=e[t],i=0,a=r.length;i<a;++i)(o=r[i])&&(yield o)}};let em={passive:!1},ey={capture:!0,passive:!1};function ev(e){e.stopImmediatePropagation()}function ex(e){e.preventDefault(),e.stopImmediatePropagation()}function ew(e){var t=e.document.documentElement,n=ep(e).on("dragstart.drag",ex,ey);"onselectstart"in t?n.on("selectstart.drag",ex,ey):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function eb(e,t){var n=e.document.documentElement,o=ep(e).on("dragstart.drag",null);t&&(o.on("click.drag",ex,ey),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}let e_=e=>()=>e;function eS(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:a,y:l,dx:s,dy:u,dispatch:c}){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:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:s,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}function eE(e){return!e.ctrlKey&&!e.button}function eM(){return this.parentNode}function ek(e,t){return null==t?{x:e.x,y:e.y}:t}function eN(){return navigator.maxTouchPoints||"ontouchstart"in this}function eC(){var e,t,n,o,r=eE,i=eM,a=ek,l=eN,s={},u=E("start","drag","end"),c=0,d=0;function f(e){e.on("mousedown.drag",h).filter(l).on("touchstart.drag",m).on("touchmove.drag",y,em).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function h(a,l){if(!o&&r.call(this,a,l)){var s=x(this,i.call(this,a,l),a,l,"mouse");s&&(ep(a.view).on("mousemove.drag",p,ey).on("mouseup.drag",g,ey),ew(a.view),ev(a),n=!1,e=a.clientX,t=a.clientY,s("start",a))}}function p(o){if(ex(o),!n){var r=o.clientX-e,i=o.clientY-t;n=r*r+i*i>d}s.mouse("drag",o)}function g(e){ep(e.view).on("mousemove.drag mouseup.drag",null),eb(e.view,n),ex(e),s.mouse("end",e)}function m(e,t){if(r.call(this,e,t)){var n,o,a=e.changedTouches,l=i.call(this,e,t),s=a.length;for(n=0;n<s;++n)(o=x(this,l,e,t,a[n].identifier,a[n]))&&(ev(e),o("start",e,a[n]))}}function y(e){var t,n,o=e.changedTouches,r=o.length;for(t=0;t<r;++t)(n=s[o[t].identifier])&&(ex(e),n("drag",e,o[t]))}function v(e){var t,n,r=e.changedTouches,i=r.length;for(o&&clearTimeout(o),o=setTimeout(function(){o=null},500),t=0;t<i;++t)(n=s[r[t].identifier])&&(ev(e),n("end",e,r[t]))}function x(e,t,n,o,r,i){var l,d,h,p=u.copy(),g=eg(i||n,t);if(null!=(h=a.call(e,new eS("beforestart",{sourceEvent:n,target:f,identifier:r,active:c,x:g[0],y:g[1],dx:0,dy:0,dispatch:p}),o)))return l=h.x-g[0]||0,d=h.y-g[1]||0,function n(i,a,u){var m,y=g;switch(i){case"start":s[r]=n,m=c++;break;case"end":delete s[r],--c;case"drag":g=eg(u||a,t),m=c}p.call(i,e,new eS(i,{sourceEvent:a,subject:h,target:f,identifier:r,active:m,x:g[0]+l,y:g[1]+d,dx:g[0]-y[0],dy:g[1]-y[1],dispatch:p}),o)}}return f.filter=function(e){return arguments.length?(r="function"==typeof e?e:e_(!!e),f):r},f.container=function(e){return arguments.length?(i="function"==typeof e?e:e_(e),f):i},f.subject=function(e){return arguments.length?(a="function"==typeof e?e:e_(e),f):a},f.touchable=function(e){return arguments.length?(l="function"==typeof e?e:e_(!!e),f):l},f.on=function(){var e=u.on.apply(u,arguments);return e===u?f:e},f.clickDistance=function(e){return arguments.length?(d=(e*=1)*e,f):Math.sqrt(d)},f}function eA(e){return((e=Math.exp(e))+1/e)/2}eS.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};let eP=function e(t,n,o){function r(e,r){var i,a,l=e[0],s=e[1],u=e[2],c=r[0],d=r[1],f=r[2],h=c-l,p=d-s,g=h*h+p*p;if(g<1e-12)a=Math.log(f/u)/t,i=function(e){return[l+e*h,s+e*p,u*Math.exp(t*e*a)]};else{var m=Math.sqrt(g),y=(f*f-u*u+o*g)/(2*u*n*m),v=(f*f-u*u-o*g)/(2*f*n*m),x=Math.log(Math.sqrt(y*y+1)-y);a=(Math.log(Math.sqrt(v*v+1)-v)-x)/t,i=function(e){var o,r,i=e*a,c=eA(x),d=u/(n*m)*(c*(((o=Math.exp(2*(o=t*i+x)))-1)/(o+1))-((r=Math.exp(r=x))-1/r)/2);return[l+d*h,s+d*p,u*c/eA(t*i+x)]}}return i.duration=1e3*a*t/Math.SQRT2,i}return r.rho=function(t){var n=Math.max(.001,+t),o=n*n;return e(n,o,o*o)},r}(Math.SQRT2,2,4);var ez,e$,eI=0,eR=0,ej=0,eO=0,eB=0,eD=0,eH="object"==typeof performance&&performance.now?performance:Date,eT="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function eL(){return eB||(eT(eV),eB=eH.now()+eD)}function eV(){eB=0}function eF(){this._call=this._time=this._next=null}function eX(e,t,n){var o=new eF;return o.restart(e,t,n),o}function eY(){eB=(eO=eH.now())+eD,eI=eR=0;try{eL(),++eI;for(var e,t=ez;t;)(e=eB-t._time)>=0&&t._call.call(void 0,e),t=t._next;--eI}finally{eI=0,function(){for(var e,t,n=ez,o=1/0;n;)n._call?(o>n._time&&(o=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:ez=t);e$=e,eW(o)}(),eB=0}}function eq(){var e=eH.now(),t=e-eO;t>1e3&&(eD-=t,eO=e)}function eW(e){!eI&&(eR&&(eR=clearTimeout(eR)),e-eB>24?(e<1/0&&(eR=setTimeout(eY,e-eH.now()-eD)),ej&&(ej=clearInterval(ej))):(ej||(eO=eH.now(),ej=setInterval(eq,1e3)),eI=1,eT(eY)))}function eZ(e,t,n){var o=new eF;return t=null==t?0:+t,o.restart(n=>{o.stop(),e(n+t)},t,n),o}eF.prototype=eX.prototype={constructor:eF,restart:function(e,t,n){if("function"!=typeof e)throw TypeError("callback is not a function");n=(null==n?eL():+n)+(null==t?0:+t),this._next||e$===this||(e$?e$._next=this:ez=this,e$=this),this._call=e,this._time=n,eW()},stop:function(){this._call&&(this._call=null,this._time=1/0,eW())}};var eK=E("start","end","cancel","interrupt"),eU=[];function eG(e,t,n,o,r,i){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var o,r=e.__transition;function i(s){var u,c,d,f;if(1!==n.state)return l();for(u in r)if((f=r[u]).name===n.name){if(3===f.state)return eZ(i);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete r[u]):+u<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete r[u])}if(eZ(function(){3===n.state&&(n.state=4,n.timer.restart(a,n.delay,n.time),a(s))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(u=0,n.state=3,o=Array(d=n.tween.length),c=-1;u<d;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(o[++c]=f);o.length=c+1}}function a(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),i=-1,a=o.length;++i<a;)o[i].call(e,r);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var o in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}r[t]=n,n.timer=eX(function(e){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=e&&i(e-n.delay)},0,n.time)}(e,n,{name:t,index:o,group:r,on:eK,tween:eU,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function eQ(e,t){var n=e0(e,t);if(n.state>0)throw Error("too late; already scheduled");return n}function eJ(e,t){var n=e0(e,t);if(n.state>3)throw Error("too late; already running");return n}function e0(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error("transition not found");return n}function e1(e,t){var n,o,r,i=e.__transition,a=!0;if(i){for(r in t=null==t?null:t+"",i){if((n=i[r]).name!==t){a=!1;continue}o=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(o?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[r]}a&&delete e.__transition}}function e2(e,t){return e*=1,t*=1,function(n){return e*(1-n)+t*n}}var e5=180/Math.PI,e3={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function e4(e,t,n,o,r,i){var a,l,s;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(s=e*n+t*o)&&(n-=e*s,o-=t*s),(l=Math.sqrt(n*n+o*o))&&(n/=l,o/=l,s/=l),e*o<t*n&&(e=-e,t=-t,s=-s,a=-a),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*e5,skewX:Math.atan(s)*e5,scaleX:a,scaleY:l}}function e6(e,t,n,o){function r(e){return e.length?e.pop()+" ":""}return function(i,a){var l,s,u,c,d=[],f=[];return i=e(i),a=e(a),!function(e,o,r,i,a,l){if(e!==r||o!==i){var s=a.push("translate(",null,t,null,n);l.push({i:s-4,x:e2(e,r)},{i:s-2,x:e2(o,i)})}else(r||i)&&a.push("translate("+r+t+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,d,f),l=i.rotate,s=a.rotate,l!==s?(l-s>180?s+=360:s-l>180&&(l+=360),f.push({i:d.push(r(d)+"rotate(",null,o)-2,x:e2(l,s)})):s&&d.push(r(d)+"rotate("+s+o),u=i.skewX,c=a.skewX,u!==c?f.push({i:d.push(r(d)+"skewX(",null,o)-2,x:e2(u,c)}):c&&d.push(r(d)+"skewX("+c+o),!function(e,t,n,o,i,a){if(e!==n||t!==o){var l=i.push(r(i)+"scale(",null,",",null,")");a.push({i:l-4,x:e2(e,n)},{i:l-2,x:e2(t,o)})}else(1!==n||1!==o)&&i.push(r(i)+"scale("+n+","+o+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,d,f),i=a=null,function(e){for(var t,n=-1,o=f.length;++n<o;)d[(t=f[n]).i]=t.x(e);return d.join("")}}}var e8=e6(function(e){let t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?e3:e4(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),e9=e6(function(e){return null==e?e3:(d||(d=document.createElementNS("http://www.w3.org/2000/svg","g")),d.setAttribute("transform",e),e=d.transform.baseVal.consolidate())?e4((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):e3},", ",")",")");function e7(e,t,n){var o=e._id;return e.each(function(){var e=eJ(this,o);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return e0(e,o).value[t]}}function te(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function tt(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function tn(){}var to="\\s*([+-]?\\d+)\\s*",tr="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ti="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ta=/^#([0-9a-f]{3,8})$/,tl=RegExp(`^rgb\\(${to},${to},${to}\\)$`),ts=RegExp(`^rgb\\(${ti},${ti},${ti}\\)$`),tu=RegExp(`^rgba\\(${to},${to},${to},${tr}\\)$`),tc=RegExp(`^rgba\\(${ti},${ti},${ti},${tr}\\)$`),td=RegExp(`^hsl\\(${tr},${ti},${ti}\\)$`),tf=RegExp(`^hsla\\(${tr},${ti},${ti},${tr}\\)$`),th={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};function tp(){return this.rgb().formatHex()}function tg(){return this.rgb().formatRgb()}function tm(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=ta.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?ty(t):3===n?new tw(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?tv(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?tv(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=tl.exec(e))?new tw(t[1],t[2],t[3],1):(t=ts.exec(e))?new tw(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=tu.exec(e))?tv(t[1],t[2],t[3],t[4]):(t=tc.exec(e))?tv(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=td.exec(e))?tk(t[1],t[2]/100,t[3]/100,1):(t=tf.exec(e))?tk(t[1],t[2]/100,t[3]/100,t[4]):th.hasOwnProperty(e)?ty(th[e]):"transparent"===e?new tw(NaN,NaN,NaN,0):null}function ty(e){return new tw(e>>16&255,e>>8&255,255&e,1)}function tv(e,t,n,o){return o<=0&&(e=t=n=NaN),new tw(e,t,n,o)}function tx(e,t,n,o){var r;return 1==arguments.length?((r=e)instanceof tn||(r=tm(r)),r)?new tw((r=r.rgb()).r,r.g,r.b,r.opacity):new tw:new tw(e,t,n,null==o?1:o)}function tw(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}function tb(){return`#${tM(this.r)}${tM(this.g)}${tM(this.b)}`}function t_(){let e=tS(this.opacity);return`${1===e?"rgb(":"rgba("}${tE(this.r)}, ${tE(this.g)}, ${tE(this.b)}${1===e?")":`, ${e})`}`}function tS(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function tE(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function tM(e){return((e=tE(e))<16?"0":"")+e.toString(16)}function tk(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new tC(e,t,n,o)}function tN(e){if(e instanceof tC)return new tC(e.h,e.s,e.l,e.opacity);if(e instanceof tn||(e=tm(e)),!e)return new tC;if(e instanceof tC)return e;var t=(e=e.rgb()).r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),a=NaN,l=i-r,s=(i+r)/2;return l?(a=t===i?(n-o)/l+(n<o)*6:n===i?(o-t)/l+2:(t-n)/l+4,l/=s<.5?i+r:2-i-r,a*=60):l=s>0&&s<1?0:a,new tC(a,l,s,e.opacity)}function tC(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}function tA(e){return(e=(e||0)%360)<0?e+360:e}function tP(e){return Math.max(0,Math.min(1,e||0))}function tz(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}function t$(e,t,n,o,r){var i=e*e,a=i*e;return((1-3*e+3*i-a)*t+(4-6*i+3*a)*n+(1+3*e+3*i-3*a)*o+a*r)/6}te(tn,tm,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:tp,formatHex:tp,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return tN(this).formatHsl()},formatRgb:tg,toString:tg}),te(tw,tx,tt(tn,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new tw(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new tw(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new tw(tE(this.r),tE(this.g),tE(this.b),tS(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:tb,formatHex:tb,formatHex8:function(){return`#${tM(this.r)}${tM(this.g)}${tM(this.b)}${tM((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:t_,toString:t_})),te(tC,function(e,t,n,o){return 1==arguments.length?tN(e):new tC(e,t,n,null==o?1:o)},tt(tn,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new tC(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new tC(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new tw(tz(e>=240?e-240:e+120,r,o),tz(e,r,o),tz(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new tC(tA(this.h),tP(this.s),tP(this.l),tS(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=tS(this.opacity);return`${1===e?"hsl(":"hsla("}${tA(this.h)}, ${100*tP(this.s)}%, ${100*tP(this.l)}%${1===e?")":`, ${e})`}`}}));let tI=e=>()=>e;function tR(e,t){var n=t-e;return n?function(t){return e+t*n}:tI(isNaN(e)?t:e)}let tj=function e(t){var n,o=1==(n=+t)?tR:function(e,t){var o,r,i;return t-e?(o=e,r=t,o=Math.pow(o,i=n),r=Math.pow(r,i)-o,i=1/i,function(e){return Math.pow(o+e*r,i)}):tI(isNaN(e)?t:e)};function r(e,t){var n=o((e=tx(e)).r,(t=tx(t)).r),r=o(e.g,t.g),i=o(e.b,t.b),a=tR(e.opacity,t.opacity);return function(t){return e.r=n(t),e.g=r(t),e.b=i(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function tO(e){return function(t){var n,o,r=t.length,i=Array(r),a=Array(r),l=Array(r);for(n=0;n<r;++n)o=tx(t[n]),i[n]=o.r||0,a[n]=o.g||0,l[n]=o.b||0;return i=e(i),a=e(a),l=e(l),o.opacity=1,function(e){return o.r=i(e),o.g=a(e),o.b=l(e),o+""}}}tO(function(e){var t=e.length-1;return function(n){var o=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),r=e[o],i=e[o+1],a=o>0?e[o-1]:2*r-i,l=o<t-1?e[o+2]:2*i-r;return t$((n-o/t)*t,a,r,i,l)}}),tO(function(e){var t=e.length;return function(n){var o=Math.floor(((n%=1)<0?++n:n)*t),r=e[(o+t-1)%t],i=e[o%t],a=e[(o+1)%t],l=e[(o+2)%t];return t$((n-o/t)*t,r,i,a,l)}});var tB=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,tD=RegExp(tB.source,"g");function tH(e,t){var n;return("number"==typeof t?e2:t instanceof tm?tj:(n=tm(t))?(t=n,tj):function(e,t){var n,o,r,i,a,l=tB.lastIndex=tD.lastIndex=0,s=-1,u=[],c=[];for(e+="",t+="";(r=tB.exec(e))&&(i=tD.exec(t));)(a=i.index)>l&&(a=t.slice(l,a),u[s]?u[s]+=a:u[++s]=a),(r=r[0])===(i=i[0])?u[s]?u[s]+=i:u[++s]=i:(u[++s]=null,c.push({i:s,x:e2(r,i)})),l=tD.lastIndex;return l<t.length&&(a=t.slice(l),u[s]?u[s]+=a:u[++s]=a),u.length<2?c[0]?(n=c[0].x,function(e){return n(e)+""}):(o=t,function(){return o}):(t=c.length,function(e){for(var n,o=0;o<t;++o)u[(n=c[o]).i]=n.x(e);return u.join("")})})(e,t)}var tT=eh.prototype.constructor;function tL(e){return function(){this.style.removeProperty(e)}}var tV=0;function tF(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}var tX=eh.prototype;tF.prototype=(function(e){return eh().transition(e)}).prototype={constructor:tF,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=C(e));for(var o=this._groups,r=o.length,i=Array(r),a=0;a<r;++a)for(var l,s,u=o[a],c=u.length,d=i[a]=Array(c),f=0;f<c;++f)(l=u[f])&&(s=e.call(l,l.__data__,f,u))&&("__data__"in l&&(s.__data__=l.__data__),d[f]=s,eG(d[f],t,n,f,d,e0(l,n)));return new tF(i,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=P(e));for(var o=this._groups,r=o.length,i=[],a=[],l=0;l<r;++l)for(var s,u=o[l],c=u.length,d=0;d<c;++d)if(s=u[d]){for(var f,h=e.call(s,s.__data__,d,u),p=e0(s,n),g=0,m=h.length;g<m;++g)(f=h[g])&&eG(f,t,n,g,h,p);i.push(h),a.push(s)}return new tF(i,a,t,n)},selectChild:tX.selectChild,selectChildren:tX.selectChildren,filter:function(e){"function"!=typeof e&&(e=z(e));for(var t=this._groups,n=t.length,o=Array(n),r=0;r<n;++r)for(var i,a=t[r],l=a.length,s=o[r]=[],u=0;u<l;++u)(i=a[u])&&e.call(i,i.__data__,u,a)&&s.push(i);return new tF(o,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),a=Array(o),l=0;l<i;++l)for(var s,u=t[l],c=n[l],d=u.length,f=a[l]=Array(d),h=0;h<d;++h)(s=u[h]||c[h])&&(f[h]=s);for(;l<o;++l)a[l]=t[l];return new tF(a,this._parents,this._name,this._id)},selection:function(){return new tT(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=++tV,o=this._groups,r=o.length,i=0;i<r;++i)for(var a,l=o[i],s=l.length,u=0;u<s;++u)if(a=l[u]){var c=e0(a,t);eG(a,e,n,u,l,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new tF(o,this._parents,e,n)},call:tX.call,nodes:tX.nodes,node:tX.node,size:tX.size,empty:tX.empty,each:tX.each,on:function(e,t){var n,o,r,i,a,l,s=this._id;return arguments.length<2?e0(this.node(),s).on.on(e):this.each((n=s,o=e,r=t,l=(o+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})?eQ:eJ,function(){var e=l(this,n),t=e.on;t!==i&&(a=(i=t).copy()).on(o,r),e.on=a}))},attr:function(e,t){var n=Y(e),o="transform"===n?e9:tH;return this.attrTween(e,"function"==typeof t?(n.local?function(e,t,n){var o,r,i;return function(){var a,l,s=n(this);return null==s?void this.removeAttributeNS(e.space,e.local):(a=this.getAttributeNS(e.space,e.local))===(l=s+"")?null:a===o&&l===r?i:(r=l,i=t(o=a,s))}}:function(e,t,n){var o,r,i;return function(){var a,l,s=n(this);return null==s?void this.removeAttribute(e):(a=this.getAttribute(e))===(l=s+"")?null:a===o&&l===r?i:(r=l,i=t(o=a,s))}})(n,o,e7(this,"attr."+e,t)):null==t?(n.local?function(e){return function(){this.removeAttributeNS(e.space,e.local)}}:function(e){return function(){this.removeAttribute(e)}})(n):(n.local?function(e,t,n){var o,r,i=n+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===o?r:r=t(o=a,n)}}:function(e,t,n){var o,r,i=n+"";return function(){var a=this.getAttribute(e);return a===i?null:a===o?r:r=t(o=a,n)}})(n,o,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw Error();var o=Y(e);return this.tween(n,(o.local?function(e,t){var n,o;function r(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&function(t){this.setAttributeNS(e.space,e.local,r.call(this,t))}),n}return r._value=t,r}:function(e,t){var n,o;function r(){var r=t.apply(this,arguments);return r!==o&&(n=(o=r)&&function(t){this.setAttribute(e,r.call(this,t))}),n}return r._value=t,r})(o,t))},style:function(e,t,n){var o,r,i,a,l,s,u,c,d,f,h,p,g,m,y,v,x,w,b,_,S,E="transform"==(e+="")?e8:tH;return null==t?this.styleTween(e,(o=e,function(){var e=W(this,o),t=(this.style.removeProperty(o),W(this,o));return e===t?null:e===r&&t===i?a:a=E(r=e,i=t)})).on("end.style."+e,tL(e)):"function"==typeof t?this.styleTween(e,(l=e,s=e7(this,"style."+e,t),function(){var e=W(this,l),t=s(this),n=t+"";return null==t&&(this.style.removeProperty(l),n=t=W(this,l)),e===n?null:e===u&&n===c?d:(c=n,d=E(u=e,t))})).each((f=this._id,x="end."+(v="style."+(h=e)),function(){var e=eJ(this,f),t=e.on,n=null==e.value[v]?y||(y=tL(h)):void 0;(t!==p||m!==n)&&(g=(p=t).copy()).on(x,m=n),e.on=g})):this.styleTween(e,(w=e,S=t+"",function(){var e=W(this,w);return e===S?null:e===b?_:_=E(b=e,t)}),n).on("end.style."+e,null)},styleTween:function(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(null==t)return this.tween(o,null);if("function"!=typeof t)throw Error();return this.tween(o,function(e,t,n){var o,r;function i(){var i=t.apply(this,arguments);return i!==r&&(o=(r=i)&&function(t){this.style.setProperty(e,i.call(this,t),n)}),o}return i._value=t,i}(e,t,null==n?"":n))},text:function(e){var t,n;return this.tween("text","function"==typeof e?(t=e7(this,"text",e),function(){var e=t(this);this.textContent=null==e?"":e}):(n=null==e?"":e+"",function(){this.textContent=n}))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw Error();return this.tween(t,function(e){var t,n;function o(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&function(e){this.textContent=o.call(this,e)}),t}return o._value=e,o}(e))},remove:function(){var e;return this.on("end.remove",(e=this._id,function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o,r=e0(this.node(),n).tween,i=0,a=r.length;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((null==t?function(e,t){var n,o;return function(){var r=eJ(this,e),i=r.tween;if(i!==n){o=n=i;for(var a=0,l=o.length;a<l;++a)if(o[a].name===t){(o=o.slice()).splice(a,1);break}}r.tween=o}}:function(e,t,n){var o,r;if("function"!=typeof n)throw Error();return function(){var i=eJ(this,e),a=i.tween;if(a!==o){r=(o=a).slice();for(var l={name:t,value:n},s=0,u=r.length;s<u;++s)if(r[s].name===t){r[s]=l;break}s===u&&r.push(l)}i.tween=r}})(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){eQ(this,e).delay=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){eQ(this,e).delay=t}})(t,e)):e0(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?function(e,t){return function(){eJ(this,e).duration=+t.apply(this,arguments)}}:function(e,t){return t*=1,function(){eJ(this,e).duration=t}})(t,e)):e0(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw Error();return function(){eJ(this,e).ease=t}}(t,e)):e0(this.node(),t).ease},easeVarying:function(e){var t;if("function"!=typeof e)throw Error();return this.each((t=this._id,function(){var n=e.apply(this,arguments);if("function"!=typeof n)throw Error();eJ(this,t).ease=n}))},end:function(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,a){var l={value:a},s={value:function(){0==--r&&i()}};n.each(function(){var n=eJ(this,o),r=n.on;r!==e&&((t=(e=r).copy())._.cancel.push(l),t._.interrupt.push(l),t._.end.push(s)),n.on=t}),0===r&&i()})},[Symbol.iterator]:tX[Symbol.iterator]};var tY={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};eh.prototype.interrupt=function(e){return this.each(function(){e1(this,e)})},eh.prototype.transition=function(e){var t,n;e instanceof tF?(t=e._id,e=e._name):(t=++tV,(n=tY).time=eL(),e=null==e?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var a,l=o[i],s=l.length,u=0;u<s;++u)(a=l[u])&&eG(a,e,t,u,l,n||function(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}(a,t));return new tF(o,this._parents,e,t)};let tq=e=>()=>e;function tW(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){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:o,enumerable:!0,configurable:!0},_:{value:r}})}function tZ(e,t,n){this.k=e,this.x=t,this.y=n}tZ.prototype={constructor:tZ,scale:function(e){return 1===e?this:new tZ(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new tZ(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var tK=new tZ(1,0,0);function tU(e){for(;!e.__zoom;)if(!(e=e.parentNode))return tK;return e.__zoom}function tG(e){e.stopImmediatePropagation()}function tQ(e){e.preventDefault(),e.stopImmediatePropagation()}function tJ(e){return(!e.ctrlKey||"wheel"===e.type)&&!e.button}function t0(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function t1(){return this.__zoom||tK}function t2(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function t5(){return navigator.maxTouchPoints||"ontouchstart"in this}function t3(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}function t4(){var e,t,n,o=tJ,r=t0,i=t3,a=t2,l=t5,s=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],c=250,d=eP,f=E("start","zoom","end"),h=0,p=10;function g(e){e.property("__zoom",t1).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",M).filter(l).on("touchstart.zoom",k).on("touchmove.zoom",N).on("touchend.zoom touchcancel.zoom",C).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(e,t){return(t=Math.max(s[0],Math.min(s[1],t)))===e.k?e:new tZ(t,e.x,e.y)}function y(e,t,n){var o=t[0]-n[0]*e.k,r=t[1]-n[1]*e.k;return o===e.x&&r===e.y?e:new tZ(e.k,o,r)}function v(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,t,n,o){e.on("start.zoom",function(){w(this,arguments).event(o).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(o).end()}).tween("zoom",function(){var e=arguments,i=w(this,e).event(o),a=r.apply(this,e),l=null==n?v(a):"function"==typeof n?n.apply(this,e):n,s=Math.max(a[1][0]-a[0][0],a[1][1]-a[0][1]),u=this.__zoom,c="function"==typeof t?t.apply(this,e):t,f=d(u.invert(l).concat(s/u.k),c.invert(l).concat(s/c.k));return function(e){if(1===e)e=c;else{var t=f(e),n=s/t[2];e=new tZ(n,l[0]-t[0]*n,l[1]-t[1]*n)}i.zoom(null,e)}})}function w(e,t,n){return!n&&e.__zooming||new b(e,t)}function b(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=r.apply(e,t),this.taps=0}function _(e,...t){if(o.apply(this,arguments)){var n=w(this,t).event(e),r=this.__zoom,l=Math.max(s[0],Math.min(s[1],r.k*Math.pow(2,a.apply(this,arguments)))),c=eg(e);if(n.wheel)(n.mouse[0][0]!==c[0]||n.mouse[0][1]!==c[1])&&(n.mouse[1]=r.invert(n.mouse[0]=c)),clearTimeout(n.wheel);else{if(r.k===l)return;n.mouse=[c,r.invert(c)],e1(this),n.start()}tQ(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",i(y(m(r,l),n.mouse[0],n.mouse[1]),n.extent,u))}}function S(e,...t){if(!n&&o.apply(this,arguments)){var r=e.currentTarget,a=w(this,t,!0).event(e),l=ep(e.view).on("mousemove.zoom",function(e){if(tQ(e),!a.moved){var t=e.clientX-c,n=e.clientY-d;a.moved=t*t+n*n>h}a.event(e).zoom("mouse",i(y(a.that.__zoom,a.mouse[0]=eg(e,r),a.mouse[1]),a.extent,u))},!0).on("mouseup.zoom",function(e){l.on("mousemove.zoom mouseup.zoom",null),eb(e.view,a.moved),tQ(e),a.event(e).end()},!0),s=eg(e,r),c=e.clientX,d=e.clientY;ew(e.view),tG(e),a.mouse=[s,this.__zoom.invert(s)],e1(this),a.start()}}function M(e,...t){if(o.apply(this,arguments)){var n=this.__zoom,a=eg(e.changedTouches?e.changedTouches[0]:e,this),l=n.invert(a),s=n.k*(e.shiftKey?.5:2),d=i(y(m(n,s),a,l),r.apply(this,t),u);tQ(e),c>0?ep(this).transition().duration(c).call(x,d,a,e):ep(this).call(g.transform,d,a,e)}}function k(n,...r){if(o.apply(this,arguments)){var i,a,l,s,u=n.touches,c=u.length,d=w(this,r,n.changedTouches.length===c).event(n);for(tG(n),a=0;a<c;++a)s=[s=eg(l=u[a],this),this.__zoom.invert(s),l.identifier],d.touch0?d.touch1||d.touch0[2]===s[2]||(d.touch1=s,d.taps=0):(d.touch0=s,i=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),i&&(d.taps<2&&(t=s[0],e=setTimeout(function(){e=null},500)),e1(this),d.start())}}function N(e,...t){if(this.__zooming){var n,o,r,a,l=w(this,t).event(e),s=e.changedTouches,c=s.length;for(tQ(e),n=0;n<c;++n)r=eg(o=s[n],this),l.touch0&&l.touch0[2]===o.identifier?l.touch0[0]=r:l.touch1&&l.touch1[2]===o.identifier&&(l.touch1[0]=r);if(o=l.that.__zoom,l.touch1){var d=l.touch0[0],f=l.touch0[1],h=l.touch1[0],p=l.touch1[1],g=(g=h[0]-d[0])*g+(g=h[1]-d[1])*g,v=(v=p[0]-f[0])*v+(v=p[1]-f[1])*v;o=m(o,Math.sqrt(g/v)),r=[(d[0]+h[0])/2,(d[1]+h[1])/2],a=[(f[0]+p[0])/2,(f[1]+p[1])/2]}else{if(!l.touch0)return;r=l.touch0[0],a=l.touch0[1]}l.zoom("touch",i(y(o,r,a),l.extent,u))}}function C(e,...o){if(this.__zooming){var r,i,a=w(this,o).event(e),l=e.changedTouches,s=l.length;for(tG(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),r=0;r<s;++r)i=l[r],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=eg(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<p)){var u=ep(this).on("dblclick.zoom");u&&u.apply(this,arguments)}}}return g.transform=function(e,t,n,o){var r=e.selection?e.selection():e;r.property("__zoom",t1),e!==r?x(e,t,n,o):r.interrupt().each(function(){w(this,arguments).event(o).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},g.scaleBy=function(e,t,n,o){g.scaleTo(e,function(){var e=this.__zoom.k,n="function"==typeof t?t.apply(this,arguments):t;return e*n},n,o)},g.scaleTo=function(e,t,n,o){g.transform(e,function(){var e=r.apply(this,arguments),o=this.__zoom,a=null==n?v(e):"function"==typeof n?n.apply(this,arguments):n,l=o.invert(a),s="function"==typeof t?t.apply(this,arguments):t;return i(y(m(o,s),a,l),e,u)},n,o)},g.translateBy=function(e,t,n,o){g.transform(e,function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),r.apply(this,arguments),u)},null,o)},g.translateTo=function(e,t,n,o,a){g.transform(e,function(){var e=r.apply(this,arguments),a=this.__zoom,l=null==o?v(e):"function"==typeof o?o.apply(this,arguments):o;return i(tK.translate(l[0],l[1]).scale(a.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,u)},o,a)},b.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1==++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0==--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=ep(this.that).datum();f.call(e,this.that,new tW(e,{sourceEvent:this.sourceEvent,target:g,type:e,transform:this.that.__zoom,dispatch:f}),t)}},g.wheelDelta=function(e){return arguments.length?(a="function"==typeof e?e:tq(+e),g):a},g.filter=function(e){return arguments.length?(o="function"==typeof e?e:tq(!!e),g):o},g.touchable=function(e){return arguments.length?(l="function"==typeof e?e:tq(!!e),g):l},g.extent=function(e){return arguments.length?(r="function"==typeof e?e:tq([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),g):r},g.scaleExtent=function(e){return arguments.length?(s[0]=+e[0],s[1]=+e[1],g):[s[0],s[1]]},g.translateExtent=function(e){return arguments.length?(u[0][0]=+e[0][0],u[1][0]=+e[1][0],u[0][1]=+e[0][1],u[1][1]=+e[1][1],g):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},g.constrain=function(e){return arguments.length?(i=e,g):i},g.duration=function(e){return arguments.length?(c=+e,g):c},g.interpolate=function(e){return arguments.length?(d=e,g):d},g.on=function(){var e=f.on.apply(f,arguments);return e===f?g:e},g.clickDistance=function(e){return arguments.length?(h=(e*=1)*e,g):Math.sqrt(h)},g.tapDistance=function(e){return arguments.length?(p=+e,g):p},g}tU.prototype=tZ.prototype;let t6={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:o})=>`Couldn't create edge for ${e} handle id: "${"source"===e?n:o}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},t8=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],t9=["Enter"," ","Escape"];(o=f||(f={})).Strict="strict",o.Loose="loose",(r=h||(h={})).Free="free",r.Vertical="vertical",r.Horizontal="horizontal",(i=p||(p={})).Partial="partial",i.Full="full";let t7={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};(a=g||(g={})).Bezier="default",a.Straight="straight",a.Step="step",a.SmoothStep="smoothstep",a.SimpleBezier="simplebezier",(l=m||(m={})).Arrow="arrow",l.ArrowClosed="arrowclosed",(s=y||(y={})).Left="left",s.Top="top",s.Right="right",s.Bottom="bottom";let ne={[y.Left]:y.Right,[y.Right]:y.Left,[y.Top]:y.Bottom,[y.Bottom]:y.Top};function nt(e,t){if(!e&&!t)return!0;if(!e||!t||e.size!==t.size)return!1;if(!e.size&&!t.size)return!0;for(let n of e.keys())if(!t.has(n))return!1;return!0}function nn(e,t,n){if(!n)return;let o=[];e.forEach((e,n)=>{t?.has(n)||o.push(e)}),o.length&&n(o)}function no(e){return null===e?null:e?"valid":"invalid"}let nr=e=>"id"in e&&"source"in e&&"target"in e,ni=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),na=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),nl=(e,t,n)=>{if(!e.id)return[];let o=new Set;return n.forEach(t=>{t.source===e.id&&o.add(t.target)}),t.filter(e=>o.has(e.id))},ns=(e,t,n)=>{if(!e.id)return[];let o=new Set;return n.forEach(t=>{t.target===e.id&&o.add(t.source)}),t.filter(e=>o.has(e.id))},nu=(e,t=[0,0])=>{let{width:n,height:o}=nH(e),r=e.origin??t,i=n*r[0],a=o*r[1];return{x:e.position.x-i,y:e.position.y-a}},nc=(e,t={nodeOrigin:[0,0]})=>0===e.length?{x:0,y:0,width:0,height:0}:nE(e.reduce((e,n)=>{let o="string"==typeof n,r=t.nodeLookup||o?void 0:n;return t.nodeLookup&&(r=o?t.nodeLookup.get(n):na(n)?n:t.nodeLookup.get(n.id)),n_(e,r?nk(r,t.nodeOrigin):{x:0,y:0,x2:0,y2:0})},{x:1/0,y:1/0,x2:-1/0,y2:-1/0})),nd=(e,t={})=>{if(0===e.size)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(e=>{if(void 0===t.filter||t.filter(e)){let t=nk(e);n=n_(n,t)}}),nE(n)},nf=(e,t,[n,o,r]=[0,0,1],i=!1,a=!1)=>{let l={...nI(t,[n,o,r]),width:t.width/r,height:t.height/r},s=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:o=!1}=t;if(a&&!n||o)continue;let r=e.width??t.width??t.initialWidth??null,u=e.height??t.height??t.initialHeight??null,c=nC(l,nM(t)),d=(r??0)*(u??0),f=i&&c>0;(!t.internals.handleBounds||f||c>=d||t.dragging)&&s.push(t)}return s},nh=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};async function np({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},a){if(0===e.size)return Promise.resolve(!0);let l=nO(nd(function(e,t){let n=new Map,o=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{e.measured.width&&e.measured.height&&(t?.includeHiddenNodes||!e.hidden)&&(!o||o.has(e.id))&&n.set(e.id,e)}),n}(e,a)),t,n,a?.minZoom??r,a?.maxZoom??i,a?.padding??.1);return await o.setViewport(l,{duration:a?.duration}),Promise.resolve(!0)}function ng({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:i}){let a=n.get(e),l=a.parentId?n.get(a.parentId):void 0,{x:s,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},c=a.origin??o,d=r;if("parent"!==a.extent||a.expandParent)l&&nD(a.extent)&&(d=[[a.extent[0][0]+s,a.extent[0][1]+u],[a.extent[1][0]+s,a.extent[1][1]+u]]);else if(l){let e=l.measured.width,t=l.measured.height;e&&t&&(d=[[s,u],[s+e,u+t]])}else i?.("005",t6.error005());let f=nD(d)?nv(t,d,a.measured):t;return(void 0===a.measured.width||void 0===a.measured.height)&&i?.("015",t6.error015()),{position:{x:f.x-s+(a.measured.width??0)*c[0],y:f.y-u+(a.measured.height??0)*c[1]},positionAbsolute:f}}async function nm({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){let i=new Set(e.map(e=>e.id)),a=[];for(let e of n){if(!1===e.deletable)continue;let t=i.has(e.id),n=!t&&e.parentId&&a.find(t=>t.id===e.parentId);(t||n)&&a.push(e)}let l=new Set(t.map(e=>e.id)),s=o.filter(e=>!1!==e.deletable),u=nh(a,s);for(let e of s)l.has(e.id)&&!u.find(t=>t.id===e.id)&&u.push(e);if(!r)return{edges:u,nodes:a};let c=await r({nodes:a,edges:u});return"boolean"==typeof c?c?{edges:u,nodes:a}:{edges:[],nodes:[]}:c}let ny=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),nv=(e={x:0,y:0},t,n)=>({x:ny(e.x,t[0][0],t[1][0]-(n?.width??0)),y:ny(e.y,t[0][1],t[1][1]-(n?.height??0))});function nx(e,t,n){let{width:o,height:r}=nH(n),{x:i,y:a}=n.internals.positionAbsolute;return nv(e,[[i,a],[i+o,a+r]],t)}let nw=(e,t,n)=>e<t?ny(Math.abs(e-t),1,t)/t:e>n?-ny(Math.abs(e-n),1,t)/t:0,nb=(e,t,n=15,o=40)=>[nw(e.x,o,t.width-o)*n,nw(e.y,o,t.height-o)*n],n_=(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)}),nS=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),nE=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),nM=(e,t=[0,0])=>{let{x:n,y:o}=na(e)?e.internals.positionAbsolute:nu(e,t);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},nk=(e,t=[0,0])=>{let{x:n,y:o}=na(e)?e.internals.positionAbsolute:nu(e,t);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},nN=(e,t)=>nE(n_(nS(e),nS(t))),nC=(e,t)=>Math.ceil(Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x))*Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y))),nA=e=>nP(e.width)&&nP(e.height)&&nP(e.x)&&nP(e.y),nP=e=>!isNaN(e)&&isFinite(e),nz=(e,t)=>{},n$=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),nI=({x:e,y:t},[n,o,r],i=!1,a=[1,1])=>{let l={x:(e-n)/r,y:(t-o)/r};return i?n$(l,a):l},nR=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function nj(e,t){if("number"==typeof e)return Math.floor((t-t/(1+e))*.5);if("string"==typeof e&&e.endsWith("px")){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if("string"==typeof e&&e.endsWith("%")){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}let nO=(e,t,n,o,r,i)=>{let a=function(e,t,n){if("string"==typeof e||"number"==typeof e){let o=nj(e,n),r=nj(e,t);return{top:o,right:r,bottom:o,left:r,x:2*r,y:2*o}}if("object"==typeof e){let o=nj(e.top??e.y??0,n),r=nj(e.bottom??e.y??0,n),i=nj(e.left??e.x??0,t),a=nj(e.right??e.x??0,t);return{top:o,right:a,bottom:r,left:i,x:i+a,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}(i,t,n),l=ny(Math.min((t-a.x)/e.width,(n-a.y)/e.height),o,r),s=e.x+e.width/2,u=e.y+e.height/2,c=t/2-s*l,d=n/2-u*l,f=function(e,t,n,o,r,i){let{x:a,y:l}=nR(e,[t,n,o]),{x:s,y:u}=nR({x:e.x+e.width,y:e.y+e.height},[t,n,o]);return{left:Math.floor(a),top:Math.floor(l),right:Math.floor(r-s),bottom:Math.floor(i-u)}}(e,c,d,l,t,n),h={left:Math.min(f.left-a.left,0),top:Math.min(f.top-a.top,0),right:Math.min(f.right-a.right,0),bottom:Math.min(f.bottom-a.bottom,0)};return{x:c-h.left+h.right,y:d-h.top+h.bottom,zoom:l}},nB=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function nD(e){return void 0!==e&&"parent"!==e}function nH(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function nT(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function nL(e,t={width:0,height:0},n,o,r){let i={...e},a=o.get(n);if(a){let e=a.origin||r;i.x+=a.internals.positionAbsolute.x-(t.width??0)*e[0],i.y+=a.internals.positionAbsolute.y-(t.height??0)*e[1]}return i}function nV(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function nF(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){let{x:i,y:a}=nK(e),l=nI({x:i-(r?.left??0),y:a-(r?.top??0)},o),{x:s,y:u}=n?n$(l,t):l;return{xSnapped:s,ySnapped:u,...l}}let nX=e=>({width:e.offsetWidth,height:e.offsetHeight}),nY=e=>e?.getRootNode?.()||window?.document,nq=["INPUT","SELECT","TEXTAREA"];function nW(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1&&(nq.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey"))}let nZ=e=>"clientX"in e,nK=(e,t)=>{let n=nZ(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},nU=(e,t,n,o,r)=>{let i=t.querySelectorAll(`.${e}`);return i&&i.length?Array.from(i).map(t=>{let i=t.getBoundingClientRect();return{id:t.getAttribute("data-handleid"),type:e,nodeId:r,position:t.getAttribute("data-handlepos"),x:(i.left-n.left)/o,y:(i.top-n.top)/o,...nX(t)}}):null};function nG({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:a,targetControlY:l}){let s=.125*e+.375*r+.375*a+.125*n,u=.125*t+.375*i+.375*l+.125*o,c=Math.abs(s-e),d=Math.abs(u-t);return[s,u,c,d]}function nQ(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function nJ({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case y.Left:return[t-nQ(t-o,i),n];case y.Right:return[t+nQ(o-t,i),n];case y.Top:return[t,n-nQ(n-r,i)];case y.Bottom:return[t,n+nQ(r-n,i)]}}function n0({sourceX:e,sourceY:t,sourcePosition:n=y.Bottom,targetX:o,targetY:r,targetPosition:i=y.Top,curvature:a=.25}){let[l,s]=nJ({pos:n,x1:e,y1:t,x2:o,y2:r,c:a}),[u,c]=nJ({pos:i,x1:o,y1:r,x2:e,y2:t,c:a}),[d,f,h,p]=nG({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:l,sourceControlY:s,targetControlX:u,targetControlY:c});return[`M${e},${t} C${l},${s} ${u},${c} ${o},${r}`,d,f,h,p]}function n1({sourceX:e,sourceY:t,targetX:n,targetY:o}){let r=Math.abs(n-e)/2,i=Math.abs(o-t)/2;return[n<e?n+r:n-r,o<t?o+i:o-i,r,i]}let n2=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,n5=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),n3=(e,t)=>{let n;return e.source&&e.target?n5(n=nr(e)?{...e}:{...e,id:n2(e)},t)?t:(null===n.sourceHandle&&delete n.sourceHandle,null===n.targetHandle&&delete n.targetHandle,t.concat(n)):(nz("006",t6.error006()),t)},n4=(e,t,n,o={shouldReplaceId:!0})=>{let{id:r,...i}=e;if(!t.source||!t.target)return nz("006",t6.error006()),n;if(!n.find(t=>t.id===e.id))return nz("007",t6.error007(r)),n;let a={...i,id:o.shouldReplaceId?n2(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle};return n.filter(e=>e.id!==r).concat(a)};function n6({sourceX:e,sourceY:t,targetX:n,targetY:o}){let[r,i,a,l]=n1({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,a,l]}let n8={[y.Left]:{x:-1,y:0},[y.Right]:{x:1,y:0},[y.Top]:{x:0,y:-1},[y.Bottom]:{x:0,y:1}},n9=({source:e,sourcePosition:t=y.Bottom,target:n})=>t===y.Left||t===y.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},n7=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function oe({sourceX:e,sourceY:t,sourcePosition:n=y.Bottom,targetX:o,targetY:r,targetPosition:i=y.Top,borderRadius:a=5,centerX:l,centerY:s,offset:u=20}){let[c,d,f,h,p]=function({source:e,sourcePosition:t=y.Bottom,target:n,targetPosition:o=y.Top,center:r,offset:i}){let a,l,s=n8[t],u=n8[o],c={x:e.x+s.x*i,y:e.y+s.y*i},d={x:n.x+u.x*i,y:n.y+u.y*i},f=n9({source:c,sourcePosition:t,target:d}),h=0!==f.x?"x":"y",p=f[h],g=[],m={x:0,y:0},v={x:0,y:0},[x,w,b,_]=n1({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[h]*u[h]==-1){a=r.x??x,l=r.y??w;let e=[{x:a,y:c.y},{x:a,y:d.y}],t=[{x:c.x,y:l},{x:d.x,y:l}];g=s[h]===p?"x"===h?e:t:"x"===h?t:e}else{let r=[{x:c.x,y:d.y}],f=[{x:d.x,y:c.y}];if(g="x"===h?s.x===p?f:r:s.y===p?r:f,t===o){let t=Math.abs(e[h]-n[h]);if(t<=i){let o=Math.min(i-1,i-t);s[h]===p?m[h]=(c[h]>e[h]?-1:1)*o:v[h]=(d[h]>n[h]?-1:1)*o}}if(t!==o){let e="x"===h?"y":"x",t=s[h]===u[e],n=c[e]>d[e],o=c[e]<d[e];(1===s[h]&&(!t&&n||t&&o)||1!==s[h]&&(!t&&o||t&&n))&&(g="x"===h?r:f)}let y={x:c.x+m.x,y:c.y+m.y},x={x:d.x+v.x,y:d.y+v.y};Math.max(Math.abs(y.x-g[0].x),Math.abs(x.x-g[0].x))>=Math.max(Math.abs(y.y-g[0].y),Math.abs(x.y-g[0].y))?(a=(y.x+x.x)/2,l=g[0].y):(a=g[0].x,l=(y.y+x.y)/2)}return[[e,{x:c.x+m.x,y:c.y+m.y},...g,{x:d.x+v.x,y:d.y+v.y},n],a,l,b,_]}({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:i,center:{x:l,y:s},offset:u});return[c.reduce((e,t,n)=>{let o="";return e+(n>0&&n<c.length-1?function(e,t,n,o){let r=Math.min(n7(e,t)/2,n7(t,n)/2,o),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a){let t=e.x<n.x?-1:1,o=e.y<n.y?1:-1;return`L ${i+r*t},${a}Q ${i},${a} ${i},${a+r*o}`}let l=e.x<n.x?1:-1,s=e.y<n.y?-1:1;return`L ${i},${a+r*s}Q ${i},${a} ${i+r*l},${a}`}(c[n-1],t,c[n+1],a):`${0===n?"M":"L"}${t.x} ${t.y}`)},""),d,f,h,p]}function ot(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function on(e){if(!e)return null;let t=[],n=[];for(let o of e)o.width=o.width??1,o.height=o.height??1,"source"===o.type?t.push(o):"target"===o.type&&n.push(o);return{source:t,target:n}}function oo(e,t,n=y.Left,o=!1){let r=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:a,height:l}=t??nH(e);if(o)return{x:r+a/2,y:i+l/2};switch(t?.position??n){case y.Top:return{x:r+a/2,y:i};case y.Right:return{x:r+a,y:i+l/2};case y.Bottom:return{x:r+a/2,y:i+l};case y.Left:return{x:r,y:i+l/2}}}function or(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function oi(e,t){if(!e)return"";if("string"==typeof e)return e;let n=t?`${t}__`:"";return`${n}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`}let oa={nodeOrigin:[0,0],nodeExtent:t8,elevateNodesOnSelect:!0,defaults:{}},ol={...oa,checkEquality:!0};function os(e,t){let n={...e};for(let e in t)void 0!==t[e]&&(n[e]=t[e]);return n}function ou(e,t,n,o){let r=os(ol,o),i=e.length>0,a=new Map(t),l=1e3*!!r?.elevateNodesOnSelect;for(let s of(t.clear(),n.clear(),e)){let e=a.get(s.id);if(r.checkEquality&&s===e?.internals.userNode)t.set(s.id,e);else{let n=nv(nu(s,r.nodeOrigin),nD(s.extent)?s.extent:r.nodeExtent,nH(s));e={...r.defaults,...s,measured:{width:s.measured?.width,height:s.measured?.height},internals:{positionAbsolute:n,handleBounds:s.measured?e?.internals.handleBounds:void 0,z:od(s,l),userNode:s}},t.set(s.id,e)}e.measured&&e.measured.width&&e.measured.height||e.hidden||(i=!1),s.parentId&&oc(e,t,n,o)}return i}function oc(e,t,n,o){let{elevateNodesOnSelect:r,nodeOrigin:i,nodeExtent:a}=os(oa,o),l=e.parentId,s=t.get(l);if(!s)return void console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);!function(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]]))}(e,n);let{x:u,y:c,z:d}=function(e,t,n,o,r){let{x:i,y:a}=t.internals.positionAbsolute,l=nH(e),s=nu(e,n),u=nD(e.extent)?nv(s,e.extent,l):s,c=nv({x:i+u.x,y:a+u.y},o,l);"parent"===e.extent&&(c=nx(c,l,t));let d=od(e,r),f=t.internals.z??0;return{x:c.x,y:c.y,z:f>d?f:d}}(e,s,i,a,1e3*!!r),{positionAbsolute:f}=e.internals,h=u!==f.x||c!==f.y;(h||d!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:u,y:c}:f,z:d}})}function od(e,t){return(nP(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function of(e,t,n,o=[0,0]){let r=[],i=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let o=nN(i.get(n.parentId)?.expandedRect??nM(e),n.rect);i.set(n.parentId,{expandedRect:o,parent:e})}return i.size>0&&i.forEach(({expandedRect:t,parent:i},a)=>{let l=i.internals.positionAbsolute,s=nH(i),u=i.origin??o,c=t.x<l.x?Math.round(Math.abs(l.x-t.x)):0,d=t.y<l.y?Math.round(Math.abs(l.y-t.y)):0,f=Math.max(s.width,Math.round(t.width)),h=Math.max(s.height,Math.round(t.height)),p=(f-s.width)*u[0],g=(h-s.height)*u[1];(c>0||d>0||p||g)&&(r.push({id:a,type:"position",position:{x:i.position.x-c+p,y:i.position.y-d+g}}),n.get(a)?.forEach(t=>{e.some(e=>e.id===t.id)||r.push({id:t.id,type:"position",position:{x:t.position.x+c,y:t.position.y+d}})})),(s.width<t.width||s.height<t.height||c||d)&&r.push({id:a,type:"dimensions",setAttributes:!0,dimensions:{width:f+(c?u[0]*c-p:0),height:h+(d?u[1]*d-g:0)}})}),r}async function oh({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);let a=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],o);return Promise.resolve(!!a&&(a.x!==n[0]||a.y!==n[1]||a.k!==n[2]))}function op(e,t,n,o,r,i){let a=r,l=o.get(a)||new Map;o.set(a,l.set(n,t)),a=`${r}-${e}`;let s=o.get(a)||new Map;if(o.set(a,s.set(n,t)),i){a=`${r}-${e}-${i}`;let l=o.get(a)||new Map;o.set(a,l.set(n,t))}}function og(e,t,n){for(let o of(e.clear(),t.clear(),n)){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=o,l={edgeId:o.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;op("source",l,`${r}-${a}--${n}-${i}`,e,n,i),op("target",l,s,e,r,a),t.set(o.id,o)}}function om(e,t){if(null===e||null===t)return!1;let n=Array.isArray(e)?e:[e],o=Array.isArray(t)?t:[t];if(n.length!==o.length)return!1;for(let e=0;e<n.length;e++)if(n[e].id!==o[e].id||n[e].type!==o[e].type||!Object.is(n[e].data,o[e].data))return!1;return!0}function oy(e,t,n){let o=e;do{if(o?.matches?.(t))return!0;if(o===n)break;o=o?.parentElement}while(o);return!1}function ov({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){let r=[];for(let[e,i]of t){let t=n.get(e)?.internals.userNode;t&&r.push({...t,position:i.position,dragging:o})}if(!e)return[r[0],r];let i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:o}:r[0],r]}function ox(e,t,n,o,r,i=!1){let a=o.get(e);if(!a)return null;let l="strict"===r?a.internals.handleBounds?.[t]:[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]],s=(n?l?.find(e=>e.id===n):l?.[0])??null;return s&&i?{...s,...oo(a,s,s.position,!0)}:s}function ow(e,t){return e?e:t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null}let ob=()=>!0;function o_(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:a,lib:l,flowId:s,isValidConnection:u=ob,nodeLookup:c}){let d="target"===i,h=t?a.querySelector(`.${l}-flow__handle[data-id="${s}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:g}=nK(e),m=a.elementFromPoint(p,g),y=m?.classList.contains(`${l}-flow__handle`)?m:h,v={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=ow(void 0,y),t=y.getAttribute("data-nodeid"),i=y.getAttribute("data-handleid"),a=y.classList.contains("connectable"),l=y.classList.contains("connectableend");if(!t||!e)return v;let s={source:d?t:o,sourceHandle:d?i:r,target:d?o:t,targetHandle:d?r:i};v.connection=s,v.isValid=a&&l&&(n===f.Strict?d&&"source"===e||!d&&"target"===e:t!==o||i!==r)&&u(s),v.toHandle=ox(t,e,i,c,n,!1)}return v}let oS={onPointerDown:function(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:i,isTarget:a,domNode:l,nodeLookup:s,lib:u,autoPanOnConnect:c,flowId:d,panBy:f,cancelConnection:h,onConnectStart:p,onConnect:g,onConnectEnd:m,isValidConnection:v=ob,onReconnectEnd:x,updateConnection:w,getTransform:b,getFromHandle:_,autoPanSpeed:S}){let E,M=nY(e.target),k=0,{x:N,y:C}=nK(e),A=ow(i,M?.elementFromPoint(N,C)),P=l?.getBoundingClientRect();if(!P||!A)return;let z=ox(r,A,o,s,t);if(!z)return;let $=nK(e,P),I=!1,R=null,j=!1,O=null,B={...z,nodeId:r,type:A,position:z.position},D=s.get(r),H={inProgress:!0,isValid:null,from:oo(D,B,y.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:D,to:$,toHandle:null,toPosition:ne[B.position],toNode:null};w(H);let T=H;function L(e){var i,l;let h;if(!_()||!B)return void V(e);let p=b();E=function(e,t,n,o){let r=[],i=1/0;for(let a of function(e,t,n){let o=[],r={x:e.x-n,y:e.y-n,width:2*n,height:2*n};for(let e of t.values())nC(r,nM(e))>0&&o.push(e);return o}(e,n,t+250))for(let n of[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]]){if(o.nodeId===n.nodeId&&o.type===n.type&&o.id===n.id)continue;let{x:l,y:s}=oo(a,n,n.position,!0),u=Math.sqrt(Math.pow(l-e.x,2)+Math.pow(s-e.y,2));u>t||(u<i?(r=[{...n,x:l,y:s}],i=u):u===i&&r.push({...n,x:l,y:s}))}if(!r.length)return null;if(r.length>1){let e="source"===o.type?"target":"source";return r.find(t=>t.type===e)??r[0]}return r[0]}(nI($=nK(e,P),p,!1,[1,1]),n,s,B),I||(!function e(){if(!c||!P)return;let[t,n]=nb($,P,S);f({x:t,y:n}),k=requestAnimationFrame(e)}(),I=!0);let g=o_(e,{handle:E,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:a?"target":"source",isValidConnection:v,doc:M,lib:u,flowId:d,nodeLookup:s});O=g.handleDomNode,R=g.connection,i=!!E,l=g.isValid,h=null,l?h=!0:i&&!l&&(h=!1),j=h;let m={...T,isValid:j,to:E&&j?nR({x:E.x,y:E.y},p):$,toHandle:g.toHandle,toPosition:j&&g.toHandle?g.toHandle.position:ne[B.position],toNode:g.toHandle?s.get(g.toHandle.nodeId):null};j&&E&&T.toHandle&&m.toHandle&&T.toHandle.type===m.toHandle.type&&T.toHandle.nodeId===m.toHandle.nodeId&&T.toHandle.id===m.toHandle.id&&T.to.x===m.to.x&&T.to.y===m.to.y||(w(m),T=m)}function V(e){(E||O)&&R&&j&&g?.(R);let{inProgress:t,...n}=T,o={...n,toPosition:T.toHandle?T.toPosition:null};m?.(e,o),i&&x?.(e,o),h(),cancelAnimationFrame(k),I=!1,j=!1,R=null,O=null,M.removeEventListener("mousemove",L),M.removeEventListener("mouseup",V),M.removeEventListener("touchmove",L),M.removeEventListener("touchend",V)}p?.(e,{nodeId:r,handleId:o,handleType:A}),M.addEventListener("mousemove",L),M.addEventListener("mouseup",V),M.addEventListener("touchmove",L),M.addEventListener("touchend",V)},isValid:o_},oE=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,oM=e=>({x:e.x,y:e.y,zoom:e.k}),ok=({x:e,y:t,zoom:n})=>tK.translate(e,t).scale(n),oN=(e,t)=>e.target.closest(`.${t}`),oC=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),oA=(e,t=0,n=()=>{})=>{let o="number"==typeof t&&t>0;return o||n(),o?e.transition().duration(t).on("end",n):e},oP=e=>{let t=e.ctrlKey&&nB()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t};(u=v||(v={})).Line="line",u.Handle="handle";let oz=["top-left","top-right","bottom-left","bottom-right"],o$=["top","right","bottom","left"];function oI(e,t){return Math.max(0,t-e)}function oR(e,t){return Math.max(0,e-t)}function oj(e,t,n){return Math.max(0,t-e,e-n)}let oO={width:0,height:0,x:0,y:0},oB={...oO,pointerX:0,pointerY:0,aspectRatio:1};var oD=n(40789);let oH=e=>{let t,n=new Set,o=(e,o)=>{let r="function"==typeof e?e(t):e;if(!Object.is(r,t)){let e=t;t=(null!=o?o:"object"!=typeof r||null===r)?r:Object.assign({},t,r),n.forEach(n=>n(t,e))}},r=()=>t,i={setState:o,getState:r,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{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()}},a=t=e(o,r,i);return i},oT=e=>e?oH(e):oH,{useDebugValue:oL}=b,{useSyncExternalStoreWithSelector:oV}=oD,oF=e=>e;function oX(e,t=oF,n){let o=oV(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return oL(o),o}let oY=(e,t)=>{let n=oT(e),o=(e,o=t)=>oX(n,e,o);return Object.assign(o,n),o},oq=(e,t)=>e?oY(e,t):oY;function oW(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,o]of e)if(!Object.is(o,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}var oZ=n(96853);let oK=(0,b.createContext)(null),oU=oK.Provider,oG=t6.error001();function oQ(e,t){let n=(0,b.useContext)(oK);if(null===n)throw Error(oG);return oX(n,e,t)}function oJ(){let e=(0,b.useContext)(oK);if(null===e)throw Error(oG);return(0,b.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}let o0={display:"none"},o1={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},o2="react-flow__node-desc",o5="react-flow__edge-desc",o3=e=>e.ariaLiveMessage;function o4({rfId:e}){let t=oQ(o3);return(0,w.jsx)("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:o1,children:t})}function o6({rfId:e,disableKeyboardA11y:t}){return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsxs)("div",{id:`${o2}-${e}`,style:o0,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),(0,w.jsx)("div",{id:`${o5}-${e}`,style:o0,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&(0,w.jsx)(o4,{rfId:e})]})}let o8=e=>e.userSelectionActive?"none":"all",o9=(0,b.forwardRef)(({position:e="top-left",children:t,className:n,style:o,...r},i)=>{let a=oQ(o8),l=`${e}`.split("-");return(0,w.jsx)("div",{className:_(["react-flow__panel",n,...l]),style:{...o,pointerEvents:a},ref:i,...r,children:t})});function o7({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:(0,w.jsx)(o9,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:(0,w.jsx)("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}o9.displayName="Panel";let re=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&(e.elementsSelectable||n.selectable)&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&(e.elementsSelectable||t.selectable)&&n.push(t);return{selectedNodes:t,selectedEdges:n}},rt=e=>e.id;function rn(e,t){return oW(e.selectedNodes.map(rt),t.selectedNodes.map(rt))&&oW(e.selectedEdges.map(rt),t.selectedEdges.map(rt))}function ro({onSelectionChange:e}){let t=oJ(),{selectedNodes:n,selectedEdges:o}=oQ(re,rn);return(0,b.useEffect)(()=>{let r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(e=>e(r))},[n,o,e]),null}let rr=e=>!!e.onSelectionChangeHandlers;function ri({onSelectionChange:e}){let t=oQ(rr);return e||t?(0,w.jsx)(ro,{onSelectionChange:e}):null}let ra=[0,0],rl={x:0,y:0,zoom:1},rs=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","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","onBeforeDelete","debug","autoPanSpeed","paneClickDistance","rfId"],ru=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,setPaneClickDistance:e.setPaneClickDistance}),rc={translateExtent:t8,nodeOrigin:ra,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function rd(e){let{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:a,reset:l,setDefaultNodesAndEdges:s,setPaneClickDistance:u}=oQ(ru,oW),c=oJ();(0,b.useEffect)(()=>(s(e.defaultNodes,e.defaultEdges),()=>{d.current=rc,l()}),[]);let d=(0,b.useRef)(rc);return(0,b.useEffect)(()=>{for(let l of rs){let s=e[l];s!==d.current[l]&&void 0!==e[l]&&("nodes"===l?t(s):"edges"===l?n(s):"minZoom"===l?o(s):"maxZoom"===l?r(s):"translateExtent"===l?i(s):"nodeExtent"===l?a(s):"paneClickDistance"===l?u(s):"fitView"===l?c.setState({fitViewQueued:s}):"fitViewOptions"===l?c.setState({fitViewOptions:s}):c.setState({[l]:s}))}d.current=e},rs.map(t=>e[t])),null}function rf(){return"undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}let rh="undefined"!=typeof document?document:null;function rp(e=null,t={target:rh,actInsideInputWithModifier:!0}){let[n,o]=(0,b.useState)(!1),r=(0,b.useRef)(!1),i=(0,b.useRef)(new Set([])),[a,l]=(0,b.useMemo)(()=>{if(null!==e){let t=(Array.isArray(e)?e:[e]).filter(e=>"string"==typeof e).map(e=>e.replace("+","\n").replace("\n\n","\n+").split("\n")),n=t.reduce((e,t)=>e.concat(...t),[]);return[t,n]}return[[],[]]},[e]);return(0,b.useEffect)(()=>{let n=t?.target||rh;if(null!==e){let e=e=>{if(r.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!r.current||r.current&&!t.actInsideInputWithModifier)&&nW(e))return!1;let n=rm(e.code,l);if(i.current.add(e[n]),rg(a,i.current,!1)){let n=e.composedPath?.()?.[0]||e.target,i=n?.nodeName==="BUTTON"||n?.nodeName==="A";!1!==t.preventDefault&&(r.current||!i)&&e.preventDefault(),o(!0)}},s=e=>{let t=rm(e.code,l);rg(a,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(e[t]),"Meta"===e.key&&i.current.clear(),r.current=!1},u=()=>{i.current.clear(),o(!1)};return n?.addEventListener("keydown",e),n?.addEventListener("keyup",s),window.addEventListener("blur",u),window.addEventListener("contextmenu",u),()=>{n?.removeEventListener("keydown",e),n?.removeEventListener("keyup",s),window.removeEventListener("blur",u),window.removeEventListener("contextmenu",u)}}},[e,o]),n}function rg(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function rm(e,t){return t.includes(e)?"code":"key"}let ry=()=>{let e=oJ();return(0,b.useMemo)(()=>({zoomIn:t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{let{panZoom:o}=e.getState();return o?o.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[o,r,i],panZoom:a}=e.getState();return a?(await a.setViewport({x:t.x??o,y:t.y??r,zoom:t.zoom??i},{duration:n?.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{let[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>{let{width:r,height:i,maxZoom:a,panZoom:l}=e.getState(),s=void 0!==o?.zoom?o.zoom:a;return l?(await l.setViewport({x:r/2-t*s,y:i/2-n*s,zoom:s},{duration:o?.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{let{width:o,height:r,minZoom:i,maxZoom:a,panZoom:l}=e.getState(),s=nO(t,o,r,i,a,n?.padding??.1);return l?(await l.setViewport(s,{duration:n?.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{let{transform:o,snapGrid:r,snapToGrid:i,domNode:a}=e.getState();if(!a)return t;let{x:l,y:s}=a.getBoundingClientRect(),u={x:t.x-l,y:t.y-s},c=n.snapGrid??r;return nI(u,o,n.snapToGrid??i,c)},flowToScreenPosition:t=>{let{transform:n,domNode:o}=e.getState();if(!o)return t;let{x:r,y:i}=o.getBoundingClientRect(),a=nR(t,n);return{x:a.x+r,y:a.y+i}}}),[])};function rv(e,t){let n=[],o=new Map,r=[];for(let t of e)if("add"===t.type){r.push(t);continue}else if("remove"===t.type||"replace"===t.type)o.set(t.id,[t]);else{let e=o.get(t.id);e?e.push(t):o.set(t.id,[t])}for(let e of t){let t=o.get(e.id);if(!t){n.push(e);continue}if("remove"===t[0].type)continue;if("replace"===t[0].type){n.push({...t[0].item});continue}let r={...e};for(let e of t){var i=e,a=r;switch(i.type){case"select":a.selected=i.selected;break;case"position":void 0!==i.position&&(a.position=i.position),void 0!==i.dragging&&(a.dragging=i.dragging);break;case"dimensions":void 0!==i.dimensions&&(a.measured??={},a.measured.width=i.dimensions.width,a.measured.height=i.dimensions.height,i.setAttributes&&(a.width=i.dimensions.width,a.height=i.dimensions.height)),"boolean"==typeof i.resizing&&(a.resizing=i.resizing)}}n.push(r)}return r.length&&r.forEach(e=>{void 0!==e.index?n.splice(e.index,0,{...e.item}):n.push({...e.item})}),n}function rx(e,t){return rv(e,t)}function rw(e,t){return rv(e,t)}function rb(e,t){return{id:e,type:"select",selected:t}}function r_(e,t=new Set,n=!1){let o=[];for(let[r,i]of e){let e=t.has(r);(void 0!==i.selected||e)&&i.selected!==e&&(n&&(i.selected=e),o.push(rb(i.id,e)))}return o}function rS({items:e=[],lookup:t}){let n=[],o=new Map(e.map(e=>[e.id,e]));for(let[o,r]of e.entries()){let e=t.get(r.id),i=e?.internals?.userNode??e;void 0!==i&&i!==r&&n.push({id:r.id,item:r,type:"replace"}),void 0===i&&n.push({item:r,type:"add",index:o})}for(let[e]of t)void 0===o.get(e)&&n.push({id:e,type:"remove"});return n}function rE(e){return{id:e.id,type:"remove"}}let rM=e=>ni(e),rk=e=>nr(e);function rN(e){return(0,b.forwardRef)(e)}let rC="undefined"!=typeof window?b.useLayoutEffect:b.useEffect;function rA(e){let[t,n]=(0,b.useState)(BigInt(0)),[o]=(0,b.useState)(()=>{var e;let t;return e=()=>n(e=>e+BigInt(1)),t=[],{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}});return rC(()=>{let t=o.get();t.length&&(e(t),o.reset())},[t]),o}let rP=(0,b.createContext)(null);function rz({children:e}){let t=oJ(),n=rA((0,b.useCallback)(e=>{let{nodes:n=[],setNodes:o,hasDefaultNodes:r,onNodesChange:i,nodeLookup:a,fitViewQueued:l}=t.getState(),s=n;for(let t of e)s="function"==typeof t?t(s):t;if(r)o(s);else{let e=rS({items:s,lookup:a});e.length>0?i?.(e):l&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:o}=t.getState();e&&o(n)})}},[])),o=rA((0,b.useCallback)(e=>{let{edges:n=[],setEdges:o,hasDefaultEdges:r,onEdgesChange:i,edgeLookup:a}=t.getState(),l=n;for(let t of e)l="function"==typeof t?t(l):t;r?o(l):i&&i(rS({items:l,lookup:a}))},[])),r=(0,b.useMemo)(()=>({nodeQueue:n,edgeQueue:o}),[]);return(0,w.jsx)(rP.Provider,{value:r,children:e})}let r$=e=>!!e.panZoom;function rI(){let e=ry(),t=oJ(),n=function(){let e=(0,b.useContext)(rP);if(!e)throw Error("useBatchContext must be used within a BatchProvider");return e}(),o=oQ(r$),r=(0,b.useMemo)(()=>{let e=e=>t.getState().nodeLookup.get(e),o=e=>{n.nodeQueue.push(e)},r=e=>{n.edgeQueue.push(e)},i=e=>{let{nodeLookup:n,nodeOrigin:o}=t.getState(),r=rM(e)?e:n.get(e.id),i=r.parentId?nL(r.position,r.measured,r.parentId,n,o):r.position;return nM({...r,position:i,width:r.measured?.width??r.width,height:r.measured?.height??r.height})},a=(e,t,n={replace:!1})=>{o(o=>o.map(o=>{if(o.id===e){let e="function"==typeof t?t(o):t;return n.replace&&rM(e)?e:{...o,...e}}return o}))},l=(e,t,n={replace:!1})=>{r(o=>o.map(o=>{if(o.id===e){let e="function"==typeof t?t(o):t;return n.replace&&rk(e)?e:{...o,...e}}return o}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:o,setEdges:r,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:o}=t.getState(),[r,i,a]=o;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:r,y:i,zoom:a}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:o,edges:r,onNodesDelete:i,onEdgesDelete:a,triggerNodeChanges:l,triggerEdgeChanges:s,onDelete:u,onBeforeDelete:c}=t.getState(),{nodes:d,edges:f}=await nm({nodesToRemove:e,edgesToRemove:n,nodes:o,edges:r,onBeforeDelete:c}),h=f.length>0,p=d.length>0;if(h){let e=f.map(rE);a?.(f),s(e)}if(p){let e=d.map(rE);i?.(d),l(e)}return(p||h)&&u?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,o)=>{let r=nA(e),a=r?e:i(e),l=void 0!==o;return a?(o||t.getState().nodes).filter(o=>{let i=t.getState().nodeLookup.get(o.id);if(i&&!r&&(o.id===e.id||!i.internals.positionAbsolute))return!1;let s=nC(nM(l?o:i),a);return n&&s>0||s>=a.width*a.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let o=nA(e)?e:i(e);if(!o)return!1;let r=nC(o,t);return n&&r>0||r>=o.width*o.height},updateNode:a,updateNodeData:(e,t,n={replace:!1})=>{a(e,e=>{let o="function"==typeof t?t(e):t;return n.replace?{...e,data:o}:{...e,data:{...e.data,...o}}},n)},updateEdge:l,updateEdgeData:(e,t,n={replace:!1})=>{l(e,e=>{let o="function"==typeof t?t(e):t;return n.replace?{...e,data:o}:{...e,data:{...e.data,...o}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:o}=t.getState();return nc(e,{nodeLookup:n,nodeOrigin:o})},getHandleConnections:({type:e,id:n,nodeId:o})=>Array.from(t.getState().connectionLookup.get(`${o}-${e}${n?`-${n}`:""}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:o})=>Array.from(t.getState().connectionLookup.get(`${o}${e?n?`-${e}-${n}`:`-${e}`:""}`)?.values()??[]),fitView:async e=>{let o,r,i=t.getState().fitViewResolver??{promise:new Promise((e,t)=>{o=e,r=t}),resolve:o,reject:r};return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:i}),n.nodeQueue.push(e=>[...e]),i.promise}}},[]);return(0,b.useMemo)(()=>({...r,...e,viewportInitialized:o}),[o])}let rR=e=>e.selected,rj={actInsideInputWithModifier:!1},rO="undefined"!=typeof window?window:void 0,rB={position:"absolute",width:"100%",height:"100%",top:0,left:0},rD=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function rH({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=h.Free,zoomOnDoubleClick:a=!0,panOnDrag:l=!0,defaultViewport:s,translateExtent:u,minZoom:c,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:p=!0,children:g,noWheelClassName:m,noPanClassName:y,onViewportChange:v,isControlledViewport:x,paneClickDistance:_}){let S=oJ(),E=(0,b.useRef)(null),{userSelectionActive:M,lib:k}=oQ(rD,oW),N=rp(f),C=(0,b.useRef)(),A=oJ();(0,b.useEffect)(()=>{let e=()=>{if(!E.current)return!1;let e=nX(E.current);(0===e.height||0===e.width)&&A.getState().onError?.("004",t6.error004()),A.setState({width:e.width||500,height:e.height||500})};if(E.current){e(),window.addEventListener("resize",e);let t=new ResizeObserver(()=>e());return t.observe(E.current),()=>{window.removeEventListener("resize",e),t&&E.current&&t.unobserve(E.current)}}},[]);let P=(0,b.useCallback)(e=>{v?.({x:e[0],y:e[1],zoom:e[2]}),x||S.setState({transform:e})},[v,x]);return(0,b.useEffect)(()=>{if(E.current){C.current=function({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:o,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:l,onPanZoomEnd:s,onDraggingChange:u}){let c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=t4().clickDistance(!nP(o)||o<0?0:o).scaleExtent([t,n]).translateExtent(r),p=ep(e).call(f);x({x:i.x,y:i.y,zoom:ny(i.zoom,t,n)},[[0,0],[d.width,d.height]],r);let g=p.on("wheel.zoom"),m=p.on("dblclick.zoom");function y(e,t){return p?new Promise(n=>{f?.transform(oA(p,t?.duration,()=>n(!0)),e)}):Promise.resolve(!1)}function v(){f.on("zoom",null)}async function x(e,t,n){let o=ok(e),r=f?.constrain()(o,t,n);return r&&await y(r),new Promise(e=>e(r))}return f.wheelDelta(oP),{update:function({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:o,panOnScroll:r,panOnDrag:i,panOnScrollMode:d,panOnScrollSpeed:y,preventScrolling:x,zoomOnPinch:w,zoomOnScroll:b,zoomOnDoubleClick:_,zoomActivationKeyPressed:S,lib:E,onTransformChange:M}){o&&!c.isZoomingOrPanning&&v();let k=!r||S||o?function({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){let i="wheel"===o.type,a=!t&&i&&!o.ctrlKey,l=oN(o,e);if(o.ctrlKey&&i&&l&&o.preventDefault(),a||l)return null;o.preventDefault(),n.call(this,o,r)}}({noWheelClassName:e,preventScrolling:x,d3ZoomHandler:g}):function({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:a,onPanZoomStart:l,onPanZoom:s,onPanZoomEnd:u}){return c=>{if(oN(c,t))return!1;c.preventDefault(),c.stopImmediatePropagation();let d=n.property("__zoom").k||1;if(c.ctrlKey&&a){let e=eg(c),t=d*Math.pow(2,oP(c));o.scaleTo(n,t,e,c);return}let f=1===c.deltaMode?20:1,p=r===h.Vertical?0:c.deltaX*f,g=r===h.Horizontal?0:c.deltaY*f;!nB()&&c.shiftKey&&r!==h.Vertical&&(p=c.deltaY*f,g=0),o.translateBy(n,-(p/d)*i,-(g/d)*i,{internal:!0});let m=oM(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,l?.(c,m)),e.isPanScrolling&&(s?.(c,m),e.panScrollTimeout=setTimeout(()=>{u?.(c,m),e.isPanScrolling=!1},150))}}({zoomPanValues:c,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:y,zoomOnPinch:w,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:s});if(p.on("wheel.zoom",k,{passive:!1}),!o){let e=function({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;let r=oM(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,o.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(o.sourceEvent,r)}}({zoomPanValues:c,onDraggingChange:u,onPanZoomStart:l});f.on("start",e);let t=function({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&oC(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,oM(i.transform))}}({zoomPanValues:c,panOnDrag:i,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:M});f.on("zoom",t);let o=function({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return a=>{if(!a.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&oC(t,e.mouseButton??0)&&!e.usedRightMouseButton&&a.sourceEvent&&i(a.sourceEvent),e.usedRightMouseButton=!1,o(!1),r&&oE(e.prevViewport,a.transform))){let t=oM(a.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(a.sourceEvent,t)},150*!!n)}}}({zoomPanValues:c,panOnDrag:i,panOnScroll:r,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:u});f.on("end",o)}let N=function({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:a,noWheelClassName:l,noPanClassName:s,lib:u}){return c=>{let d=e||t,f=n&&c.ctrlKey;if(1===c.button&&"mousedown"===c.type&&(oN(c,`${u}-flow__node`)||oN(c,`${u}-flow__edge`)))return!0;if(!o&&!d&&!r&&!i&&!n||a||oN(c,l)&&"wheel"===c.type||oN(c,s)&&("wheel"!==c.type||r&&"wheel"===c.type&&!e)||!n&&c.ctrlKey&&"wheel"===c.type)return!1;if(!n&&"touchstart"===c.type&&c.touches?.length>1)return c.preventDefault(),!1;if(!d&&!r&&!f&&"wheel"===c.type||!o&&("mousedown"===c.type||"touchstart"===c.type)||Array.isArray(o)&&!o.includes(c.button)&&"mousedown"===c.type)return!1;let h=Array.isArray(o)&&o.includes(c.button)||!c.button||c.button<=1;return(!c.ctrlKey||"wheel"===c.type)&&h}}({zoomActivationKeyPressed:S,panOnDrag:i,zoomOnScroll:b,panOnScroll:r,zoomOnDoubleClick:_,zoomOnPinch:w,userSelectionActive:o,noPanClassName:t,noWheelClassName:e,lib:E});f.filter(N),_?p.on("dblclick.zoom",m):p.on("dblclick.zoom",null)},destroy:v,setViewport:async function e(e,t){let n=ok(e);return await y(n,t),new Promise(e=>e(n))},setViewportConstrained:x,getViewport:function(){let e=p?tU(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}},scaleTo:function(e,t){return p?new Promise(n=>{f?.scaleTo(oA(p,t?.duration,()=>n(!0)),e)}):Promise.resolve(!1)},scaleBy:function(e,t){return p?new Promise(n=>{f?.scaleBy(oA(p,t?.duration,()=>n(!0)),e)}):Promise.resolve(!1)},setScaleExtent:function(e){f?.scaleExtent(e)},setTranslateExtent:function(e){f?.translateExtent(e)},syncViewport:function(e){if(p){let t=ok(e),n=p.property("__zoom");(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}},setClickDistance:function(e){let t=!nP(e)||e<0?0:e;f?.clickDistance(t)}}}({domNode:E.current,minZoom:c,maxZoom:d,translateExtent:u,viewport:s,paneClickDistance:_,onDraggingChange:e=>S.setState({paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:o}=S.getState();o?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:o}=S.getState();o?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:o}=S.getState();o?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=C.current.getViewport();return S.setState({panZoom:C.current,transform:[e,t,n],domNode:E.current.closest(".react-flow")}),()=>{C.current?.destroy()}}},[]),(0,b.useEffect)(()=>{C.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:o,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:a,panOnDrag:l,zoomActivationKeyPressed:N,preventScrolling:p,noPanClassName:y,userSelectionActive:M,noWheelClassName:m,lib:k,onTransformChange:P})},[e,t,n,o,r,i,a,l,N,p,y,M,m,k,P]),(0,w.jsx)("div",{className:"react-flow__renderer",ref:E,style:rB,children:g})}let rT=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function rL(){let{userSelectionActive:e,userSelectionRect:t}=oQ(rT,oW);return e&&t?(0,w.jsx)("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}let rV=(e,t)=>n=>{n.target===t.current&&e?.(n)},rF=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function rX({isSelecting:e,selectionKeyPressed:t,selectionMode:n=p.Full,panOnDrag:o,selectionOnDrag:r,onSelectionStart:i,onSelectionEnd:a,onPaneClick:l,onPaneContextMenu:s,onPaneScroll:u,onPaneMouseEnter:c,onPaneMouseMove:d,onPaneMouseLeave:f,children:h}){let g=oJ(),{userSelectionActive:m,elementsSelectable:y,dragging:v,connectionInProgress:x}=oQ(rF,oW),S=y&&(e||m),E=(0,b.useRef)(null),M=(0,b.useRef)(),k=(0,b.useRef)(new Set),N=(0,b.useRef)(new Set),C=(0,b.useRef)(!1),A=(0,b.useRef)(!1),P=e=>{if(C.current||x){C.current=!1;return}l?.(e),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},z=!0===o||Array.isArray(o)&&o.includes(0);return(0,w.jsxs)("div",{className:_(["react-flow__pane",{draggable:z,dragging:v,selection:e}]),onClick:S?void 0:rV(P,E),onContextMenu:rV(e=>{if(Array.isArray(o)&&o?.includes(2))return void e.preventDefault();s?.(e)},E),onWheel:rV(u?e=>u(e):void 0,E),onPointerEnter:S?void 0:c,onPointerDown:S?t=>{let{resetSelectedElements:n,domNode:o}=g.getState();if(M.current=o?.getBoundingClientRect(),!y||!e||0!==t.button||t.target!==E.current||!M.current)return;t.target?.setPointerCapture?.(t.pointerId),A.current=!0,C.current=!1;let{x:r,y:a}=nK(t.nativeEvent,M.current);n(),g.setState({userSelectionRect:{width:0,height:0,startX:r,startY:a,x:r,y:a}}),i?.(t)}:d,onPointerMove:S?e=>{let{userSelectionRect:t,transform:o,nodeLookup:r,edgeLookup:i,connectionLookup:a,triggerNodeChanges:l,triggerEdgeChanges:s,defaultEdgeOptions:u}=g.getState();if(!M.current||!t)return;C.current=!0;let{x:c,y:d}=nK(e.nativeEvent,M.current),{startX:f,startY:h}=t,m={startX:f,startY:h,x:c<f?c:f,y:d<h?d:h,width:Math.abs(c-f),height:Math.abs(d-h)},y=k.current,v=N.current;k.current=new Set(nf(r,m,o,n===p.Partial,!0).map(e=>e.id)),N.current=new Set;let x=u?.selectable??!0;for(let e of k.current){let t=a.get(e);if(t)for(let{edgeId:e}of t.values()){let t=i.get(e);t&&(t.selectable??x)&&N.current.add(e)}}nV(y,k.current)||l(r_(r,k.current,!0)),nV(v,N.current)||s(r_(i,N.current)),g.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}:d,onPointerUp:S?e=>{if(0!==e.button||!A.current)return;e.target?.releasePointerCapture?.(e.pointerId);let{userSelectionRect:n}=g.getState();!m&&n&&e.target===E.current&&P?.(e),g.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:k.current.size>0}),a?.(e),(t||r)&&(C.current=!1),A.current=!1}:void 0,onPointerLeave:f,ref:E,style:rB,children:[h,(0,w.jsx)(rL,{})]})}function rY({id:e,store:t,unselect:n=!1,nodeRef:o}){let{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:a,nodeLookup:l,onError:s}=t.getState(),u=l.get(e);if(!u)return void s?.("012",t6.error012(e));t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&a)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):r([e])}function rq({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:i,nodeClickDistance:a}){let l=oJ(),[s,u]=(0,b.useState)(!1),c=(0,b.useRef)();return(0,b.useEffect)(()=>{c.current=function({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},a=0,l=new Map,s=!1,u={x:0,y:0},c=null,d=!1,f=null,h=!1;return{update:function({noDragClassName:p,handleSelector:g,domNode:m,isSelectable:y,nodeId:v,nodeClickDistance:x=0}){function w({x:e,y:n},r){let{nodeLookup:a,nodeExtent:s,snapGrid:u,snapToGrid:c,nodeOrigin:d,onNodeDrag:f,onSelectionDrag:h,onError:p,updateNodePositions:g}=t();i={x:e,y:n};let m=!1,y={x:0,y:0,x2:0,y2:0};for(let[t,o]of(l.size>1&&s&&(y=nS(nd(l))),l)){if(!a.has(t))continue;let r={x:e-o.distance.x,y:n-o.distance.y};c&&(r=n$(r,u));let i=[[s[0][0],s[0][1]],[s[1][0],s[1][1]]];if(l.size>1&&s&&!o.extent){let{positionAbsolute:e}=o.internals,t=e.x-y.x+s[0][0],n=e.x+o.measured.width-y.x2+s[1][0];i=[[t,e.y-y.y+s[0][1]],[n,e.y+o.measured.height-y.y2+s[1][1]]]}let{position:f,positionAbsolute:h}=ng({nodeId:t,nextPosition:r,nodeLookup:a,nodeExtent:i,nodeOrigin:d,onError:p});m=m||o.position.x!==f.x||o.position.y!==f.y,o.position=f,o.internals.positionAbsolute=h}if(m&&(g(l,!0),r&&(o||f||!v&&h))){let[e,t]=ov({nodeId:v,dragItems:l,nodeLookup:a});o?.(r,l,e,t),f?.(r,e,t),v||h?.(r,t)}}async function b(){if(!c)return;let{transform:e,panBy:n,autoPanSpeed:o,autoPanOnNodeDrag:r}=t();if(!r){s=!1,cancelAnimationFrame(a);return}let[l,d]=nb(u,c,o);(0!==l||0!==d)&&(i.x=(i.x??0)-l/e[2],i.y=(i.y??0)-d/e[2],await n({x:l,y:d})&&w(i,null)),a=requestAnimationFrame(b)}function _(o){let{nodeLookup:r,multiSelectionActive:a,nodesDraggable:s,transform:u,snapGrid:f,snapToGrid:h,selectNodesOnDrag:p,onNodeDragStart:g,onSelectionDragStart:m,unselectNodesAndEdges:x}=t();d=!0,p&&y||a||!v||r.get(v)?.selected||x(),y&&p&&v&&e?.(v);let w=nF(o.sourceEvent,{transform:u,snapGrid:f,snapToGrid:h,containerBounds:c});if(i=w,(l=function(e,t,n,o){let r=new Map;for(let[i,a]of e)if((a.selected||a.id===o)&&(!a.parentId||!function e(t,n){if(!t.parentId)return!1;let o=n.get(t.parentId);return!!o&&(!!o.selected||e(o,n))}(a,e))&&(a.draggable||t&&void 0===a.draggable)){let t=e.get(i);t&&r.set(i,{id:i,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return r}(r,s,w,v)).size>0&&(n||g||!v&&m)){let[e,t]=ov({nodeId:v,dragItems:l,nodeLookup:r});n?.(o.sourceEvent,l,e,t),g?.(o.sourceEvent,e,t),v||m?.(o.sourceEvent,t)}}f=ep(m);let S=eC().clickDistance(x).on("start",e=>{let{domNode:n,nodeDragThreshold:o,transform:r,snapGrid:a,snapToGrid:l}=t();c=n?.getBoundingClientRect()||null,h=!1,0===o&&_(e),i=nF(e.sourceEvent,{transform:r,snapGrid:a,snapToGrid:l,containerBounds:c}),u=nK(e.sourceEvent,c)}).on("drag",e=>{let{autoPanOnNodeDrag:n,transform:o,snapGrid:r,snapToGrid:a,nodeDragThreshold:f,nodeLookup:p}=t(),g=nF(e.sourceEvent,{transform:o,snapGrid:r,snapToGrid:a,containerBounds:c});if(("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1||v&&!p.has(v))&&(h=!0),!h){if(!s&&n&&d&&(s=!0,b()),!d){let t=g.xSnapped-(i.x??0),n=g.ySnapped-(i.y??0);Math.sqrt(t*t+n*n)>f&&_(e)}(i.x!==g.xSnapped||i.y!==g.ySnapped)&&l&&d&&(u=nK(e.sourceEvent,c),w(g,e.sourceEvent))}}).on("end",e=>{if(d&&!h&&(s=!1,d=!1,cancelAnimationFrame(a),l.size>0)){let{nodeLookup:n,updateNodePositions:o,onNodeDragStop:i,onSelectionDragStop:a}=t();if(o(l,!1),r||i||!v&&a){let[t,o]=ov({nodeId:v,dragItems:l,nodeLookup:n,dragging:!1});r?.(e.sourceEvent,l,t,o),i?.(e.sourceEvent,t,o),v||a?.(e.sourceEvent,o)}}}).filter(e=>{let t=e.target;return!e.button&&(!p||!oy(t,`.${p}`,m))&&(!g||oy(t,g,m))});f.call(S)},destroy:function(){f?.on(".drag",null)}}}({getStoreItems:()=>l.getState(),onNodeMouseDown:t=>{rY({id:t,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),(0,b.useEffect)(()=>{if(t)c.current?.destroy();else if(e.current)return c.current?.update({noDragClassName:n,handleSelector:o,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:a}),()=>{c.current?.destroy()}},[n,o,t,i,e,r]),s}let rW=e=>t=>t.selected&&(t.draggable||e&&void 0===t.draggable);function rZ(){let e=oJ();return(0,b.useCallback)(t=>{let{nodeExtent:n,snapToGrid:o,snapGrid:r,nodesDraggable:i,onError:a,updateNodePositions:l,nodeLookup:s,nodeOrigin:u}=e.getState(),c=new Map,d=rW(i),f=o?r[0]:5,h=o?r[1]:5,p=t.direction.x*f*t.factor,g=t.direction.y*h*t.factor;for(let[,e]of s){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+p,y:e.internals.positionAbsolute.y+g};o&&(t=n$(t,r));let{position:i,positionAbsolute:l}=ng({nodeId:e.id,nextPosition:t,nodeLookup:s,nodeExtent:n,nodeOrigin:u,onError:a});e.position=i,e.internals.positionAbsolute=l,c.set(e.id,e)}l(c)},[])}let rK=(0,b.createContext)(null),rU=rK.Provider;rK.Consumer;let rG=()=>(0,b.useContext)(rK),rQ=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),rJ=(e,t,n)=>o=>{let{connectionClickStartHandle:r,connectionMode:i,connection:a}=o,{fromHandle:l,toHandle:s,isValid:u}=a,c=s?.nodeId===e&&s?.id===t&&s?.type===n;return{connectingFrom:l?.nodeId===e&&l?.id===t&&l?.type===n,connectingTo:c,clickConnecting:r?.nodeId===e&&r?.id===t&&r?.type===n,isPossibleEndHandle:i===f.Strict?l?.type!==n:e!==l?.nodeId||t!==l?.id,connectionInProcess:!!l,clickConnectionInProcess:!!r,valid:c&&u}},r0=(0,b.memo)(rN(function({type:e="source",position:t=y.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:a,onConnect:l,children:s,className:u,onMouseDown:c,onTouchStart:d,...f},h){let p=a||null,g="target"===e,m=oJ(),v=rG(),{connectOnClick:x,noPanClassName:b,rfId:S}=oQ(rQ,oW),{connectingFrom:E,connectingTo:M,clickConnecting:k,isPossibleEndHandle:N,connectionInProcess:C,clickConnectionInProcess:A,valid:P}=oQ(rJ(v,p,e),oW);v||m.getState().onError?.("010",t6.error010());let z=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:o}=m.getState(),r={...t,...e};if(o){let{edges:e,setEdges:t}=m.getState();t(n3(r,e))}n?.(r),l?.(r)},$=e=>{if(!v)return;let t=nZ(e.nativeEvent);if(r&&(t&&0===e.button||!t)){let t=m.getState();oS.onPointerDown(e.nativeEvent,{autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:g,handleId:p,nodeId:v,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:t.onConnectEnd,updateConnection:t.updateConnection,onConnect:z,isValidConnection:n||t.isValidConnection,getTransform:()=>m.getState().transform,getFromHandle:()=>m.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed})}t?c?.(e):d?.(e)};return(0,w.jsx)("div",{"data-handleid":p,"data-nodeid":v,"data-handlepos":t,"data-id":`${S}-${v}-${p}-${e}`,className:_(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",b,u,{source:!g,target:g,connectable:o,connectablestart:r,connectableend:i,clickconnecting:k,connectingfrom:E,connectingto:M,valid:P,connectionindicator:o&&(!C||N)&&(C||A?i:r)}]),onMouseDown:$,onTouchStart:$,onClick:x?t=>{let{onClickConnectStart:o,onClickConnectEnd:i,connectionClickStartHandle:a,connectionMode:l,isValidConnection:s,lib:u,rfId:c,nodeLookup:d,connection:f}=m.getState();if(!v||!a&&!r)return;if(!a){o?.(t.nativeEvent,{nodeId:v,handleId:p,handleType:e}),m.setState({connectionClickStartHandle:{nodeId:v,type:e,id:p}});return}let h=nY(t.target),g=n||s,{connection:y,isValid:x}=oS.isValid(t.nativeEvent,{handle:{nodeId:v,id:p,type:e},connectionMode:l,fromNodeId:a.nodeId,fromHandleId:a.id||null,fromType:a.type,isValidConnection:g,flowId:c,doc:h,lib:u,nodeLookup:d});x&&y&&z(y);let w=structuredClone(f);delete w.inProgress,w.toPosition=w.toHandle?w.toHandle.position:null,i?.(t,w),m.setState({connectionClickStartHandle:null})}:void 0,ref:h,...f,children:s})})),r1={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},r2={input:function({data:e,isConnectable:t,sourcePosition:n=y.Bottom}){return(0,w.jsxs)(w.Fragment,{children:[e?.label,(0,w.jsx)(r0,{type:"source",position:n,isConnectable:t})]})},default:function({data:e,isConnectable:t,targetPosition:n=y.Top,sourcePosition:o=y.Bottom}){return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(r0,{type:"target",position:n,isConnectable:t}),e?.label,(0,w.jsx)(r0,{type:"source",position:o,isConnectable:t})]})},output:function({data:e,isConnectable:t,targetPosition:n=y.Top}){return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(r0,{type:"target",position:n,isConnectable:t}),e?.label]})},group:function(){return null}},r5=e=>{let{width:t,height:n,x:o,y:r}=nd(e.nodeLookup,{filter:e=>!!e.selected});return{width:nP(t)?t:null,height:nP(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${r}px)`}};function r3({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let o=oJ(),{width:r,height:i,transformString:a,userSelectionActive:l}=oQ(r5,oW),s=rZ(),u=(0,b.useRef)(null);if((0,b.useEffect)(()=>{n||u.current?.focus({preventScroll:!0})},[n]),rq({nodeRef:u}),l||!r||!i)return null;let c=e?t=>{e(t,o.getState().nodes.filter(e=>e.selected))}:void 0;return(0,w.jsx)("div",{className:_(["react-flow__nodesselection","react-flow__container",t]),style:{transform:a},children:(0,w.jsx)("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:c,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(r1,e.key)&&(e.preventDefault(),s({direction:r1[e.key],factor:e.shiftKey?4:1}))},style:{width:r,height:i}})})}let r4="undefined"!=typeof window?window:void 0,r6=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function r8({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:a,paneClickDistance:l,deleteKeyCode:s,selectionKeyCode:u,selectionOnDrag:c,selectionMode:d,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:p,panActivationKeyCode:g,zoomActivationKeyCode:m,elementsSelectable:y,zoomOnScroll:v,zoomOnPinch:x,panOnScroll:_,panOnScrollSpeed:S,panOnScrollMode:E,zoomOnDoubleClick:M,panOnDrag:k,defaultViewport:N,translateExtent:C,minZoom:A,maxZoom:P,preventScrolling:z,onSelectionContextMenu:$,noWheelClassName:I,noPanClassName:R,disableKeyboardA11y:j,onViewportChange:O,isControlledViewport:B}){let{nodesSelectionActive:D,userSelectionActive:H}=oQ(r6),T=rp(u,{target:r4}),L=rp(g,{target:r4}),V=L||k,F=L||_,X=c&&!0!==V,Y=T||H||X;return!function({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=oJ(),{deleteElements:o}=rI(),r=rp(e,rj),i=rp(t,{target:rO});(0,b.useEffect)(()=>{if(r){let{edges:e,nodes:t}=n.getState();o({nodes:t.filter(rR),edges:e.filter(rR)}),n.setState({nodesSelectionActive:!1})}},[r]),(0,b.useEffect)(()=>{n.setState({multiSelectionActive:i})},[i])}({deleteKeyCode:s,multiSelectionKeyCode:p}),(0,w.jsx)(rH,{onPaneContextMenu:i,elementsSelectable:y,zoomOnScroll:v,zoomOnPinch:x,panOnScroll:F,panOnScrollSpeed:S,panOnScrollMode:E,zoomOnDoubleClick:M,panOnDrag:!T&&V,defaultViewport:N,translateExtent:C,minZoom:A,maxZoom:P,zoomActivationKeyCode:m,preventScrolling:z,noWheelClassName:I,noPanClassName:R,onViewportChange:O,isControlledViewport:B,paneClickDistance:l,children:(0,w.jsxs)(rX,{onSelectionStart:f,onSelectionEnd:h,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:a,panOnDrag:V,isSelecting:!!Y,selectionMode:d,selectionKeyPressed:T,selectionOnDrag:X,children:[e,D&&(0,w.jsx)(r3,{onSelectionContextMenu:$,noPanClassName:R,disableKeyboardA11y:j})]})})}r8.displayName="FlowRenderer";let r9=(0,b.memo)(r8),r7=e=>t=>e?nf(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys()),ie=e=>e.updateNodeInternals;function it({id:e,onClick:t,onMouseEnter:n,onMouseMove:o,onMouseLeave:r,onContextMenu:i,onDoubleClick:a,nodesDraggable:l,elementsSelectable:s,nodesConnectable:u,nodesFocusable:c,resizeObserver:d,noDragClassName:f,noPanClassName:h,disableKeyboardA11y:p,rfId:g,nodeTypes:m,nodeClickDistance:y,onError:v}){let{node:x,internals:S,isParent:E}=oQ(t=>{let n=t.nodeLookup.get(e),o=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:o}},oW),M=x.type||"default",k=m?.[M]||r2[M];void 0===k&&(v?.("003",t6.error003(M)),M="default",k=r2.default);let N=!!(x.draggable||l&&void 0===x.draggable),C=!!(x.selectable||s&&void 0===x.selectable),A=!!(x.connectable||u&&void 0===x.connectable),P=!!(x.focusable||c&&void 0===x.focusable),z=oJ(),$=nT(x),I=function({node:e,nodeType:t,hasDimensions:n,resizeObserver:o}){let r=oJ(),i=(0,b.useRef)(null),a=(0,b.useRef)(null),l=(0,b.useRef)(e.sourcePosition),s=(0,b.useRef)(e.targetPosition),u=(0,b.useRef)(t),c=n&&!!e.internals.handleBounds;return(0,b.useEffect)(()=>{!i.current||e.hidden||c&&a.current===i.current||(a.current&&o?.unobserve(a.current),o?.observe(i.current),a.current=i.current)},[c,e.hidden]),(0,b.useEffect)(()=>()=>{a.current&&(o?.unobserve(a.current),a.current=null)},[]),(0,b.useEffect)(()=>{if(i.current){let n=u.current!==t,o=l.current!==e.sourcePosition,a=s.current!==e.targetPosition;(n||o||a)&&(u.current=t,l.current=e.sourcePosition,s.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}({node:x,nodeType:M,hasDimensions:$,resizeObserver:d}),R=rq({nodeRef:I,disabled:x.hidden||!N,noDragClassName:f,handleSelector:x.dragHandle,nodeId:e,isSelectable:C,nodeClickDistance:y}),j=rZ();if(x.hidden)return null;let O=nH(x),B=void 0===x.internals.handleBounds?{width:x.width??x.initialWidth??x.style?.width,height:x.height??x.initialHeight??x.style?.height}:{width:x.width??x.style?.width,height:x.height??x.style?.height},D=C||N||t||n||o||r,H=n?e=>n(e,{...S.userNode}):void 0,T=o?e=>o(e,{...S.userNode}):void 0,L=r?e=>r(e,{...S.userNode}):void 0,V=i?e=>i(e,{...S.userNode}):void 0,F=a?e=>a(e,{...S.userNode}):void 0;return(0,w.jsx)("div",{className:_(["react-flow__node",`react-flow__node-${M}`,{[h]:N},x.className,{selected:x.selected,selectable:C,parent:E,draggable:N,dragging:R}]),ref:I,style:{zIndex:S.z,transform:`translate(${S.positionAbsolute.x}px,${S.positionAbsolute.y}px)`,pointerEvents:D?"all":"none",visibility:$?"visible":"hidden",...x.style,...B},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:H,onMouseMove:T,onMouseLeave:L,onContextMenu:V,onClick:n=>{let{selectNodesOnDrag:o,nodeDragThreshold:r}=z.getState();C&&(!o||!N||r>0)&&rY({id:e,store:z,nodeRef:I}),t&&t(n,{...S.userNode})},onDoubleClick:F,onKeyDown:P?t=>{!nW(t.nativeEvent)&&!p&&(t9.includes(t.key)&&C?rY({id:e,store:z,unselect:"Escape"===t.key,nodeRef:I}):N&&x.selected&&Object.prototype.hasOwnProperty.call(r1,t.key)&&(t.preventDefault(),z.setState({ariaLiveMessage:`Moved selected node ${t.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~S.positionAbsolute.x}, y: ${~~S.positionAbsolute.y}`}),j({direction:r1[t.key],factor:t.shiftKey?4:1})))}:void 0,tabIndex:P?0:void 0,role:P?"button":void 0,"aria-describedby":p?void 0:`${o2}-${g}`,"aria-label":x.ariaLabel,children:(0,w.jsx)(rU,{value:e,children:(0,w.jsx)(k,{id:e,data:x.data,type:M,positionAbsoluteX:S.positionAbsolute.x,positionAbsoluteY:S.positionAbsolute.y,selected:x.selected??!1,selectable:C,draggable:N,deletable:x.deletable??!0,isConnectable:A,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:R,dragHandle:x.dragHandle,zIndex:S.z,parentId:x.parentId,...O})})})}let io=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function ir(e){var t;let{nodesDraggable:n,nodesConnectable:o,nodesFocusable:r,elementsSelectable:i,onError:a}=oQ(io,oW),l=(t=e.onlyRenderVisibleElements,oQ((0,b.useCallback)(r7(t),[t]),oW)),s=function(){let e=oQ(ie),[t]=(0,b.useState)(()=>"undefined"==typeof ResizeObserver?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute("data-id");n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,b.useEffect)(()=>()=>{t?.disconnect()},[t]),t}();return(0,w.jsx)("div",{className:"react-flow__nodes",style:rB,children:l.map(t=>(0,w.jsx)(it,{id:t,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:n,nodesConnectable:o,nodesFocusable:r,elementsSelectable:i,nodeClickDistance:e.nodeClickDistance,onError:a},t))})}ir.displayName="NodeRenderer";let ii=(0,b.memo)(ir),ia={[m.Arrow]:({color:e="none",strokeWidth:t=1})=>(0,w.jsx)("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[m.ArrowClosed]:({color:e="none",strokeWidth:t=1})=>(0,w.jsx)("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},il=({id:e,type:t,color:n,width:o=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{let s=function(e){let t=oJ();return(0,b.useMemo)(()=>Object.prototype.hasOwnProperty.call(ia,e)?ia[e]:(t.getState().onError?.("009",t6.error009(e)),null),[e])}(t);return s?(0,w.jsx)("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:(0,w.jsx)(s,{color:n,strokeWidth:a})}):null},is=({defaultColor:e,rfId:t})=>{let n=oQ(e=>e.edges),o=oQ(e=>e.defaultEdgeOptions),r=(0,b.useMemo)(()=>(function(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){let i=new Set;return e.reduce((e,a)=>([a.markerStart||o,a.markerEnd||r].forEach(o=>{if(o&&"object"==typeof o){let r=oi(o,t);i.has(r)||(e.push({id:r,color:o.color||n,...o}),i.add(r))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))})(n,{id:t,defaultColor:e,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[n,o,t,e]);return r.length?(0,w.jsx)("svg",{className:"react-flow__marker","aria-hidden":"true",children:(0,w.jsx)("defs",{children:r.map(e=>(0,w.jsx)(il,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};is.displayName="MarkerDefinitions";var iu=(0,b.memo)(is);function ic({x:e,y:t,label:n,labelStyle:o,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:s,className:u,...c}){let[d,f]=(0,b.useState)({x:1,y:0,width:0,height:0}),h=_(["react-flow__edge-textwrapper",u]),p=(0,b.useRef)(null);return((0,b.useEffect)(()=>{if(p.current){let e=p.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n)?(0,w.jsxs)("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:h,visibility:d.width?"visible":"hidden",...c,children:[r&&(0,w.jsx)("rect",{width:d.width+2*a[0],x:-a[0],y:-a[1],height:d.height+2*a[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),(0,w.jsx)("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:p,style:o,children:n}),s]}):null}ic.displayName="EdgeText";let id=(0,b.memo)(ic);function ih({path:e,labelX:t,labelY:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:s,interactionWidth:u=20,...c}){return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)("path",{...c,d:e,fill:"none",className:_(["react-flow__edge-path",c.className])}),u&&(0,w.jsx)("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}),o&&nP(t)&&nP(n)?(0,w.jsx)(id,{x:t,y:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:a,labelBgPadding:l,labelBgBorderRadius:s}):null]})}function ip({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===y.Left||e===y.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function ig({sourceX:e,sourceY:t,sourcePosition:n=y.Bottom,targetX:o,targetY:r,targetPosition:i=y.Top}){let[a,l]=ip({pos:n,x1:e,y1:t,x2:o,y2:r}),[s,u]=ip({pos:i,x1:o,y1:r,x2:e,y2:t}),[c,d,f,h]=nG({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:s,targetControlY:u});return[`M${e},${t} C${a},${l} ${s},${u} ${o},${r}`,c,d,f,h]}function im(e){return(0,b.memo)(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:a,targetPosition:l,label:s,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:g,markerStart:m,interactionWidth:y})=>{let[v,x,b]=ig({sourceX:n,sourceY:o,sourcePosition:a,targetX:r,targetY:i,targetPosition:l}),_=e.isInternal?void 0:t;return(0,w.jsx)(ih,{id:_,path:v,labelX:x,labelY:b,label:s,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:g,markerStart:m,interactionWidth:y})})}let iy=im({isInternal:!1}),iv=im({isInternal:!0});function ix(e){return(0,b.memo)(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,sourcePosition:h=y.Bottom,targetPosition:p=y.Top,markerEnd:g,markerStart:m,pathOptions:v,interactionWidth:x})=>{let[b,_,S]=oe({sourceX:n,sourceY:o,sourcePosition:h,targetX:r,targetY:i,targetPosition:p,borderRadius:v?.borderRadius,offset:v?.offset}),E=e.isInternal?void 0:t;return(0,w.jsx)(ih,{id:E,path:b,labelX:_,labelY:S,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:g,markerStart:m,interactionWidth:x})})}iy.displayName="SimpleBezierEdge",iv.displayName="SimpleBezierEdgeInternal";let iw=ix({isInternal:!1}),ib=ix({isInternal:!0});function i_(e){return(0,b.memo)(({id:t,...n})=>{let o=e.isInternal?void 0:t;return(0,w.jsx)(iw,{...n,id:o,pathOptions:(0,b.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}iw.displayName="SmoothStepEdge",ib.displayName="SmoothStepEdgeInternal";let iS=i_({isInternal:!1}),iE=i_({isInternal:!0});function iM(e){return(0,b.memo)(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:g})=>{let[m,y,v]=n6({sourceX:n,sourceY:o,targetX:r,targetY:i}),x=e.isInternal?void 0:t;return(0,w.jsx)(ih,{id:x,path:m,labelX:y,labelY:v,label:a,labelStyle:l,labelShowBg:s,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:p,interactionWidth:g})})}iS.displayName="StepEdge",iE.displayName="StepEdgeInternal";let ik=iM({isInternal:!1}),iN=iM({isInternal:!0});function iC(e){return(0,b.memo)(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:a=y.Bottom,targetPosition:l=y.Top,label:s,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:g,markerStart:m,pathOptions:v,interactionWidth:x})=>{let[b,_,S]=n0({sourceX:n,sourceY:o,sourcePosition:a,targetX:r,targetY:i,targetPosition:l,curvature:v?.curvature}),E=e.isInternal?void 0:t;return(0,w.jsx)(ih,{id:E,path:b,labelX:_,labelY:S,label:s,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:h,style:p,markerEnd:g,markerStart:m,interactionWidth:x})})}ik.displayName="StraightEdge",iN.displayName="StraightEdgeInternal";let iA=iC({isInternal:!1}),iP=iC({isInternal:!0});iA.displayName="BezierEdge",iP.displayName="BezierEdgeInternal";let iz={default:iP,straight:iN,step:iE,smoothstep:ib,simplebezier:iv},i$={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},iI=(e,t,n)=>n===y.Left?e-t:n===y.Right?e+t:e,iR=(e,t,n)=>n===y.Top?e-t:n===y.Bottom?e+t:e,ij="react-flow__edgeupdater";function iO({position:e,centerX:t,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:i,onMouseOut:a,type:l}){return(0,w.jsx)("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:a,className:_([ij,`${ij}-${l}`]),cx:iI(t,o,e),cy:iR(n,o,e),r:o,stroke:"transparent",fill:"transparent"})}function iB({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:o,sourceY:r,targetX:i,targetY:a,sourcePosition:l,targetPosition:s,onReconnect:u,onReconnectStart:c,onReconnectEnd:d,setReconnecting:f,setUpdateHover:h}){let p=oJ(),g=(e,t)=>{if(0!==e.button)return;let{autoPanOnConnect:o,domNode:r,isValidConnection:i,connectionMode:a,connectionRadius:l,lib:s,onConnectStart:h,onConnectEnd:g,cancelConnection:m,nodeLookup:y,rfId:v,panBy:x,updateConnection:w}=p.getState(),b="target"===t.type;f(!0),c?.(e,n,t.type),oS.onPointerDown(e.nativeEvent,{autoPanOnConnect:o,connectionMode:a,connectionRadius:l,domNode:r,handleId:t.id,nodeId:t.nodeId,nodeLookup:y,isTarget:b,edgeUpdaterType:t.type,lib:s,flowId:v,cancelConnection:m,panBy:x,isValidConnection:i,onConnect:e=>u?.(n,e),onConnectStart:h,onConnectEnd:g,onReconnectEnd:(e,o)=>{f(!1),d?.(e,n,t.type,o)},updateConnection:w,getTransform:()=>p.getState().transform,getFromHandle:()=>p.getState().connection.fromHandle})},m=()=>h(!0),y=()=>h(!1);return(0,w.jsxs)(w.Fragment,{children:[(!0===e||"source"===e)&&(0,w.jsx)(iO,{position:l,centerX:o,centerY:r,radius:t,onMouseDown:e=>g(e,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),onMouseEnter:m,onMouseOut:y,type:"source"}),(!0===e||"target"===e)&&(0,w.jsx)(iO,{position:s,centerX:i,centerY:a,radius:t,onMouseDown:e=>g(e,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),onMouseEnter:m,onMouseOut:y,type:"target"})]})}function iD({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:o,onClick:r,onDoubleClick:i,onContextMenu:a,onMouseEnter:l,onMouseMove:s,onMouseLeave:u,reconnectRadius:c,onReconnect:d,onReconnectStart:h,onReconnectEnd:p,rfId:g,edgeTypes:m,noPanClassName:v,onError:x,disableKeyboardA11y:S}){let E=oQ(t=>t.edgeLookup.get(e)),M=oQ(e=>e.defaultEdgeOptions),k=(E=M?{...M,...E}:E).type||"default",N=m?.[k]||iz[k];void 0===N&&(x?.("011",t6.error011(k)),k="default",N=iz.default);let C=!!(E.focusable||t&&void 0===E.focusable),A=void 0!==d&&(E.reconnectable||n&&void 0===E.reconnectable),P=!!(E.selectable||o&&void 0===E.selectable),z=(0,b.useRef)(null),[$,I]=(0,b.useState)(!1),[R,j]=(0,b.useState)(!1),O=oJ(),{zIndex:B,sourceX:D,sourceY:H,targetX:T,targetY:L,sourcePosition:V,targetPosition:F}=oQ((0,b.useCallback)(t=>{let n=t.nodeLookup.get(E.source),o=t.nodeLookup.get(E.target);if(!n||!o)return{zIndex:E.zIndex,...i$};let r=function(e){let{sourceNode:t,targetNode:n}=e;if(!ot(t)||!ot(n))return null;let o=t.internals.handleBounds||on(t.handles),r=n.internals.handleBounds||on(n.handles),i=or(o?.source??[],e.sourceHandle),a=or(e.connectionMode===f.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!a)return e.onError?.("008",t6.error008(!i?"source":"target",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let l=i?.position||y.Bottom,s=a?.position||y.Top,u=oo(t,i,l),c=oo(n,a,s);return{sourceX:u.x,sourceY:u.y,targetX:c.x,targetY:c.y,sourcePosition:l,targetPosition:s}}({id:e,sourceNode:n,targetNode:o,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:t.connectionMode,onError:x});return{zIndex:function({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o=0,elevateOnSelect:r=!1}){if(!r)return o;let i=n||t.selected||e.selected,a=Math.max(e.internals.z||0,t.internals.z||0,1e3);return o+(i?a:0)}({selected:E.selected,zIndex:E.zIndex,sourceNode:n,targetNode:o,elevateOnSelect:t.elevateEdgesOnSelect}),...r||i$}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),oW),X=(0,b.useMemo)(()=>E.markerStart?`url('#${oi(E.markerStart,g)}')`:void 0,[E.markerStart,g]),Y=(0,b.useMemo)(()=>E.markerEnd?`url('#${oi(E.markerEnd,g)}')`:void 0,[E.markerEnd,g]);if(E.hidden||null===D||null===H||null===T||null===L)return null;let q=i?e=>{i(e,{...E})}:void 0,W=a?e=>{a(e,{...E})}:void 0,Z=l?e=>{l(e,{...E})}:void 0,K=s?e=>{s(e,{...E})}:void 0,U=u?e=>{u(e,{...E})}:void 0;return(0,w.jsx)("svg",{style:{zIndex:B},children:(0,w.jsxs)("g",{className:_(["react-flow__edge",`react-flow__edge-${k}`,E.className,v,{selected:E.selected,animated:E.animated,inactive:!P&&!r,updating:$,selectable:P}]),onClick:t=>{let{addSelectedEdges:n,unselectNodesAndEdges:o,multiSelectionActive:i}=O.getState();P&&(O.setState({nodesSelectionActive:!1}),E.selected&&i?(o({nodes:[],edges:[E]}),z.current?.blur()):n([e])),r&&r(t,E)},onDoubleClick:q,onContextMenu:W,onMouseEnter:Z,onMouseMove:K,onMouseLeave:U,onKeyDown:C?t=>{if(!S&&t9.includes(t.key)&&P){let{unselectNodesAndEdges:n,addSelectedEdges:o}=O.getState();"Escape"===t.key?(z.current?.blur(),n({edges:[E]})):o([e])}}:void 0,tabIndex:C?0:void 0,role:C?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":null===E.ariaLabel?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":C?`${o5}-${g}`:void 0,ref:z,children:[!R&&(0,w.jsx)(N,{id:e,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:P,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:D,sourceY:H,targetX:T,targetY:L,sourcePosition:V,targetPosition:F,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:X,markerEnd:Y,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),A&&(0,w.jsx)(iB,{edge:E,isReconnectable:A,reconnectRadius:c,onReconnect:d,onReconnectStart:h,onReconnectEnd:p,sourceX:D,sourceY:H,targetX:T,targetY:L,sourcePosition:V,targetPosition:F,setUpdateHover:I,setReconnecting:j})]})})}let iH=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function iT({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:o,noPanClassName:r,onReconnect:i,onEdgeContextMenu:a,onEdgeMouseEnter:l,onEdgeMouseMove:s,onEdgeMouseLeave:u,onEdgeClick:c,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:h,onReconnectEnd:p,disableKeyboardA11y:g}){let{edgesFocusable:m,edgesReconnectable:y,elementsSelectable:v,onError:x}=oQ(iH,oW),_=oQ((0,b.useCallback)(e=>{if(!t)return e.edges.map(e=>e.id);let n=[];if(e.width&&e.height)for(let t of e.edges){let o=e.nodeLookup.get(t.source),r=e.nodeLookup.get(t.target);o&&r&&function({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){let i=n_(nk(e),nk(t));return i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1),nC({x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]},nE(i))>0}({sourceNode:o,targetNode:r,width:e.width,height:e.height,transform:e.transform})&&n.push(t.id)}return n},[t]),oW);return(0,w.jsxs)("div",{className:"react-flow__edges",children:[(0,w.jsx)(iu,{defaultColor:e,rfId:n}),_.map(e=>(0,w.jsx)(iD,{id:e,edgesFocusable:m,edgesReconnectable:y,elementsSelectable:v,noPanClassName:r,onReconnect:i,onContextMenu:a,onMouseEnter:l,onMouseMove:s,onMouseLeave:u,onClick:c,reconnectRadius:d,onDoubleClick:f,onReconnectStart:h,onReconnectEnd:p,rfId:n,onError:x,edgeTypes:o,disableKeyboardA11y:g},e))]})}iT.displayName="EdgeRenderer";let iL=(0,b.memo)(iT),iV=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function iF({children:e}){let t=oQ(iV);return(0,w.jsx)("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}let iX=e=>e.panZoom?.syncViewport;function iY(e){return e.connection.inProgress?{...e.connection,to:nI(e.connection.to,e.transform)}:{...e.connection}}function iq(e){return oQ(e?t=>e(iY(t)):iY,oW)}let iW=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function iZ({containerStyle:e,style:t,type:n,component:o}){let{nodesConnectable:r,width:i,height:a,isValid:l,inProgress:s}=oQ(iW,oW);return i&&r&&s?(0,w.jsx)("svg",{style:e,width:i,height:a,className:"react-flow__connectionline react-flow__container",children:(0,w.jsx)("g",{className:_(["react-flow__connection",no(l)]),children:(0,w.jsx)(iK,{style:t,type:n,CustomComponent:o,isValid:l})})}):null}let iK=({style:e,type:t=g.Bezier,CustomComponent:n,isValid:o})=>{let{inProgress:r,from:i,fromNode:a,fromHandle:l,fromPosition:s,to:u,toNode:c,toHandle:d,toPosition:f}=iq();if(!r)return;if(n)return(0,w.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:a,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:s,toPosition:f,connectionStatus:no(o),toNode:c,toHandle:d});let h="",p={sourceX:i.x,sourceY:i.y,sourcePosition:s,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case g.Bezier:[h]=n0(p);break;case g.SimpleBezier:[h]=ig(p);break;case g.Step:[h]=oe({...p,borderRadius:0});break;case g.SmoothStep:[h]=oe(p);break;default:[h]=n6(p)}return(0,w.jsx)("path",{d:h,fill:"none",className:"react-flow__connection-path",style:e})};iK.displayName="ConnectionLine";let iU={};function iG(e=iU){(0,b.useRef)(e),oJ(),(0,b.useEffect)(()=>{},[e])}function iQ({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:o,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:a,onNodeMouseEnter:l,onNodeMouseMove:s,onNodeMouseLeave:u,onNodeContextMenu:c,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:h,connectionLineType:p,connectionLineStyle:g,connectionLineComponent:m,connectionLineContainerStyle:y,selectionKeyCode:v,selectionOnDrag:x,selectionMode:_,multiSelectionKeyCode:S,panActivationKeyCode:E,zoomActivationKeyCode:M,deleteKeyCode:k,onlyRenderVisibleElements:N,elementsSelectable:C,defaultViewport:A,translateExtent:P,minZoom:z,maxZoom:$,preventScrolling:I,defaultMarkerColor:R,zoomOnScroll:j,zoomOnPinch:O,panOnScroll:B,panOnScrollSpeed:D,panOnScrollMode:H,zoomOnDoubleClick:T,panOnDrag:L,onPaneClick:V,onPaneMouseEnter:F,onPaneMouseMove:X,onPaneMouseLeave:Y,onPaneScroll:q,onPaneContextMenu:W,paneClickDistance:Z,nodeClickDistance:K,onEdgeContextMenu:U,onEdgeMouseEnter:G,onEdgeMouseMove:Q,onEdgeMouseLeave:J,reconnectRadius:ee,onReconnect:et,onReconnectStart:en,onReconnectEnd:eo,noDragClassName:er,noWheelClassName:ei,noPanClassName:ea,disableKeyboardA11y:el,nodeExtent:es,rfId:eu,viewport:ec,onViewportChange:ed}){iG(e),iG(t),oJ(),(0,b.useRef)(!1),(0,b.useEffect)(()=>{},[]);let ef=rI(),eh=(0,b.useRef)(!1);return(0,b.useEffect)(()=>{!eh.current&&ef.viewportInitialized&&n&&(setTimeout(()=>n(ef),1),eh.current=!0)},[n,ef.viewportInitialized]),!function(e){let t=oQ(iX),n=oJ();(0,b.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t])}(ec),(0,w.jsx)(r9,{onPaneClick:V,onPaneMouseEnter:F,onPaneMouseMove:X,onPaneMouseLeave:Y,onPaneContextMenu:W,onPaneScroll:q,paneClickDistance:Z,deleteKeyCode:k,selectionKeyCode:v,selectionOnDrag:x,selectionMode:_,onSelectionStart:f,onSelectionEnd:h,multiSelectionKeyCode:S,panActivationKeyCode:E,zoomActivationKeyCode:M,elementsSelectable:C,zoomOnScroll:j,zoomOnPinch:O,zoomOnDoubleClick:T,panOnScroll:B,panOnScrollSpeed:D,panOnScrollMode:H,panOnDrag:L,defaultViewport:A,translateExtent:P,minZoom:z,maxZoom:$,onSelectionContextMenu:d,preventScrolling:I,noDragClassName:er,noWheelClassName:ei,noPanClassName:ea,disableKeyboardA11y:el,onViewportChange:ed,isControlledViewport:!!ec,children:(0,w.jsxs)(iF,{children:[(0,w.jsx)(iL,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:a,onReconnect:et,onReconnectStart:en,onReconnectEnd:eo,onlyRenderVisibleElements:N,onEdgeContextMenu:U,onEdgeMouseEnter:G,onEdgeMouseMove:Q,onEdgeMouseLeave:J,reconnectRadius:ee,defaultMarkerColor:R,noPanClassName:ea,disableKeyboardA11y:el,rfId:eu}),(0,w.jsx)(iZ,{style:g,type:p,component:m,containerStyle:y}),(0,w.jsx)("div",{className:"react-flow__edgelabel-renderer"}),(0,w.jsx)(ii,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:s,onNodeMouseLeave:u,onNodeContextMenu:c,nodeClickDistance:K,onlyRenderVisibleElements:N,noPanClassName:ea,noDragClassName:er,disableKeyboardA11y:el,nodeExtent:es,rfId:eu}),(0,w.jsx)("div",{className:"react-flow__viewport-portal"})]})})}iQ.displayName="GraphView";let iJ=(0,b.memo)(iQ),i0=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:a,nodeOrigin:l,nodeExtent:s}={})=>{let u=new Map,c=new Map,d=new Map,h=new Map,p=o??t??[],g=n??e??[],m=l??[0,0],y=s??t8;og(d,h,p);let v=ou(g,u,c,{nodeOrigin:m,nodeExtent:y,elevateNodesOnSelect:!1}),x=[0,0,1];if(a&&r&&i){let{x:e,y:t,zoom:n}=nO(nd(u,{filter:e=>!!((e.width||e.initialWidth)&&(e.height||e.initialHeight))}),r,i,.5,2,.1);x=[e,t,n]}return{rfId:"1",width:0,height:0,transform:x,nodes:g,nodesInitialized:v,nodeLookup:u,parentLookup:c,edges:p,edgeLookup:h,connectionLookup:d,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:void 0!==n,hasDefaultEdges:void 0!==o,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:t8,nodeExtent:y,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:f.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:m,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:a??!1,fitViewOptions:void 0,fitViewResolver:null,connection:{...t7},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:nz,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},i1=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:a,nodeOrigin:l,nodeExtent:s})=>oq((u,c)=>{async function d(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:o,width:r,height:i,minZoom:a,maxZoom:l}=c();t&&(await np({nodes:e,width:r,height:i,panZoom:t,minZoom:a,maxZoom:l},n),o?.resolve(!0),u({fitViewResolver:null}))}return{...i0({nodes:e,edges:t,width:r,height:i,fitView:a,nodeOrigin:l,nodeExtent:s,defaultNodes:n,defaultEdges:o}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:o,elevateNodesOnSelect:r,fitViewQueued:i}=c(),a=ou(e,t,n,{nodeOrigin:o,nodeExtent:s,elevateNodesOnSelect:r,checkEquality:!0});i&&a?(d(),u({nodes:e,nodesInitialized:a,fitViewQueued:!1,fitViewOptions:void 0})):u({nodes:e,nodesInitialized:a})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=c();og(t,n,e),u({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=c();t(e),u({hasDefaultNodes:!0})}if(t){let{setEdges:e}=c();e(t),u({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:o,domNode:r,nodeOrigin:i,nodeExtent:a,debug:l,fitViewQueued:s}=c(),{changes:f,updatedInternals:h}=function(e,t,n,o,r,i){let a=o?.querySelector(".xyflow__viewport"),l=!1;if(!a)return{changes:[],updatedInternals:l};let s=[],u=window.getComputedStyle(a),{m22:c}=new window.DOMMatrixReadOnly(u.transform),d=[];for(let o of e.values()){let e=t.get(o.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),l=!0;continue}let a=nX(o.nodeElement),u=e.measured.width!==a.width||e.measured.height!==a.height;if(a.width&&a.height&&(u||!e.internals.handleBounds||o.force)){let f=o.nodeElement.getBoundingClientRect(),h=nD(e.extent)?e.extent:i,{positionAbsolute:p}=e.internals;e.parentId&&"parent"===e.extent?p=nx(p,a,t.get(e.parentId)):h&&(p=nv(p,h,a));let g={...e,measured:a,internals:{...e.internals,positionAbsolute:p,handleBounds:{source:nU("source",o.nodeElement,f,c,e.id),target:nU("target",o.nodeElement,f,c,e.id)}}};t.set(e.id,g),e.parentId&&oc(g,t,n,{nodeOrigin:r}),l=!0,u&&(s.push({id:e.id,type:"dimensions",dimensions:a}),e.expandParent&&e.parentId&&d.push({id:e.id,parentId:e.parentId,rect:nM(g,r)}))}}if(d.length>0){let e=of(d,t,n,r);s.push(...e)}return{changes:s,updatedInternals:l}}(e,n,o,r,i,a);h&&(!function(e,t,n){let o=os(oa,n);for(let n of e.values())if(n.parentId)oc(n,e,t,o);else{let e=nv(nu(n,o.nodeOrigin),nD(n.extent)?n.extent:o.nodeExtent,nH(n));n.internals.positionAbsolute=e}}(n,o,{nodeOrigin:i,nodeExtent:a}),s?(d(),u({fitViewQueued:!1,fitViewOptions:void 0})):u({}),f?.length>0&&(l&&console.log("React Flow: trigger node changes",f),t?.(f)))},updateNodePositions:(e,t=!1)=>{let n=[],o=[],{nodeLookup:r,triggerNodeChanges:i}=c();for(let[i,a]of e){let e=r.get(i),l=!!(e?.expandParent&&e?.parentId&&a?.position),s={id:i,type:"position",position:l?{x:Math.max(0,a.position.x),y:Math.max(0,a.position.y)}:a.position,dragging:t};l&&e.parentId&&n.push({id:i,parentId:e.parentId,rect:{...a.internals.positionAbsolute,width:a.measured.width??0,height:a.measured.height??0}}),o.push(s)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=c(),i=of(n,r,e,t);o.push(...i)}i(o)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:o,hasDefaultNodes:r,debug:i}=c();e?.length&&(r&&n(rv(e,o)),i&&console.log("React Flow: trigger node changes",e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:o,hasDefaultEdges:r,debug:i}=c();e?.length&&(r&&n(rv(e,o)),i&&console.log("React Flow: trigger edge changes",e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:o,triggerNodeChanges:r,triggerEdgeChanges:i}=c();if(t)return void r(e.map(e=>rb(e,!0)));r(r_(o,new Set([...e]),!0)),i(r_(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:o,triggerNodeChanges:r,triggerEdgeChanges:i}=c();if(t)return void i(e.map(e=>rb(e,!0)));i(r_(n,new Set([...e]))),r(r_(o,new Set,!0))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:o,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=c(),l=(e||o).map(e=>{let t=r.get(e.id);return t&&(t.selected=!1),rb(e.id,!1)}),s=(t||n).map(e=>rb(e.id,!1));i(l),a(s)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=c();t?.setScaleExtent([e,n]),u({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=c();t?.setScaleExtent([n,e]),u({maxZoom:e})},setTranslateExtent:e=>{c().panZoom?.setTranslateExtent(e),u({translateExtent:e})},setPaneClickDistance:e=>{c().panZoom?.setClickDistance(e)},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:o}=c(),r=t.reduce((e,t)=>t.selected?[...e,rb(t.id,!1)]:e,[]),i=e.reduce((e,t)=>t.selected?[...e,rb(t.id,!1)]:e,[]);n(r),o(i)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:o,nodeOrigin:r,elevateNodesOnSelect:i,nodeExtent:a}=c();(e[0][0]!==a[0][0]||e[0][1]!==a[0][1]||e[1][0]!==a[1][0]||e[1][1]!==a[1][1])&&(ou(t,n,o,{nodeOrigin:r,nodeExtent:e,elevateNodesOnSelect:i,checkEquality:!1}),u({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:o,panZoom:r,translateExtent:i}=c();return oh({delta:e,panZoom:r,transform:t,translateExtent:i,width:n,height:o})},cancelConnection:()=>{u({connection:{...t7}})},updateConnection:e=>{u({connection:e})},reset:()=>u({...i0()})}},Object.is);function i2({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:o,initialWidth:r,initialHeight:i,fitView:a,nodeOrigin:l,nodeExtent:s,children:u}){let[c]=(0,b.useState)(()=>i1({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:a,nodeOrigin:l,nodeExtent:s}));return(0,w.jsx)(oU,{value:c,children:(0,w.jsx)(rz,{children:u})})}function i5({children:e,nodes:t,edges:n,defaultNodes:o,defaultEdges:r,width:i,height:a,fitView:l,nodeOrigin:s,nodeExtent:u}){return(0,b.useContext)(oK)?(0,w.jsx)(w.Fragment,{children:e}):(0,w.jsx)(i2,{initialNodes:t,initialEdges:n,defaultNodes:o,defaultEdges:r,initialWidth:i,initialHeight:a,fitView:l,nodeOrigin:s,nodeExtent:u,children:e})}let i3={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var i4=rN(function({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:i,edgeTypes:a,onNodeClick:l,onEdgeClick:s,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:m,onConnectStart:y,onConnectEnd:v,onClickConnectStart:x,onClickConnectEnd:S,onNodeMouseEnter:E,onNodeMouseMove:M,onNodeMouseLeave:k,onNodeContextMenu:N,onNodeDoubleClick:C,onNodeDragStart:A,onNodeDrag:P,onNodeDragStop:z,onNodesDelete:$,onEdgesDelete:I,onDelete:R,onSelectionChange:j,onSelectionDragStart:O,onSelectionDrag:B,onSelectionDragStop:D,onSelectionContextMenu:H,onSelectionStart:T,onSelectionEnd:L,onBeforeDelete:V,connectionMode:F,connectionLineType:X=g.Bezier,connectionLineStyle:Y,connectionLineComponent:q,connectionLineContainerStyle:W,deleteKeyCode:Z="Backspace",selectionKeyCode:K="Shift",selectionOnDrag:U=!1,selectionMode:G=p.Full,panActivationKeyCode:Q="Space",multiSelectionKeyCode:J=nB()?"Meta":"Control",zoomActivationKeyCode:ee=nB()?"Meta":"Control",snapToGrid:et,snapGrid:en,onlyRenderVisibleElements:eo=!1,selectNodesOnDrag:er,nodesDraggable:ei,nodesConnectable:ea,nodesFocusable:el,nodeOrigin:es=ra,edgesFocusable:eu,edgesReconnectable:ec,elementsSelectable:ed=!0,defaultViewport:ef=rl,minZoom:eh=.5,maxZoom:ep=2,translateExtent:eg=t8,preventScrolling:em=!0,nodeExtent:ey,defaultMarkerColor:ev="#b1b1b7",zoomOnScroll:ex=!0,zoomOnPinch:ew=!0,panOnScroll:eb=!1,panOnScrollSpeed:e_=.5,panOnScrollMode:eS=h.Free,zoomOnDoubleClick:eE=!0,panOnDrag:eM=!0,onPaneClick:ek,onPaneMouseEnter:eN,onPaneMouseMove:eC,onPaneMouseLeave:eA,onPaneScroll:eP,onPaneContextMenu:ez,paneClickDistance:e$=0,nodeClickDistance:eI=0,children:eR,onReconnect:ej,onReconnectStart:eO,onReconnectEnd:eB,onEdgeContextMenu:eD,onEdgeDoubleClick:eH,onEdgeMouseEnter:eT,onEdgeMouseMove:eL,onEdgeMouseLeave:eV,reconnectRadius:eF=10,onNodesChange:eX,onEdgesChange:eY,noDragClassName:eq="nodrag",noWheelClassName:eW="nowheel",noPanClassName:eZ="nopan",fitView:eK,fitViewOptions:eU,connectOnClick:eG,attributionPosition:eQ,proOptions:eJ,defaultEdgeOptions:e0,elevateNodesOnSelect:e1,elevateEdgesOnSelect:e2,disableKeyboardA11y:e5=!1,autoPanOnConnect:e3,autoPanOnNodeDrag:e4,autoPanSpeed:e6,connectionRadius:e8,isValidConnection:e9,onError:e7,style:te,id:tt,nodeDragThreshold:tn,viewport:to,onViewportChange:tr,width:ti,height:ta,colorMode:tl="light",debug:ts,onScroll:tu,...tc},td){let tf=tt||"1",th=function(e){let[t,n]=(0,b.useState)("system"===e?null:e);return(0,b.useEffect)(()=>{if("system"!==e)return void n(e);let t=rf(),o=()=>n(t?.matches?"dark":"light");return o(),t?.addEventListener("change",o),()=>{t?.removeEventListener("change",o)}},[e]),null!==t?t:rf()?.matches?"dark":"light"}(tl),tp=(0,b.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),tu?.(e)},[tu]);return(0,w.jsx)("div",{"data-testid":"rf__wrapper",...tc,onScroll:tp,style:{...te,...i3},ref:td,className:_(["react-flow",r,th]),id:tt,children:(0,w.jsxs)(i5,{nodes:e,edges:t,width:ti,height:ta,fitView:eK,nodeOrigin:es,nodeExtent:ey,children:[(0,w.jsx)(iJ,{onInit:u,onNodeClick:l,onEdgeClick:s,onNodeMouseEnter:E,onNodeMouseMove:M,onNodeMouseLeave:k,onNodeContextMenu:N,onNodeDoubleClick:C,nodeTypes:i,edgeTypes:a,connectionLineType:X,connectionLineStyle:Y,connectionLineComponent:q,connectionLineContainerStyle:W,selectionKeyCode:K,selectionOnDrag:U,selectionMode:G,deleteKeyCode:Z,multiSelectionKeyCode:J,panActivationKeyCode:Q,zoomActivationKeyCode:ee,onlyRenderVisibleElements:eo,defaultViewport:ef,translateExtent:eg,minZoom:eh,maxZoom:ep,preventScrolling:em,zoomOnScroll:ex,zoomOnPinch:ew,zoomOnDoubleClick:eE,panOnScroll:eb,panOnScrollSpeed:e_,panOnScrollMode:eS,panOnDrag:eM,onPaneClick:ek,onPaneMouseEnter:eN,onPaneMouseMove:eC,onPaneMouseLeave:eA,onPaneScroll:eP,onPaneContextMenu:ez,paneClickDistance:e$,nodeClickDistance:eI,onSelectionContextMenu:H,onSelectionStart:T,onSelectionEnd:L,onReconnect:ej,onReconnectStart:eO,onReconnectEnd:eB,onEdgeContextMenu:eD,onEdgeDoubleClick:eH,onEdgeMouseEnter:eT,onEdgeMouseMove:eL,onEdgeMouseLeave:eV,reconnectRadius:eF,defaultMarkerColor:ev,noDragClassName:eq,noWheelClassName:eW,noPanClassName:eZ,rfId:tf,disableKeyboardA11y:e5,nodeExtent:ey,viewport:to,onViewportChange:tr}),(0,w.jsx)(rd,{nodes:e,edges:t,defaultNodes:n,defaultEdges:o,onConnect:m,onConnectStart:y,onConnectEnd:v,onClickConnectStart:x,onClickConnectEnd:S,nodesDraggable:ei,nodesConnectable:ea,nodesFocusable:el,edgesFocusable:eu,edgesReconnectable:ec,elementsSelectable:ed,elevateNodesOnSelect:e1,elevateEdgesOnSelect:e2,minZoom:eh,maxZoom:ep,nodeExtent:ey,onNodesChange:eX,onEdgesChange:eY,snapToGrid:et,snapGrid:en,connectionMode:F,translateExtent:eg,connectOnClick:eG,defaultEdgeOptions:e0,fitView:eK,fitViewOptions:eU,onNodesDelete:$,onEdgesDelete:I,onDelete:R,onNodeDragStart:A,onNodeDrag:P,onNodeDragStop:z,onSelectionDrag:B,onSelectionDragStart:O,onSelectionDragStop:D,onMove:c,onMoveStart:d,onMoveEnd:f,noPanClassName:eZ,nodeOrigin:es,rfId:tf,autoPanOnConnect:e3,autoPanOnNodeDrag:e4,autoPanSpeed:e6,onError:e7,connectionRadius:e8,isValidConnection:e9,selectNodesOnDrag:er,nodeDragThreshold:tn,onBeforeDelete:V,paneClickDistance:e$,debug:ts}),(0,w.jsx)(ri,{onSelectionChange:j}),eR,(0,w.jsx)(o7,{proOptions:eJ,position:eQ}),(0,w.jsx)(o6,{rfId:tf,disableKeyboardA11y:e5})]})})});let i6=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function i8({children:e}){let t=oQ(i6);return t?(0,oZ.createPortal)(e,t):null}let i9=e=>e.domNode?.querySelector(".react-flow__viewport-portal");function i7({children:e}){let t=oQ(i9);return t?(0,oZ.createPortal)(e,t):null}function ae(){let e=oJ();return(0,b.useCallback)(t=>{let{domNode:n,updateNodeInternals:o}=e.getState(),r=Array.isArray(t)?t:[t],i=new Map;r.forEach(e=>{let t=n?.querySelector(`.react-flow__node[data-id="${e}"]`);t&&i.set(e,{id:e,nodeElement:t,force:!0})}),requestAnimationFrame(()=>o(i,{triggerFitView:!1}))},[])}let at=e=>e.nodes;function an(){return oQ(at,oW)}let ao=e=>e.edges;function ar(){return oQ(ao,oW)}let ai=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2]});function aa(){return oQ(ai,oW)}function al(e){let[t,n]=(0,b.useState)(e),o=(0,b.useCallback)(e=>n(t=>rv(e,t)),[]);return[t,n,o]}function as(e){let[t,n]=(0,b.useState)(e),o=(0,b.useCallback)(e=>n(t=>rv(e,t)),[]);return[t,n,o]}function au({onStart:e,onChange:t,onEnd:n}){let o=oJ();(0,b.useEffect)(()=>{o.setState({onViewportChangeStart:e})},[e]),(0,b.useEffect)(()=>{o.setState({onViewportChange:t})},[t]),(0,b.useEffect)(()=>{o.setState({onViewportChangeEnd:n})},[n])}function ac({onChange:e}){let t=oJ();(0,b.useEffect)(()=>{let n=[...t.getState().onSelectionChangeHandlers,e];return t.setState({onSelectionChangeHandlers:n}),()=>{let n=t.getState().onSelectionChangeHandlers.filter(t=>t!==e);t.setState({onSelectionChangeHandlers:n})}},[e])}let ad=e=>t=>{if(!e.includeHiddenNodes)return t.nodesInitialized;if(0===t.nodeLookup.size)return!1;for(let[,{internals:e}]of t.nodeLookup)if(void 0===e.handleBounds||!nT(e.userNode))return!1;return!0};function af(e={includeHiddenNodes:!1}){return oQ(ad(e))}function ah({type:e,id:t,nodeId:n,onConnect:o,onDisconnect:r}){console.warn("[DEPRECATED] `useHandleConnections` is deprecated. Instead use `useNodeConnections` https://reactflow.dev/api-reference/hooks/useNodeConnections");let i=rG(),a=n??i,l=(0,b.useRef)(null),s=oQ(n=>n.connectionLookup.get(`${a}-${e}${t?`-${t}`:""}`),nt);return(0,b.useEffect)(()=>{if(l.current&&l.current!==s){let e=s??new Map;nn(l.current,e,r),nn(e,l.current,o)}l.current=s??new Map},[s,o,r]),(0,b.useMemo)(()=>Array.from(s?.values()??[]),[s])}let ap=t6.error014();function ag({id:e,handleType:t,handleId:n,onConnect:o,onDisconnect:r}={}){let i=rG(),a=e??i;if(!a)throw Error(ap);let l=(0,b.useRef)(null),s=oQ(e=>e.connectionLookup.get(`${a}${t?n?`-${t}-${n}`:`-${t}`:""}`),nt);return(0,b.useEffect)(()=>{if(l.current&&l.current!==s){let e=s??new Map;nn(l.current,e,r),nn(e,l.current,o)}l.current=s??new Map},[s,o,r]),(0,b.useMemo)(()=>Array.from(s?.values()??[]),[s])}function am(e){return oQ((0,b.useCallback)(t=>{let n=[],o=Array.isArray(e);for(let r of o?e:[e]){let e=t.nodeLookup.get(r);e&&n.push({id:e.id,type:e.type,data:e.data})}return o?n:n[0]??null},[e]),om)}function ay(e){return oQ((0,b.useCallback)(t=>t.nodeLookup.get(e),[e]),oW)}function av({dimensions:e,lineWidth:t,variant:n,className:o}){return(0,w.jsx)("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:_(["react-flow__background-pattern",n,o])})}function ax({radius:e,className:t}){return(0,w.jsx)("circle",{cx:e,cy:e,r:e,className:_(["react-flow__background-pattern","dots",t])})}(c=x||(x={})).Lines="lines",c.Dots="dots",c.Cross="cross";let aw={[x.Dots]:1,[x.Lines]:1,[x.Cross]:6},ab=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function a_({id:e,variant:t=x.Dots,gap:n=20,size:o,lineWidth:r=1,offset:i=0,color:a,bgColor:l,style:s,className:u,patternClassName:c}){let d=(0,b.useRef)(null),{transform:f,patternId:h}=oQ(ab,oW),p=o||aw[t],g=t===x.Dots,m=t===x.Cross,y=Array.isArray(n)?n:[n,n],v=[y[0]*f[2]||1,y[1]*f[2]||1],S=p*f[2],E=Array.isArray(i)?i:[i,i],M=m?[S,S]:v,k=[E[0]*f[2]||1+M[0]/2,E[1]*f[2]||1+M[1]/2],N=`${h}${e||""}`;return(0,w.jsxs)("svg",{className:_(["react-flow__background",u]),style:{...s,...rB,"--xy-background-color-props":l,"--xy-background-pattern-color-props":a},ref:d,"data-testid":"rf__background",children:[(0,w.jsx)("pattern",{id:N,x:f[0]%v[0],y:f[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:g?(0,w.jsx)(ax,{radius:S/2,className:c}):(0,w.jsx)(av,{dimensions:M,lineWidth:r,variant:t,className:c})}),(0,w.jsx)("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N})`})]})}a_.displayName="Background";let aS=(0,b.memo)(a_);function aE(){return(0,w.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:(0,w.jsx)("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function aM(){return(0,w.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:(0,w.jsx)("path",{d:"M0 0h32v4.2H0z"})})}function ak(){return(0,w.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:(0,w.jsx)("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function aN(){return(0,w.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,w.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function aC(){return(0,w.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,w.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function aA({children:e,className:t,...n}){return(0,w.jsx)("button",{type:"button",className:_(["react-flow__controls-button",t]),...n,children:e})}let aP=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function az({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:a,onFitView:l,onInteractiveChange:s,className:u,children:c,position:d="bottom-left",orientation:f="vertical","aria-label":h="React Flow controls"}){let p=oJ(),{isInteractive:g,minZoomReached:m,maxZoomReached:y}=oQ(aP,oW),{zoomIn:v,zoomOut:x,fitView:b}=rI();return(0,w.jsxs)(o9,{className:_(["react-flow__controls","horizontal"===f?"horizontal":"vertical",u]),position:d,style:e,"data-testid":"rf__controls","aria-label":h,children:[t&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(aA,{onClick:()=>{v(),i?.()},className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:y,children:(0,w.jsx)(aE,{})}),(0,w.jsx)(aA,{onClick:()=>{x(),a?.()},className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:m,children:(0,w.jsx)(aM,{})})]}),n&&(0,w.jsx)(aA,{className:"react-flow__controls-fitview",onClick:()=>{b(r),l?.()},title:"fit view","aria-label":"fit view",children:(0,w.jsx)(ak,{})}),o&&(0,w.jsx)(aA,{className:"react-flow__controls-interactive",onClick:()=>{p.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),s?.(!g)},title:"toggle interactivity","aria-label":"toggle interactivity",children:g?(0,w.jsx)(aC,{}):(0,w.jsx)(aN,{})}),c]})}az.displayName="Controls";let a$=(0,b.memo)(az),aI=(0,b.memo)(function({id:e,x:t,y:n,width:o,height:r,style:i,color:a,strokeColor:l,strokeWidth:s,className:u,borderRadius:c,shapeRendering:d,selected:f,onClick:h}){let{background:p,backgroundColor:g}=i||{};return(0,w.jsx)("rect",{className:_(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:c,ry:c,width:o,height:r,style:{fill:a||p||g,stroke:l,strokeWidth:s},shapeRendering:d,onClick:h?t=>h(t,e):void 0})}),aR=e=>e.nodes.map(e=>e.id),aj=e=>e instanceof Function?e:()=>e,aO=(0,b.memo)(function({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:a,NodeComponent:l,onClick:s}){let{node:u,x:c,y:d,width:f,height:h}=oQ(t=>{let{internals:n}=t.nodeLookup.get(e),o=n.userNode,{x:r,y:i}=n.positionAbsolute,{width:a,height:l}=nH(o);return{node:o,x:r,y:i,width:a,height:l}},oW);return u&&!u.hidden&&nT(u)?(0,w.jsx)(l,{x:c,y:d,width:f,height:h,style:u.style,selected:!!u.selected,className:o(u),color:t(u),borderRadius:r,strokeColor:n(u),strokeWidth:i,shapeRendering:a,onClick:s,id:u.id}):null});var aB=(0,b.memo)(function({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:r,nodeComponent:i=aI,onClick:a}){let l=oQ(aR,oW),s=aj(t),u=aj(e),c=aj(n),d="undefined"==typeof window||window.chrome?"crispEdges":"geometricPrecision";return(0,w.jsx)(w.Fragment,{children:l.map(e=>(0,w.jsx)(aO,{id:e,nodeColorFunc:s,nodeStrokeColorFunc:u,nodeClassNameFunc:c,nodeBorderRadius:o,nodeStrokeWidth:r,NodeComponent:i,onClick:a,shapeRendering:d},e))})});let aD=e=>!e.hidden,aH=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?nN(nd(e.nodeLookup,{filter:aD}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}};function aT({style:e,className:t,nodeStrokeColor:n,nodeColor:o,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:a,nodeComponent:l,bgColor:s,maskColor:u,maskStrokeColor:c,maskStrokeWidth:d,position:f="bottom-right",onClick:h,onNodeClick:p,pannable:g=!1,zoomable:m=!1,ariaLabel:y="React Flow mini map",inversePan:v,zoomStep:x=10,offsetScale:S=5}){let E=oJ(),M=(0,b.useRef)(null),{boundingRect:k,viewBB:N,rfId:C,panZoom:A,translateExtent:P,flowWidth:z,flowHeight:$}=oQ(aH,oW),I=e?.width??200,R=e?.height??150,j=Math.max(k.width/I,k.height/R),O=j*I,B=j*R,D=S*j,H=k.x-(O-k.width)/2-D,T=k.y-(B-k.height)/2-D,L=O+2*D,V=B+2*D,F=`react-flow__minimap-desc-${C}`,X=(0,b.useRef)(0),Y=(0,b.useRef)();X.current=j,(0,b.useEffect)(()=>{if(M.current&&A)return Y.current=function({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){let r=ep(e);return{update:function({translateExtent:e,width:i,height:a,zoomStep:l=10,pannable:s=!0,zoomable:u=!0,inversePan:c=!1}){let d=[0,0],f=t4().on("start",e=>{("mousedown"===e.sourceEvent.type||"touchstart"===e.sourceEvent.type)&&(d=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on("zoom",s?r=>{let l=n();if("mousemove"!==r.sourceEvent.type&&"touchmove"!==r.sourceEvent.type||!t)return;let s=[r.sourceEvent.clientX??r.sourceEvent.touches[0].clientX,r.sourceEvent.clientY??r.sourceEvent.touches[0].clientY],u=[s[0]-d[0],s[1]-d[1]];d=s;let f=o()*Math.max(l[2],Math.log(l[2]))*(c?-1:1),h={x:l[0]-u[0]*f,y:l[1]-u[1]*f};t.setViewportConstrained({x:h.x,y:h.y,zoom:l[2]},[[0,0],[i,a]],e)}:null).on("zoom.wheel",u?e=>{let o=n();if("wheel"!==e.sourceEvent.type||!t)return;let r=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*l,i=o[2]*Math.pow(2,r);t.scaleTo(i)}:null);r.call(f,{})},destroy:function(){r.on("zoom",null)},pointer:eg}}({domNode:M.current,panZoom:A,getTransform:()=>E.getState().transform,getViewScale:()=>X.current}),()=>{Y.current?.destroy()}},[A]),(0,b.useEffect)(()=>{Y.current?.update({translateExtent:P,width:z,height:$,inversePan:v,pannable:g,zoomStep:x,zoomable:m})},[g,m,v,x,P,z,$]);let q=h?e=>{let[t,n]=Y.current?.pointer(e)||[0,0];h(e,{x:t,y:n})}:void 0,W=p?(0,b.useCallback)((e,t)=>{p(e,E.getState().nodeLookup.get(t).internals.userNode)},[]):void 0;return(0,w.jsx)(o9,{position:f,style:{...e,"--xy-minimap-background-color-props":"string"==typeof s?s:void 0,"--xy-minimap-mask-background-color-props":"string"==typeof u?u:void 0,"--xy-minimap-mask-stroke-color-props":"string"==typeof c?c:void 0,"--xy-minimap-mask-stroke-width-props":"number"==typeof d?d*j:void 0,"--xy-minimap-node-background-color-props":"string"==typeof o?o:void 0,"--xy-minimap-node-stroke-color-props":"string"==typeof n?n:void 0,"--xy-minimap-node-stroke-width-props":"number"==typeof a?a:void 0},className:_(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:(0,w.jsxs)("svg",{width:I,height:R,viewBox:`${H} ${T} ${L} ${V}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":F,ref:M,onClick:q,children:[y&&(0,w.jsx)("title",{id:F,children:y}),(0,w.jsx)(aB,{onClick:W,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:a,nodeComponent:l}),(0,w.jsx)("path",{className:"react-flow__minimap-mask",d:`M${H-D},${T-D}h${L+2*D}v${V+2*D}h${-L-2*D}z
3
- M${N.x},${N.y}h${N.width}v${N.height}h${-N.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}aT.displayName="MiniMap";let aL=(0,b.memo)(aT),aV=(0,b.memo)(function({nodeId:e,position:t,variant:n=v.Handle,className:o,style:r={},children:i,color:a,minWidth:l=10,minHeight:s=10,maxWidth:u=Number.MAX_VALUE,maxHeight:c=Number.MAX_VALUE,keepAspectRatio:d=!1,shouldResize:f,onResizeStart:h,onResize:p,onResizeEnd:g}){let m=rG(),y="string"==typeof e?e:m,x=oJ(),S=(0,b.useRef)(null),E=n===v.Line?"right":"bottom-right",M=t??E,k=(0,b.useRef)(null);(0,b.useEffect)(()=>{if(S.current&&y)return k.current||(k.current=function({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){let i=ep(e);return{update:function({controlPosition:e,boundaries:a,keepAspectRatio:l,onResizeStart:s,onResize:u,onResizeEnd:c,shouldResize:d}){let f,h,p,g,m={...oO},y={...oB},v=function(e){let t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:e.includes("left"),affectsY:e.includes("top")}}(e),x=null,w=[],b=eC().on("start",e=>{let{nodeLookup:o,transform:r,snapGrid:i,snapToGrid:a,nodeOrigin:l,paneDomNode:u}=n();if(!(f=o.get(t)))return;x=u?.getBoundingClientRect()??null;let{xSnapped:c,ySnapped:d}=nF(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:a,containerBounds:x});if(y={...m={width:f.measured.width??0,height:f.measured.height??0,x:f.position.x??0,y:f.position.y??0},pointerX:c,pointerY:d,aspectRatio:m.width/m.height},h=void 0,f.parentId&&("parent"===f.extent||f.expandParent)){var v;p=(h=o.get(f.parentId))&&"parent"===f.extent?[[0,0],[(v=h).measured.width,v.measured.height]]:void 0}for(let[e,n]of(w=[],g=void 0,o))if(n.parentId===t&&(w.push({id:e,position:{...n.position},extent:n.extent}),"parent"===n.extent||n.expandParent)){let e=function(e,t,n){let o=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,a=e.measured.height??0,l=n[0]*i,s=n[1]*a;return[[o-l,r-s],[o+i-l,r+a-s]]}(n,f,n.origin??l);g=g?[[Math.min(e[0][0],g[0][0]),Math.min(e[0][1],g[0][1])],[Math.max(e[1][0],g[1][0]),Math.max(e[1][1],g[1][1])]]:e}s?.(e,{...m})}).on("drag",e=>{let{transform:t,snapGrid:r,snapToGrid:i,nodeOrigin:s}=n(),c=nF(e.sourceEvent,{transform:t,snapGrid:r,snapToGrid:i,containerBounds:x}),b=[];if(!f)return;let{x:_,y:S,width:E,height:M}=m,k={},N=f.origin??s,{width:C,height:A,x:P,y:z}=function(e,t,n,o,r,i,a,l){var s,u,c,d;let{affectsX:f,affectsY:h}=t,{isHorizontal:p,isVertical:g}=t,m=p&&g,{xSnapped:y,ySnapped:v}=n,{minWidth:x,maxWidth:w,minHeight:b,maxHeight:_}=o,{x:S,y:E,width:M,height:k,aspectRatio:N}=e,C=Math.floor(p?y-e.pointerX:0),A=Math.floor(g?v-e.pointerY:0),P=M+(f?-C:C),z=k+(h?-A:A),$=-i[0]*M,I=-i[1]*k,R=oj(P,x,w),j=oj(z,b,_);if(a){let e=0,t=0;f&&C<0?e=oI(S+C+$,a[0][0]):!f&&C>0&&(e=oR(S+P+$,a[1][0])),h&&A<0?t=oI(E+A+I,a[0][1]):!h&&A>0&&(t=oR(E+z+I,a[1][1])),R=Math.max(R,e),j=Math.max(j,t)}if(l){let e=0,t=0;f&&C>0?e=oR(S+C,l[0][0]):!f&&C<0&&(e=oI(S+P,l[1][0])),h&&A>0?t=oR(E+A,l[0][1]):!h&&A<0&&(t=oI(E+z,l[1][1])),R=Math.max(R,e),j=Math.max(j,t)}if(r){if(p){if(R=Math.max(R,oj(P/N,b,_)*N),a){let e=0;R=Math.max(R,(f||h)&&(!f||h||!m)?oI(E+I+(f?C:-C)/N,a[0][1])*N:oR(E+I+P/N,a[1][1])*N)}if(l){let e=0;R=Math.max(R,(f||h)&&(!f||h||!m)?oR(E+(f?C:-C)/N,l[0][1])*N:oI(E+P/N,l[1][1])*N)}}if(g){if(j=Math.max(j,oj(z*N,x,w)/N),a){let e=0;j=Math.max(j,(f||h)&&(!h||f||!m)?oI(S+(h?A:-A)*N+$,a[0][0])/N:oR(S+z*N+$,a[1][0])/N)}if(l){let e=0;j=Math.max(j,(f||h)&&(!h||f||!m)?oR(S+(h?A:-A)*N,l[0][0])/N:oI(S+z*N,l[1][0])/N)}}}A+=A<0?j:-j,C+=C<0?R:-R,r&&(m?P>z*N?A=((s=f,u=h,s?!u:u)?-C:C)/N:C=((c=f,d=h,c?!d:d)?-A:A)*N:p?(A=C/N,h=f):(C=A*N,f=h));let O=f?S+C:S,B=h?E+A:E;return{width:M+(f?-C:C),height:k+(h?-A:A),x:i[0]*C*(f?-1:1)+O,y:i[1]*A*(h?-1:1)+B}}(y,v,c,a,l,N,p,g),$=C!==E,I=A!==M,R=P!==_&&$,j=z!==S&&I;if(!R&&!j&&!$&&!I)return;if((R||j||1===N[0]||1===N[1])&&(k.x=R?P:m.x,k.y=j?z:m.y,m.x=k.x,m.y=k.y,w.length>0)){let e=P-_,t=z-S;for(let n of w)n.position={x:n.position.x-e+N[0]*(C-E),y:n.position.y-t+N[1]*(A-M)},b.push(n)}if(($||I)&&(k.width=$?C:m.width,k.height=I?A:m.height,m.width=k.width,m.height=k.height),h&&f.expandParent){let e=N[0]*(k.width??0);k.x&&k.x<e&&(m.x=e,y.x=y.x-(k.x-e));let t=N[1]*(k.height??0);k.y&&k.y<t&&(m.y=t,y.y=y.y-(k.y-t))}let O=function({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:i}){let a=e-t,l=n-o,s=[a>0?1:a<0?-1:0,l>0?1:l<0?-1:0];return a&&r&&(s[0]=-1*s[0]),l&&i&&(s[1]=-1*s[1]),s}({width:m.width,prevWidth:E,height:m.height,prevHeight:M,affectsX:v.affectsX,affectsY:v.affectsY}),B={...m,direction:O};!1!==d?.(e,B)&&(u?.(e,B),o(k,b))}).on("end",e=>{c?.(e,{...m}),r?.({...m})});i.call(b)},destroy:function(){i.on(".drag",null)}}}({domNode:S.current,nodeId:y,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:o,nodeOrigin:r,domNode:i}=x.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:o,nodeOrigin:r,paneDomNode:i}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:o,parentLookup:r,nodeOrigin:i}=x.getState(),a=[],l={x:e.x,y:e.y},s=o.get(y);if(s&&s.expandParent&&s.parentId){let t=s.origin??i,n=e.width??s.measured.width??0,u=e.height??s.measured.height??0,c=of([{id:s.id,parentId:s.parentId,rect:{width:n,height:u,...nL({x:e.x??s.position.x,y:e.y??s.position.y},{width:n,height:u},s.parentId,o,t)}}],o,r,i);a.push(...c),l.x=e.x?Math.max(t[0]*n,e.x):void 0,l.y=e.y?Math.max(t[1]*u,e.y):void 0}if(void 0!==l.x&&void 0!==l.y){let e={id:y,type:"position",position:{...l}};a.push(e)}if(void 0!==e.width&&void 0!==e.height){let t={id:y,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:e.width,height:e.height}};a.push(t)}for(let e of t){let t={...e,type:"position"};a.push(t)}n(a)},onEnd:({width:e,height:t})=>{x.getState().triggerNodeChanges([{id:y,type:"dimensions",resizing:!1,dimensions:{width:e,height:t}}])}})),k.current.update({controlPosition:M,boundaries:{minWidth:l,minHeight:s,maxWidth:u,maxHeight:c},keepAspectRatio:d,onResizeStart:h,onResize:p,onResizeEnd:g,shouldResize:f}),()=>{k.current?.destroy()}},[M,l,s,u,c,d,h,p,g,f]);let N=M.split("-"),C=n===v.Line?"borderColor":"backgroundColor",A=a?{...r,[C]:a}:r;return(0,w.jsx)("div",{className:_(["react-flow__resize-control","nodrag",...N,n,o]),ref:S,style:A,children:i})});function aF({nodeId:e,isVisible:t=!0,handleClassName:n,handleStyle:o,lineClassName:r,lineStyle:i,color:a,minWidth:l=10,minHeight:s=10,maxWidth:u=Number.MAX_VALUE,maxHeight:c=Number.MAX_VALUE,keepAspectRatio:d=!1,shouldResize:f,onResizeStart:h,onResize:p,onResizeEnd:g}){return t?(0,w.jsxs)(w.Fragment,{children:[o$.map(t=>(0,w.jsx)(aV,{className:r,style:i,nodeId:e,position:t,variant:v.Line,color:a,minWidth:l,minHeight:s,maxWidth:u,maxHeight:c,onResizeStart:h,keepAspectRatio:d,shouldResize:f,onResize:p,onResizeEnd:g},t)),oz.map(t=>(0,w.jsx)(aV,{className:n,style:o,nodeId:e,position:t,color:a,minWidth:l,minHeight:s,maxWidth:u,maxHeight:c,onResizeStart:h,keepAspectRatio:d,shouldResize:f,onResize:p,onResizeEnd:g},t))]}):null}let aX=e=>e.domNode?.querySelector(".react-flow__renderer");function aY({children:e}){let t=oQ(aX);return t?(0,oZ.createPortal)(e,t):null}let aq=(e,t)=>e?.internals.positionAbsolute.x!==t?.internals.positionAbsolute.x||e?.internals.positionAbsolute.y!==t?.internals.positionAbsolute.y||e?.measured.width!==t?.measured.width||e?.measured.height!==t?.measured.height||e?.selected!==t?.selected||e?.internals.z!==t?.internals.z,aW=(e,t)=>{if(e.size!==t.size)return!1;for(let[n,o]of e)if(aq(o,t.get(n)))return!1;return!0},aZ=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2],selectedNodesCount:e.nodes.filter(e=>e.selected).length});function aK({nodeId:e,children:t,className:n,style:o,isVisible:r,position:i=y.Top,offset:a=10,align:l="center",...s}){let u=rG(),c=oQ((0,b.useCallback)(t=>(Array.isArray(e)?e:[e||u||""]).reduce((e,n)=>{let o=t.nodeLookup.get(n);return o&&e.set(o.id,o),e},new Map),[e,u]),aW),{x:d,y:f,zoom:h,selectedNodesCount:p}=oQ(aZ,oW);if(!("boolean"==typeof r?r:1===c.size&&c.values().next().value?.selected&&1===p)||!c.size)return null;let g=nd(c),m=Array.from(c.values()),v=Math.max(...m.map(e=>e.internals.z+1)),x={position:"absolute",transform:function(e,t,n,o,r){let i=.5;"start"===r?i=0:"end"===r&&(i=1);let a=[(e.x+e.width*i)*t.zoom+t.x,e.y*t.zoom+t.y-o],l=[-100*i,-100];switch(n){case y.Right:a=[(e.x+e.width)*t.zoom+t.x+o,(e.y+e.height*i)*t.zoom+t.y],l=[0,-100*i];break;case y.Bottom:a[1]=(e.y+e.height)*t.zoom+t.y+o,l[1]=0;break;case y.Left:a=[e.x*t.zoom+t.x-o,(e.y+e.height*i)*t.zoom+t.y],l=[-100,-100*i]}return`translate(${a[0]}px, ${a[1]}px) translate(${l[0]}%, ${l[1]}%)`}(g,{x:d,y:f,zoom:h},i,a,l),zIndex:v,...o};return(0,w.jsx)(aY,{children:(0,w.jsx)("div",{style:x,className:_(["react-flow__node-toolbar",n]),...s,"data-id":m.reduce((e,t)=>`${e}${t.id} `,"").trim(),children:t})})}},11151:function(e,t,n){var o=n(8491),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=o.useState,a=o.useEffect,l=o.useLayoutEffect,s=o.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),o=i({inst:{value:n,getSnapshot:t}}),r=o[0].inst,c=o[1];return l(function(){r.value=n,r.getSnapshot=t,u(r)&&c({inst:r})},[e,n,t]),a(function(){return u(r)&&c({inst:r}),e(function(){u(r)&&c({inst:r})})},[e]),s(n),n};t.useSyncExternalStore=void 0!==o.useSyncExternalStore?o.useSyncExternalStore:c},63344:function(e,t,n){var o=n(8491),r=n(94191),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useSyncExternalStore,l=o.useRef,s=o.useEffect,u=o.useMemo,c=o.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,o,r){var d=l(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;var h=a(e,(d=u(function(){function e(e){if(!s){if(s=!0,a=e,e=o(e),void 0!==r&&f.hasValue){var t=f.value;if(r(t,e))return l=t}return l=e}if(t=l,i(a,e))return t;var n=o(e);return void 0!==r&&r(t,n)?(a=e,t):(a=e,l=n)}var a,l,s=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,n,o,r]))[0],d[1]);return s(function(){f.hasValue=!0,f.value=h},[h]),c(h),h}},94191:function(e,t,n){e.exports=n(11151)},40789:function(e,t,n){e.exports=n(63344)}}]);
@@ -1,19 +0,0 @@
1
- /**
2
- * @license React
3
- * use-sync-external-store-shim.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */
10
-
11
- /**
12
- * @license React
13
- * use-sync-external-store-shim/with-selector.production.js
14
- *
15
- * Copyright (c) Meta Platforms, Inc. and affiliates.
16
- *
17
- * This source code is licensed under the MIT license found in the
18
- * LICENSE file in the root directory of this source tree.
19
- */